From e275ae841c3eed98d2945f3b53cd61ac28cf8727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com> Date: Thu, 13 Jan 2022 23:29:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E5=8A=A0=E6=9C=BA=E6=9E=84=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/magic-api/api/后台/用户管理/保存.ms | 5 +- data/magic-api/api/后台/用户管理/列表.ms | 6 +- magic-boot-ui/src/scripts/treeTable.js | 11 ++ .../src/views/system/user/user-form.vue | 16 ++- .../src/views/system/user/user-list.vue | 106 ++++++++++++------ 5 files changed, 105 insertions(+), 39 deletions(-) diff --git a/data/magic-api/api/后台/用户管理/保存.ms b/data/magic-api/api/后台/用户管理/保存.ms index b7c75e3..a6aa481 100644 --- a/data/magic-api/api/后台/用户管理/保存.ms +++ b/data/magic-api/api/后台/用户管理/保存.ms @@ -5,7 +5,7 @@ "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "保存", "createTime" : null, - "updateTime" : 1641261914841, + "updateTime" : 1642085497821, "lock" : "0", "method" : "POST", "path" : "/save", @@ -31,7 +31,8 @@ var user = { username, password: password, phone, - isLogin + isLogin, + officeId } if(id){ SqlCache.delete(`permissions:${id}`) diff --git a/data/magic-api/api/后台/用户管理/列表.ms b/data/magic-api/api/后台/用户管理/列表.ms index 6ac1e4d..69aad84 100644 --- a/data/magic-api/api/后台/用户管理/列表.ms +++ b/data/magic-api/api/后台/用户管理/列表.ms @@ -5,7 +5,7 @@ "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "列表", "createTime" : null, - "updateTime" : 1634738477796, + "updateTime" : 1642086792944, "lock" : "0", "method" : "GET", "path" : "/list", @@ -28,9 +28,11 @@ return db.page(""" su.name, su.is_login, su.phone, - su.create_date + su.create_date, + su.office_id from sys_user su where su.is_del = 0 + ?{officeId, and su.office_id = #{officeId}} ?{username, and su.username like concat('%',#{username},'%')} ?{name, and su.name like concat('%',#{name},'%')} ?{isLogin, and su.is_login = #{isLogin}} diff --git a/magic-boot-ui/src/scripts/treeTable.js b/magic-boot-ui/src/scripts/treeTable.js index 3223eda..a6a2768 100644 --- a/magic-boot-ui/src/scripts/treeTable.js +++ b/magic-boot-ui/src/scripts/treeTable.js @@ -50,6 +50,17 @@ treeTable.genTree = (children) => { return treeData } +treeTable.deleteEmptyChildren = (children) => { + for(var i in children){ + var chi = children[i] + if(chi.children && chi.children.length == 0){ + delete chi.children + }else{ + treeTable.deleteEmptyChildren(chi.children) + } + } +} + treeTable.recursionSearch = (fields, data, text) => { var searchData = [] for(var i in data){ diff --git a/magic-boot-ui/src/views/system/user/user-form.vue b/magic-boot-ui/src/views/system/user/user-form.vue index 4f904a3..5caadaa 100644 --- a/magic-boot-ui/src/views/system/user/user-form.vue +++ b/magic-boot-ui/src/views/system/user/user-form.vue @@ -12,6 +12,9 @@ + + +