From dda0e6f581e8c2b116f2eae53756d80215d6e5e0 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期三, 01 二月 2023 09:31:37 +0800
Subject: [PATCH] 1

---
 src/views/userManage/orgManage.vue |   44 ++++++++++++++++++++++++++++++++------------
 1 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/src/views/userManage/orgManage.vue b/src/views/userManage/orgManage.vue
index 35cea89..fe08415 100644
--- a/src/views/userManage/orgManage.vue
+++ b/src/views/userManage/orgManage.vue
@@ -30,35 +30,35 @@
           </el-breadcrumb>
 
           <div>
-            <el-button
+            <el-button   v-if="menuStatus.update"
               :disabled="itemdetail.pid == null ? true : false"
               @click="setEditNode(1)"
               type="info"
               icon="el-icon-top"
               size="small"
             >鍚戜笂绉诲姩</el-button>
-            <el-button
+            <el-button   v-if="menuStatus.update"
               :disabled="itemdetail.pid == null ? true : false"
               @click="setEditNode(2)"
               type="info"
               icon="el-icon-bottom"
               size="small"
             >鍚戜笅绉诲姩</el-button>
-            <el-button
+            <el-button   v-if="menuStatus.insert"
               :disabled="itemdetail.pid == null ? true : false"
               @click="setNewNode(1)"
               type="success"
               icon="el-icon-plus"
               size="small"
             >鏂板鍚岀骇</el-button>
-            <el-button
+            <el-button   v-if="menuStatus.insert"
               :disabled="itemdetail.pid == null ? true : false"
               @click="setNewNode(2)"
               type="success"
               icon="el-icon-plus"
               size="small"
             >鏂板瀛愮骇</el-button>
-            <el-button
+            <el-button  v-if="menuStatus.delete"
               @click="setDelNode()"
               :disabled="itemdetail.pid == null ? true : false"
               type="danger"
@@ -339,6 +339,7 @@
   queryMaxId,
   insertDep,
   deleteDep,
+  getPerms
 } from '../../api/api';
 export default {
   //import寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -794,18 +795,37 @@
           break;
       }
     },
+      getPerms() {
+      var val = this.$store.state.currentPerms;
+      var permsEntity = this.$store.state.permsEntity;
+     
+      if (permsEntity.length == 0) {
+        getPerms().then((res) => {
+          if (res.code == 200) {
+            permsEntity = res.result;
+          }
+        });
+      }
+      for (var i = 0; i < permsEntity.length; i++) {
+        if (permsEntity[i].perms == val) {
+          console.log(permsEntity[i])
+          this.showPermsMenu(permsEntity[i]);
+        }
+      }
+    },
   },
   mounted() {
     this.getMenuTree();
+        this.getPerms();
   },
   created() {
-    var val = this.$store.state.currentPerms;
-    var permsEntity = this.$store.state.permsEntity;
-    for (var i = 0; i < permsEntity.length; i++) {
-      if (permsEntity[i].perms == val) {
-        this.showPermsMenu(permsEntity[i]);
-      }
-    }
+    // var val = this.$store.state.currentPerms;
+    // var permsEntity = this.$store.state.permsEntity;
+    // for (var i = 0; i < permsEntity.length; i++) {
+    //   if (permsEntity[i].perms == val) {
+    //     this.showPermsMenu(permsEntity[i]);
+    //   }
+    // }
   },
 };
 </script>

--
Gitblit v1.9.3