|  |  |  | 
|---|
|  |  |  | // ,{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 { | 
|---|
|  |  |  | // 重置密码 | 
|---|
|  |  |  | case 'resetPwd': | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: '详情', | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | area: [top.detailHeight, top.detailWidth], | 
|---|
|  |  |  | shadeClose: false, | 
|---|
|  |  |  | content: '../host/host_detail.html', | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | title: '重置密码', | 
|---|
|  |  |  | offset: '150px', | 
|---|
|  |  |  | area: ['360px'], | 
|---|
|  |  |  | shade: 0.1, | 
|---|
|  |  |  | shadeClose: true, | 
|---|
|  |  |  | content: $("#resetpwd-window"), | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | $('#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(); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 关闭动作 | 
|---|
|  |  |  | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> | 
|---|
|  |  |  | <link rel="stylesheet" href="../../static/css/common.css" media="all"> | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | #resetpwd-window .layui-form { | 
|---|
|  |  |  | padding: 25px 30px 0 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #resetpwd-window .layui-form-label { | 
|---|
|  |  |  | padding: 8px 15px; | 
|---|
|  |  |  | box-sizing: content-box; | 
|---|
|  |  |  | -webkit-box-sizing: content-box; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #resetpwd-window .layui-form-required:before { | 
|---|
|  |  |  | content: "*"; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | font-family: SimSun,serif; | 
|---|
|  |  |  | margin-right: 4px; | 
|---|
|  |  |  | font-size: 14px; | 
|---|
|  |  |  | line-height: 1; | 
|---|
|  |  |  | color: #ed4014; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #resetpwd-window .layui-input { | 
|---|
|  |  |  | height: 36px; | 
|---|
|  |  |  | border-radius: 4px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #resetpwd-window .cool-button-contain { | 
|---|
|  |  |  | text-align: right; | 
|---|
|  |  |  | margin: 20px 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #resetpwd-window .layui-form-radio>i:hover, .layui-form-radioed>i { | 
|---|
|  |  |  | color: #007bff; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #resetpwd-window .layui-btn { | 
|---|
|  |  |  | height: 36px; | 
|---|
|  |  |  | line-height: 36px; | 
|---|
|  |  |  | border-radius: 4px; | 
|---|
|  |  |  | box-shadow: 0 1px 0 rgba(0,0,0,.03); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #resetpwd-window .layui-btn-primary:hover { | 
|---|
|  |  |  | border-color: #777777; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </head> | 
|---|
|  |  |  | <body> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script type="text/html" id="operate"> | 
|---|
|  |  |  | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a> | 
|---|
|  |  |  | <a class="layui-btn layui-btn-xs btn-edit layui-btn-warm" lay-event="resetPwd">重置密码</a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script type="text/html" id="statusTpl"> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 重置密码 --> | 
|---|
|  |  |  | <div id="resetpwd-window" style="display: none"> | 
|---|
|  |  |  | <div class="layui-form"> | 
|---|
|  |  |  | <input type="text" id="resetUserId" name="resetUserId" style="display: none"> | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-required">新密码:</label> | 
|---|
|  |  |  | <div class="layui-input-block"> | 
|---|
|  |  |  | <input id="resetPassword" name="resetPassword" placeholder="请输入新密码" class="layui-input" lay-verify="required" autocomplete="off"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-form-item cool-button-contain"> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal" id="savePwd" lay-filter="savePwd" lay-submit="">确定</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-primary" id="cancel">取消</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </body> | 
|---|
|  |  |  | </html> | 
|---|
|  |  |  |  | 
|---|