|  |  |  | 
|---|
|  |  |  | // ,{field: 'createTime$', align: 'center',title: '注册时间'} | 
|---|
|  |  |  | ,{field: 'status$', align: 'center',title: '状态', templet: '#statusTpl', width: 120, unresize: true} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:100} | 
|---|
|  |  |  | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:170} | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | request: { | 
|---|
|  |  |  | pageName: 'curr', | 
|---|
|  |  |  | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: 'user_detail.html', | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | layer.getChildFrame('#password', index).parent().parent().hide(); | 
|---|
|  |  |  | setFormVal(layer.getChildFrame('#detail', index), data); | 
|---|
|  |  |  | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); | 
|---|
|  |  |  | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 'Host': | 
|---|
|  |  |  | var param = top.reObject(data).hostId; | 
|---|
|  |  |  | if (param === undefined) { | 
|---|
|  |  |  | layer.msg("无数据"); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: '详情', | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | area: [top.detailHeight, top.detailWidth], | 
|---|
|  |  |  | shadeClose: false, | 
|---|
|  |  |  | content: '../host/host_detail.html', | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/host/"+ param +"/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | method: 'GET', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | setFormVal(layer.getChildFrame('#detail', index), res.data); | 
|---|
|  |  |  | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); | 
|---|
|  |  |  | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); | 
|---|
|  |  |  | layer.iframeAuto(index); | 
|---|
|  |  |  | layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); | 
|---|
|  |  |  | layero.find('iframe')[0].contentWindow.layui.form.render('select'); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | parent.location.href = "/"; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | layer.msg(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 重置密码 | 
|---|
|  |  |  | case 'resetPwd': | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | title: '重置密码', | 
|---|
|  |  |  | offset: '150px', | 
|---|
|  |  |  | area: ['360px'], | 
|---|
|  |  |  | shade: 0.1, | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: $("#resetpwd-window"), | 
|---|
|  |  |  | success: function(layero, index){ | 
|---|
|  |  |  | layer.iframeAuto(index); | 
|---|
|  |  |  | $('#resetUserId').val(data.id); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | parent.layer.closeAll(); | 
|---|
|  |  |  | tableReload(true); | 
|---|
|  |  |  | parent.$(".layui-laypage-btn")[0].click(); | 
|---|
|  |  |  | $("#data-detail :input").each(function () { | 
|---|
|  |  |  | $(this).val(""); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | ,type: 'datetime' | 
|---|
|  |  |  | ,range: true | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 重置密码 | 
|---|
|  |  |  | form.on('submit(savePwd)', function (data) { | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/user/edit/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | id: data.field.resetUserId, | 
|---|
|  |  |  | password: hex_md5(data.field.resetPassword) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | layer.msg("重置密码成功"); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | layer.msg(res.msg) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $('#cancel').click(function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 关闭动作 | 
|---|