Forráskód Böngészése

增加安全管理菜单权限

duy 1 éve
szülő
commit
2f0ff1786e
1 módosított fájl, 28 hozzáadás és 1 törlés
  1. 28 1
      src/views/authority/role.vue

+ 28 - 1
src/views/authority/role.vue

@@ -116,6 +116,17 @@
           >
           </el-tree>
         </el-tab-pane>
+        <el-tab-pane label="安全管理菜单权限">
+          <el-tree
+            :data="safeList"
+            show-checkbox
+            node-key="id"
+            ref="treeSafeMenu"
+            :default-checked-keys="safeObj"
+            :props="props"
+          >
+          </el-tree>
+        </el-tab-pane>
         <el-tab-pane label="表单权限">
           <el-tree
             :data="tableOwnerList"
@@ -187,6 +198,7 @@
         larMenuList:[],
         hacMenuList:[],
         meteringList:[],//计量
+        safeList:[],//安全管理
         dataScopeGrantList: [],
         menuClientList: [],
         apiScopeGrantList: [],
@@ -198,6 +210,7 @@
         larmenuObj:[],
         hacmenuObj:[],
         meteringObj:[],
+        safeObj:[],
         tableOwnerObj: [],
         dataScopeTreeObj: [],
         apiScopeTreeObj: [],
@@ -352,12 +365,14 @@
         const menuHacList=this.$refs.treeHacMenu.getCheckedKeys();
         const menuLarList= this.$refs.treelarMenu.getCheckedKeys();
         const menuMeteList= this.$refs.treeMeteMenu.getCheckedKeys();
+        const menuSafeList= this.$refs.treeSafeMenu.getCheckedKeys();
         const menuListHanlf = this.$refs.treeMenu.getHalfCheckedKeys();
         const menuClientListHanlf = this.$refs.treeClientMenu.getHalfCheckedKeys();
         const menuArchivesListHalf = this.$refs.treeArchivestMenu.getHalfCheckedKeys();
         const menuLarsListHalf = this.$refs.treelarMenu.getHalfCheckedKeys();
         const menuHacListHalf = this.$refs.treeHacMenu.getHalfCheckedKeys();
         const menuMeteListHalf = this.$refs.treeMeteMenu.getHalfCheckedKeys();
+        const menuSafeListHalf = this.$refs.treeSafeMenu.getHalfCheckedKeys();
         const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
         const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
         const tableOwnersList = this.$refs.tableOwners.getCheckedKeys();
@@ -368,6 +383,7 @@
         let menuHacAll = [];
         let menuLarAll = [];
         let menuMeteAll=[]
+        let menuSafeAll=[]
         menuList.forEach((id)=>{
           menuAll.push(id+'---all')
         })
@@ -408,7 +424,13 @@
         menuMeteListHalf.forEach((id)=>{
           menuMeteAll.push(id+'---hanlf')
         })
-        grant(this.idsArray, menuAll, menuClientAll,menuArchivesAll,menuHacAll,menuLarAll,menuMeteAll, dataScopeList, apiScopeList, tableOwnersList).then(() => {
+        menuSafeList.forEach((id)=>{
+          menuSafeAll.push(id+'---all')
+        })
+        menuSafeListHalf.forEach((id)=>{
+          menuSafeAll.push(id+'---hanlf')
+        })
+        grant(this.idsArray, menuAll, menuClientAll,menuArchivesAll,menuHacAll,menuLarAll,menuMeteAll, menuSafeAll,dataScopeList, apiScopeList, tableOwnersList).then(() => {
           this.box = false;
           this.$message({
             type: "success",
@@ -499,6 +521,7 @@
         this.larmenuObj=[]
         this.hacmenuObj=[];
         this.meteringObj=[];
+        this.safeObj=[]
         this.dataScopeTreeObj = [];
         this.apiScopeTreeObj = [];
         this.tableOwnerObj = [];
@@ -508,6 +531,7 @@
             this.archivesMenuList= res.data.data.archivesMenu;
             this.larMenuList= res.data.data.larMenu;
             // this.meteringList=res.data.data.larMenu;
+            // this.safeList=res.data.data.larMenu;
             this.hacMenuList=res.data.data.hacMenu;
             this.menuClientList = res.data.data.usermenu;
             this.tableOwnerList = res.data.data.tableOwners;
@@ -528,6 +552,7 @@
               let larmenuObj=[]
               let hacmenuObj=[]
               let meteringObj=[]
+              let safeObj=[]
               res.data.data.usermenu.forEach((item)=>{
                 let arr = item.split("---");
                 if(arr[1] == 'all'){
@@ -536,6 +561,7 @@
                   hacmenuObj.push(arr[0])
                   larmenuObj.push(arr[0])
                   meteringObj.push(arr[0])
+                  safeObj.push(arr[0])
                 }
               });
               this.menuClientObj = menuClientObj;
@@ -543,6 +569,7 @@
               this.hacmenuObj=hacmenuObj
               this.larmenuObj=larmenuObj
               this.meteringObj=meteringObj
+              this.safeObj=safeObj
 
               this.tableOwnerObj = res.data.data.tableOwners;
               this.dataScopeTreeObj = res.data.data.dataScope;