|  |  |  | 
|---|
|  |  |  | height: 'full-100', | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'checkbox'} | 
|---|
|  |  |  | // ,{field: 'hostName', align: 'center',title: '授权商户', templet: '#hostTpl', width: 140} | 
|---|
|  |  |  | ,{field: 'hostName', align: 'center',title: '授权商户', templet: '#hostTpl', width: 140} | 
|---|
|  |  |  | // ,{field: 'nickname', align: 'center',title: '用户名'} | 
|---|
|  |  |  | ,{field: 'username', align: 'center',title: '登录账户'} | 
|---|
|  |  |  | ,{field: 'mobile', align: 'center',title: '手机号'} | 
|---|
|  |  |  | ,{field: 'username', align: 'center',title: '用户名'} | 
|---|
|  |  |  | // ,{field: 'deptName', align: 'center',title: '所属部门'} | 
|---|
|  |  |  | ,{field: 'roleName', align: 'center',title: '角色'} | 
|---|
|  |  |  | ,{field: 'email', align: 'center',title: '邮箱'} | 
|---|
|  |  |  | // ,{field: 'sex$', align: 'center',title: '性别'} | 
|---|
|  |  |  | ,{field: 'sex$', align: 'center',title: '性别'} | 
|---|
|  |  |  | ,{field: 'createTime$', align: 'center',title: '注册时间', hide: true} | 
|---|
|  |  |  | ,{field: 'status$', align: 'center',title: '状态', templet: '#statusTpl', width: 120, unresize: true} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 表格2头工具栏点击事件 */ | 
|---|
|  |  |  | table.on('toolbar(userTable)', function (obj) { | 
|---|
|  |  |  | var checkStatus = table.checkStatus(obj.config.id).data; | 
|---|
|  |  |  | if (obj.event === 'add') { // 添加 | 
|---|
|  |  |  | showEditModel() | 
|---|
|  |  |  | } else if (obj.event === 'del') { // 删除 | 
|---|
|  |  |  | if (checkStatus.length === 0) { | 
|---|
|  |  |  | var checkRows = table.checkStatus('userTable'); | 
|---|
|  |  |  | if (checkRows.data.length === 0) { | 
|---|
|  |  |  | layer.msg('请选择要删除的数据', {icon: 2}); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | del(checkStatus.map(function (d) { | 
|---|
|  |  |  | var ids = checkRows.data.map(function (d) { | 
|---|
|  |  |  | return d.id; | 
|---|
|  |  |  | })); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | doDelUser({ids: ids}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | // 删除 | 
|---|
|  |  |  | case 'del': | 
|---|
|  |  |  | del([data.id]); | 
|---|
|  |  |  | var ids = [obj.id]; | 
|---|
|  |  |  | doDelUser({ids: ids}); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | // 重置密码 | 
|---|
|  |  |  | case 'resetPwd': | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 删除订单 */ | 
|---|
|  |  |  | function del(ids) { | 
|---|
|  |  |  | function doDelUser(obj) { | 
|---|
|  |  |  | layer.confirm('确定要删除选中数据吗?', { | 
|---|
|  |  |  | skin: 'layui-layer-admin', | 
|---|
|  |  |  | shade: .1 | 
|---|
|  |  |  | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/user/delete/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: {ids: ids}, | 
|---|
|  |  |  | data: {ids: obj.ids}, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | layer.close(loadIndex); | 
|---|