| | |
| | | <input type="checkbox" value={{d.userId}} lay-text="简单模式|困难模式" lay-skin="switch" lay-filter="switchModelType"> |
| | | {{# } }} |
| | | </script> |
| | | <script type="text/html" id="switchCreateGroup"> |
| | | {{# if(d.createGroup === 1) { }} |
| | | <input type="checkbox" value={{d.userId}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchCreateGroup"> |
| | | {{# } else { }} |
| | | <input type="checkbox" value={{d.userId}} lay-text="是|否" lay-skin="switch" lay-filter="switchCreateGroup"> |
| | | {{# } }} |
| | | </script> |
| | | <style> |
| | | .layui-form-onswitch { |
| | | background-color: #5FB878 !important; |
| | |
| | | {field: 'status', title: '账号状态', templet: '#switchStatus', minWidth: 80,align:'center'}, |
| | | {field: 'isRobot', title: '机器人', templet: '#switchIsRobot', minWidth: 80,align:'center'}, |
| | | {field: 'modelType', title: '模式', templet: '#switchModelType', minWidth: 80,align:'center'}, |
| | | {field: 'createGroup', title: '允许建群', templet: '#switchCreateGroup', minWidth: 80,align:'center'}, |
| | | {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | ]] |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | form.on('switch(switchCreateGroup)', function (data) { |
| | | if (data.elem.checked) { |
| | | openCreateGroup(data.value); |
| | | } else { |
| | | closeCreateGroup(data.value); |
| | | } |
| | | }) |
| | | function openCreateGroup(userId) { |
| | | febs.get(ctx + 'admin/chat/openCreateGroup/' + userId, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function closeCreateGroup(userId) { |
| | | febs.get(ctx + 'admin/chat/closeCreateGroup/' + userId, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | form.on('switch(switchModelType)', function (data) { |
| | | if (data.elem.checked) { |
| | | openModelType(data.value); |