From e584d35ef6ccff56acc3533f4b050ef9ce6febd6 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 31 七月 2020 13:37:07 +0800 Subject: [PATCH] #当前本版十分完美、冻结 --- src/main/webapp/static/js/user/user.js | 82 ++++++++++++++++++++++------------------ 1 files changed, 45 insertions(+), 37 deletions(-) diff --git a/src/main/webapp/static/js/user/user.js b/src/main/webapp/static/js/user/user.js index 9a908df..ecb99fd 100644 --- a/src/main/webapp/static/js/user/user.js +++ b/src/main/webapp/static/js/user/user.js @@ -29,7 +29,7 @@ // ,{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', @@ -193,6 +193,7 @@ 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"}); @@ -200,41 +201,21 @@ } }); 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; } }); @@ -263,7 +244,7 @@ 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(""); }); @@ -300,6 +281,33 @@ ,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(); + }) }); // 鍏抽棴鍔ㄤ綔 -- Gitblit v1.9.1