From b67a622b2becc49a2ae23fa905bc775411439bfa Mon Sep 17 00:00:00 2001
From: zhaoxiaohao <913652501@qq.com>
Date: Mon, 27 Apr 2020 16:54:24 +0800
Subject: [PATCH] Merge branch 'dev' of http://192.168.2.240:7070/r/kidgrow-microservices-platform into dev
---
kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html | 78 ++++++++++++++++++++++-----------------
1 files changed, 44 insertions(+), 34 deletions(-)
diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html
index 5337019..ffc58cf 100644
--- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html
+++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html
@@ -2,8 +2,8 @@
<div class="layui-card-header">
<h2 class="header-title">用户管理</h2>
<span class="layui-breadcrumb pull-right">
- <a href="#!console">首页</a>
- <a><cite>用户管理</cite></a>
+ <a href="#!console">首页</a>
+ <a><cite>用户管理</cite></a>
</span>
</div>
<div class="layui-card-body">
@@ -16,7 +16,7 @@
<option value="nick_name">用户名</option>
<option value="mobile">手机号</option>
</select> 
- <input id="user-search-value" class="layui-input search-input" type="text" placeholder="输入关键字"/> 
+ <input id="user-search-value" class="layui-input search-input" type="text" placeholder="输入关键字" /> 
<button id="user-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button>
<button id="user-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button>
<button id="user-btn-export" class="layui-btn icon-btn"><i class="layui-icon"></i>导出</button>
@@ -34,6 +34,7 @@
<script type="text/html" id="user-table-bar">
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
<a class="layui-btn layui-btn-xs" lay-event="reset">重置密码</a>
+ <a class="layui-btn layui-btn-xs" lay-event="org">分配组织</a>
<a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
</script>
@@ -59,24 +60,25 @@
elem: '#user-table',
url: config.base_server + 'api-user/users',
method: 'GET',
- headers:{'Authorization': 'Bearer ' + config.getToken().access_token},
+ headers: { 'Authorization': 'Bearer ' + config.getToken().access_token },
page: true,
cols: [[
- {type: 'numbers'},
- {field: 'id', sort: true, title: '用户编号'},
- {field: 'username', sort: true, title: '账号'},
- {field: 'nickname', sort: true, title: '用户名'},
- {field: 'mobile', sort: true, title: '手机号'},
- {sort: true, title: '性别',templet:function (d) {
- return d.sex==0?"男":"女"
- }},
+ { field: 'id', sort: true, width: 200, title: '标识' },
+ { field: 'username', sort: true, width: 100, title: '账号' },
+ { field: 'nickname', sort: true, width: 200, title: '用户名' },
+ { field: 'mobile', sort: true, width: 150, title: '手机号' },
{
- sort: true, templet: function (d) {
+ sort: true, title: '性别', templet: function (d) {
+ return d.sex == 0 ? "男" : "女"
+ }, width: 100
+ },
+ {
+ sort: true, width: 200, templet: function (d) {
return util.toDateString(d.createTime);
}, title: '创建时间'
},
- {field: 'enabled',width: 100, sort: true, templet: '#user-tpl-state', title: '状态'},
- {fixed: 'right', align: 'center', toolbar: '#user-table-bar', title: '操作', width: 195}
+ { field: 'enabled', width: 100, sort: true, templet: '#user-tpl-state', title: '状态' },
+ { fixed: 'right', align: 'center', toolbar: '#user-table-bar', title: '操作', width: 300 }
]]
});
@@ -96,12 +98,12 @@
layer.confirm('确定重置此用户的密码吗?', function (i) {
layer.close(i);
layer.load(2);
- admin.req('api-user/users/'+obj.data.id+'/password', {}, function (data) {
+ admin.req('api-user/users/' + obj.data.id + '/password', {}, function (data) {
layer.closeAll('loading');
if (data.code == 0) {
- layer.msg(data.msg, {icon: 1, time: 500});
+ layer.msg(data.msg, { icon: 1, time: 500 });
} else {
- layer.msg(data.msg, {icon: 2, time: 500});
+ layer.msg(data.msg, { icon: 2, time: 500 });
}
}, 'PUT');
});
@@ -109,15 +111,23 @@
layer.confirm('确定删除此用户吗?', function (i) {
layer.close(i);
layer.load(2);
- admin.req('api-user/users/'+obj.data.id, {}, function (data) {
+ admin.req('api-user/users/' + obj.data.id, {}, function (data) {
layer.closeAll('loading');
if (data.code == 0) {
- layer.msg(data.msg, {icon: 1, time: 500});
+ layer.msg(data.msg, { icon: 1, time: 500 });
table.reload('user-table', {});
} else {
- layer.msg(data.msg, {icon: 2, time: 500});
+ layer.msg(data.msg, { icon: 2, time: 500 });
}
}, 'delete');
+ });
+ } else if (layEvent === "org") {
+ admin.putTempData('t_user', data);
+ admin.popupCenter({
+ title: "分配组织",
+ path: 'pages/system/user_org_form.html',
+ finish: function () {
+ }
});
}
});
@@ -125,8 +135,8 @@
//显示表单弹窗
var showEditModel = function (data) {
//修改sex值
- if (data){
- data.sex = data.sex+'';
+ if (data) {
+ data.sex = data.sex + '';
}
admin.putTempData('t_user', data);
var title = data ? '修改用户' : '添加用户';
@@ -143,7 +153,7 @@
$('#user-btn-search').click(function () {
var key = $('#user-search-key').val();
var value = $('#user-search-value').val();
- table.reload('user-table', {where: {searchKey: key, searchValue: value}});
+ table.reload('user-table', { where: { searchKey: key, searchValue: value } });
});
// 导出
@@ -154,7 +164,7 @@
xhr.responseType = "blob";
xhr.setRequestHeader("client_type", "DESKTOP_WEB");
xhr.setRequestHeader("Authorization", "Bearer " + config.getToken().access_token);
- xhr.onload = function() {
+ xhr.onload = function () {
if (this.status == 200) {
var fileName = "user.xlsx";
var blob = this.response;
@@ -182,10 +192,10 @@
}, function (data) {
layer.closeAll('loading');
if (data.code == 0) {
- layer.msg(data.msg, {icon: 1, time: 500});
+ layer.msg(data.msg, { icon: 1, time: 500 });
//table.reload('table-user', {});
} else {
- layer.msg(data.msg, {icon: 2, time: 500});
+ layer.msg(data.msg, { icon: 2, time: 500 });
$(obj.elem).prop('checked', !obj.elem.checked);
form.render('checkbox');
}
@@ -196,16 +206,16 @@
var importUrl = config.base_server + 'api-user/users/import';
upload.render({
elem: '#user-btn-import'
- ,url: importUrl
- ,accept: 'file' //普通文件
- ,multiple: false
- ,headers: {"Authorization" : "Bearer " + config.getToken().access_token}
- ,done: function(data){
+ , url: importUrl
+ , accept: 'file' //普通文件
+ , multiple: false
+ , headers: { "Authorization": "Bearer " + config.getToken().access_token }
+ , done: function (data) {
if (data.code == 0) {
- layer.msg(data.msg, {icon: 1, time: 500});
+ layer.msg(data.msg, { icon: 1, time: 500 });
table.reload('user-table', {});
} else {
- layer.msg(data.msg, {icon: 2, time: 500});
+ layer.msg(data.msg, { icon: 2, time: 500 });
}
}
});
--
Gitblit v1.8.0