From 386a53eac26e87b95324e1da3967ae115f990297 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 24 Sep 2021 16:29:50 +0800
Subject: [PATCH] 公司保安用户权限

---
 src/views/system/user.vue |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index df4243e..37f37bf 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -1,6 +1,6 @@
 <template>
   <el-row class="user">
-    <el-col :span="5">
+    <el-col :span="sizes[0]">
       <div class="box">
         <el-scrollbar>
           <basic-container>
@@ -13,7 +13,7 @@
         </el-scrollbar>
       </div>
     </el-col>
-    <el-col :span="19">
+    <el-col :span="sizes[1]">
       <basic-container>
         <avue-crud
           :option="option"
@@ -221,6 +221,9 @@
       }
     };
     return {
+      sizes: [5, 19],
+      deptids: null,
+
       form: {},
       search: {},
       roleBox: false,
@@ -303,18 +306,21 @@
             label: "所属组织机构",
             prop: "deptName",
             slot: true,
+            overHidden: true,
             display: false,
           },
           {
             label: "用户姓名",
             prop: "realName",
             search: true,
+            width: 90,
             display: false,
           },
           {
             label: "所属角色",
             prop: "roleName",
             slot: true,
+            width: 130,
             display: false,
           },
           // {
@@ -753,6 +759,16 @@
       return ids.join(",");
     },
   },
+  created() {
+    console.log(this.userInfo.role_name);
+    if (this.userInfo.role_name == "保安公司管理员") {
+      this.deptids = this.userInfo.dept_id;
+      this.sizes = [0, 24];
+    } else {
+      this.deptids = null;
+      this.sizes = [5, 19];
+    }
+  },
   mounted() {
     // 非保安单位模式默认加载管理组数据
     if (!website.tenantMode) {
@@ -999,12 +1015,12 @@
     },
     onLoad(page, params = {}) {
       this.loading = true;
-      params["status"] = 1;
+      var deptid = this.deptids == null ? this.treeDeptId : this.deptids;
       getList(
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query),
-        this.treeDeptId
+        deptid
       ).then((res) => {
         const data = res.data.data;
         this.page.total = data.total;
@@ -1065,11 +1081,12 @@
     },
     platformOnLoad(page, params = {}) {
       this.platformLoading = true;
+      var deptid = this.deptids == null ? this.treeDeptId : this.deptids;
       getList(
         page.currentPage,
         page.pageSize,
         Object.assign(params, this.query),
-        this.treeDeptId
+        deptid
       ).then((res) => {
         const data = res.data.data;
         this.platformPage.total = data.total;

--
Gitblit v1.9.3