duy 1 жил өмнө
parent
commit
27889b5441

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

@@ -105,6 +105,17 @@
           >
           </el-tree>
         </el-tab-pane>
+        <el-tab-pane label="计量支付菜单权限">
+          <el-tree
+            :data="meteringList"
+            show-checkbox
+            node-key="id"
+            ref="treeMeteMenu"
+            :default-checked-keys="meteringObj"
+            :props="props"
+          >
+          </el-tree>
+        </el-tab-pane>
         <el-tab-pane label="表单权限">
           <el-tree
             :data="tableOwnerList"
@@ -175,6 +186,7 @@
         archivesMenuList:[],
         larMenuList:[],
         hacMenuList:[],
+        meteringList:[],//计量
         dataScopeGrantList: [],
         menuClientList: [],
         apiScopeGrantList: [],
@@ -185,6 +197,7 @@
         archivesmenuObj:[],
         larmenuObj:[],
         hacmenuObj:[],
+        meteringObj:[],
         tableOwnerObj: [],
         dataScopeTreeObj: [],
         apiScopeTreeObj: [],
@@ -338,11 +351,13 @@
         const menuArchivesList = this.$refs.treeArchivestMenu.getCheckedKeys();
         const menuHacList=this.$refs.treeHacMenu.getCheckedKeys();
         const menuLarList= this.$refs.treelarMenu.getCheckedKeys();
+        const menuMeteList= this.$refs.treeMeteMenu.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 dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
         const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
         const tableOwnersList = this.$refs.tableOwners.getCheckedKeys();
@@ -352,6 +367,7 @@
         let menuArchivesAll = [];
         let menuHacAll = [];
         let menuLarAll = [];
+        let menuMeteAll=[]
         menuList.forEach((id)=>{
           menuAll.push(id+'---all')
         })
@@ -385,7 +401,14 @@
         menuLarsListHalf.forEach((id)=>{
           menuLarAll.push(id+'---hanlf')
         })
-        grant(this.idsArray, menuAll, menuClientAll,menuArchivesAll,menuHacAll,menuLarAll, dataScopeList, apiScopeList, tableOwnersList).then(() => {
+        
+        menuMeteList.forEach((id)=>{
+          menuMeteAll.push(id+'---all')
+        })
+        menuMeteListHalf.forEach((id)=>{
+          menuMeteAll.push(id+'---hanlf')
+        })
+        grant(this.idsArray, menuAll, menuClientAll,menuArchivesAll,menuHacAll,menuLarAll,menuMeteAll, dataScopeList, apiScopeList, tableOwnersList).then(() => {
           this.box = false;
           this.$message({
             type: "success",
@@ -475,6 +498,7 @@
         this.archivesmenuObj=[];
         this.larmenuObj=[]
         this.hacmenuObj=[];
+        this.meteringObj=[];
         this.dataScopeTreeObj = [];
         this.apiScopeTreeObj = [];
         this.tableOwnerObj = [];
@@ -483,6 +507,7 @@
             this.menuGrantList = res.data.data.menu;
             this.archivesMenuList= res.data.data.archivesMenu;
             this.larMenuList= res.data.data.larMenu;
+            // this.meteringList=res.data.data.larMenu;
             this.hacMenuList=res.data.data.hacMenu;
             this.menuClientList = res.data.data.usermenu;
             this.tableOwnerList = res.data.data.tableOwners;
@@ -502,6 +527,7 @@
               let archivesmenuObj=[];
               let larmenuObj=[]
               let hacmenuObj=[]
+              let meteringObj=[]
               res.data.data.usermenu.forEach((item)=>{
                 let arr = item.split("---");
                 if(arr[1] == 'all'){
@@ -509,12 +535,14 @@
                   archivesmenuObj.push(arr[0])
                   hacmenuObj.push(arr[0])
                   larmenuObj.push(arr[0])
+                  meteringObj.push(arr[0])
                 }
               });
               this.menuClientObj = menuClientObj;
               this.archivesmenuObj=archivesmenuObj
               this.hacmenuObj=hacmenuObj
               this.larmenuObj=larmenuObj
+              this.meteringObj=meteringObj
 
               this.tableOwnerObj = res.data.data.tableOwners;
               this.dataScopeTreeObj = res.data.data.dataScope;