From 4ed779cecb9aa811b5220b123ec789b39980c4ef Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 28 Sep 2021 08:32:10 +0800
Subject: [PATCH] 分局及之上的 用户管理左侧菜单修复

---
 src/api/system/user.js    |   10 ++++++++--
 vue.config.js             |    4 ++--
 src/views/system/user.vue |   22 +++++++++++++++++-----
 3 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/src/api/system/user.js b/src/api/system/user.js
index bc6f77c..1a2970a 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -13,7 +13,13 @@
 
 
 
-export const getList = (current, size, params, deptId) => {
+export const getList = (current, size, params, deptId, jurisdiction) => {
+    var datas = {};
+    if (jurisdiction == '') {
+        datas = { deptId: deptId };
+    } else {
+        datas = { jurisdiction: jurisdiction };
+    }
     return request({
         url: '/api/blade-user/page',
         method: 'get',
@@ -21,7 +27,7 @@
             ...params,
             current,
             size,
-            deptId,
+            ...datas
         }
     })
 }
diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index 468169c..aabf96d 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -828,8 +828,12 @@
   },
   methods: {
     nodeClick(data) {
-      this.treeDeptId = data.id;
+      if (data.id == "1123598813738675201") {
+        data.id = "1372091709474910209";
+      }
+      this.treeDeptId = data;
       this.page.currentPage = 1;
+      // console.log(this.treeDeptId);
       this.onLoad(this.page);
     },
     initData(tenantId, d) {
@@ -1078,17 +1082,23 @@
     },
     onLoad(page, params = {}) {
       this.loading = true;
-      var deptid = this.deptids == null ? this.treeDeptId : this.deptids;
+      var deptid = this.deptids == null ? this.treeDeptId.id : this.deptids;
       //公安局进入
       if (this.userInfo.role_name == "公安管理员") {
         params["jurisdiction"] = this.userInfo.jurisdiction;
       }
-      params['status'] = 1;
+      var test = /派出所|分局|公安局|市公安局$/g;
+      var jurisdiction = "";
+      if (test.test(this.treeDeptId.title)) {
+        jurisdiction = this.treeDeptId.id;
+      }
+      params["status"] = 1;
       getList(
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query),
-        deptid
+        deptid,
+        jurisdiction
       ).then((res) => {
         const data = res.data.data;
         this.page.total = data.total;
@@ -1149,12 +1159,14 @@
     },
     platformOnLoad(page, params = {}) {
       this.platformLoading = true;
+      var jurisdiction = "";
       var deptid = this.deptids == null ? this.treeDeptId : this.deptids;
       getList(
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query),
-        deptid
+        deptid,
+        jurisdiction
       ).then((res) => {
         const data = res.data.data;
         this.platformPage.total = data.total;
diff --git a/vue.config.js b/vue.config.js
index a400f65..582c944 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -27,8 +27,8 @@
         proxy: {
             '/api': {
                 // 本地服务接口地址
-                target: 'http://localhost:81',
-                // target: 'http://192.168.0.114:81',//钟日健W
+                // target: 'http://localhost:81',
+                target: 'http://192.168.0.114:81',//钟日健W
                 // target: 'http://localhost:81', //原W
                 // target: 'http://192.168.0.108:81',//原W
                 // target: 'http://192.168.0.110:81',//唐N

--
Gitblit v1.9.3