|  |  |  | 
|---|
|  |  |  | {{# | 
|---|
|  |  |  | var certifyStatus = { | 
|---|
|  |  |  | 0: {title: '未通过', color: 'red'}, | 
|---|
|  |  |  | 1: {title: '审核中', color: 'blue'}, | 
|---|
|  |  |  | 1: {title: '待审核', color: 'blue'}, | 
|---|
|  |  |  | 2: {title: '审核通过', color: 'green'}, | 
|---|
|  |  |  | 3: {title: '未实名', color: 'cyan'} | 
|---|
|  |  |  | 3: {title: '未实名'} | 
|---|
|  |  |  | }[d.certifyStatus]; | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | <span class="layui-badge febs-tag-{{certifyStatus.color}}">{{ certifyStatus.title }}</span> | 
|---|
|  |  |  | 
|---|
|  |  |  | <span shiro:lacksPermission="user:view,user:update,user:delete"> | 
|---|
|  |  |  | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 | 
|---|
|  |  |  | </span> | 
|---|
|  |  |  | <a lay-event="detail" shiro:hasPermission="user:view"><i | 
|---|
|  |  |  | class="layui-icon febs-edit-area febs-green"></i></a> | 
|---|
|  |  |  | <a lay-event="edit" shiro:hasPermission="user:update"><i | 
|---|
|  |  |  | class="layui-icon febs-edit-area febs-blue"></i></a> | 
|---|
|  |  |  | <a lay-event="del" shiro:hasPermission="user:delete"><i class="layui-icon febs-edit-area febs-red"></i></a> | 
|---|
|  |  |  | class="layui-icon febs-edit-area febs-blue"></i></a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!-- 表格操作栏 end --> | 
|---|
|  |  |  | <script data-th-inline="none" type="text/javascript"> | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 新增下拉组件 | 
|---|
|  |  |  | /** | 
|---|
|  |  |  |  | 
|---|
|  |  |  | dropdown.render({ | 
|---|
|  |  |  | elem: $view.find('.action-more'), | 
|---|
|  |  |  | click: function (name, elem, event) { | 
|---|
|  |  |  | var checkStatus = table.checkStatus('userTable'); | 
|---|
|  |  |  | if (name === 'add') { | 
|---|
|  |  |  | febs.modal.open('新增用户', 'system/user/add', { | 
|---|
|  |  |  | btn: ['提交', '重置'], | 
|---|
|  |  |  | area: $(window).width() <= 750 ? '95%' : '50%', | 
|---|
|  |  |  | offset: '30px', | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#user-add').find('#submit').trigger('click'); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | $('#user-add').find('#reset').trigger('click'); | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (name === 'delete') { | 
|---|
|  |  |  | if (!checkStatus.data.length) { | 
|---|
|  |  |  | febs.alert.warn('请选择需要删除的用户'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | febs.modal.confirm('删除用户', '确定删除该用户?', function () { | 
|---|
|  |  |  | var userIds = []; | 
|---|
|  |  |  | layui.each(checkStatus.data, function (key, item) { | 
|---|
|  |  |  | userIds.push(item.userId) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | deleteUsers(userIds.join(',')); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (name === 'reset') { | 
|---|
|  |  |  | if (!checkStatus.data.length) { | 
|---|
|  |  |  | febs.alert.warn('请选择需要重置密码的用户'); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | var usernames = []; | 
|---|
|  |  |  | layui.each(checkStatus.data, function (key, item) { | 
|---|
|  |  |  | usernames.push(item.username) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | febs.post(ctx + 'user/password/reset/' + usernames.join(','), null, function () { | 
|---|
|  |  |  | febs.alert.success('所选用户密码已重置为1234qwer'); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (name === 'export') { | 
|---|
|  |  |  | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); | 
|---|
|  |  |  | params.pageSize = $view.find(".layui-laypage-limits option:selected").val(); | 
|---|
|  |  |  | params.pageNum = $view.find(".layui-laypage-em").next().html(); | 
|---|
|  |  |  | febs.download(ctx + 'user/excel', params, '用户信息表.xlsx'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | options: [{ | 
|---|
|  |  |  | name: 'add', | 
|---|
|  |  |  | title: '新增用户', | 
|---|
|  |  |  | perms: 'user:add' | 
|---|
|  |  |  | }, { | 
|---|
|  |  |  | name: 'delete', | 
|---|
|  |  |  | title: '删除用户', | 
|---|
|  |  |  | perms: 'user:delete' | 
|---|
|  |  |  | }, { | 
|---|
|  |  |  | name: 'reset', | 
|---|
|  |  |  | title: '密码重置', | 
|---|
|  |  |  | perms: 'user:password:reset' | 
|---|
|  |  |  | }, { | 
|---|
|  |  |  | name: 'export', | 
|---|
|  |  |  | title: '导出Excel', | 
|---|
|  |  |  | perms: 'user:export' | 
|---|
|  |  |  | }] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | */ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 下拉框选择器 | 
|---|
|  |  |  | treeSelect.render({ | 
|---|
|  |  |  | elem: $view.find('#dept'), | 
|---|
|  |  |  | 
|---|
|  |  |  | table.on('tool(userTable)', function (obj) { | 
|---|
|  |  |  | var data = obj.data, | 
|---|
|  |  |  | layEvent = obj.event; | 
|---|
|  |  |  | if (layEvent === 'detail') { | 
|---|
|  |  |  | febs.modal.view('用户信息', 'system/user/detail/' + data.username, { | 
|---|
|  |  |  | area: $(window).width() <= 750 ? '95%' : '660px' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'del') { | 
|---|
|  |  |  | febs.modal.confirm('删除用户', '确定删除该用户?', function () { | 
|---|
|  |  |  | deleteUsers(data.userId); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (layEvent === 'edit') { | 
|---|
|  |  |  | febs.modal.open('修改用户', 'system/user/update/' + data.username, { | 
|---|
|  |  |  | area: $(window).width() <= 750 ? '90%' : '50%', | 
|---|
|  |  |  | offset: '30px', | 
|---|
|  |  |  | febs.modal.open('身份认证', 'modules/member/memberDetail/' + data.id, { | 
|---|
|  |  |  | area: $(window).width() <= 1000 ? '100%' : '50%', | 
|---|
|  |  |  | btn: ['提交', '取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#user-update').find('#submit').trigger('click'); | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 查询按钮 | 
|---|
|  |  |  | $query.on('click', function () { | 
|---|
|  |  |  | 
|---|
|  |  |  | id: 'userTable', | 
|---|
|  |  |  | url: ctx + 'member/getList', | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'checkbox'}, | 
|---|
|  |  |  | {field: 'phone', title: '手机号', minWidth: 165}, | 
|---|
|  |  |  | {field: 'email', title: '邮箱', minWidth: 200}, | 
|---|
|  |  |  | {field: 'inviteId', title: '邀请码UID'}, | 
|---|
|  |  |  | {field: 'refererId', title: '上级邀请码UID'}, | 
|---|
|  |  |  | {title: '账号类型', templet: '#account-type'}, | 
|---|
|  |  |  | {title: '账号状态', templet: '#account-status'}, | 
|---|
|  |  |  | {title: '审核状态', templet: '#certify-status'}, | 
|---|
|  |  |  | {field: 'createTime', title: '注册时间', minWidth: 180}, | 
|---|
|  |  |  | {field: 'phone', title: '手机号', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'email', title: '邮箱', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {field: 'inviteId', title: '邀请码UID', minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {field: 'refererId', title: '上级邀请码UID', minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {title: '账号类型', templet: '#account-type', minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {title: '账号状态', templet: '#account-status', minWidth: 50,align:'center'}, | 
|---|
|  |  |  | {title: '审核状态', templet: '#certify-status', minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'}, | 
|---|
|  |  |  | {title: '操作', toolbar: '#user-option', minWidth: 140, fixed : 'right'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|