Просмотр исходного кода

档案管理菜单权限新增

duy 2 лет назад
Родитель
Сommit
60be7cbdc9
2 измененных файлов с 30 добавлено и 3 удалено
  1. 2 1
      src/api/system/role.js
  2. 28 2
      src/views/authority/role.vue

+ 2 - 1
src/api/system/role.js

@@ -18,7 +18,7 @@ export const grantTree = () => {
   })
 }
 
-export const grant = (roleIds, menuIds, menuClientIds, dataScopeIds, apiScopeIds, tableOwners) => {
+export const grant = (roleIds, menuIds, menuClientIds,menuArchivesIds, dataScopeIds, apiScopeIds, tableOwners) => {
   return request({
     url: '/api/blade-system/role/grant',
     method: 'post',
@@ -26,6 +26,7 @@ export const grant = (roleIds, menuIds, menuClientIds, dataScopeIds, apiScopeIds
       roleIds,
       menuIds,
       menuClientIds,
+      menuArchivesIds,
       tableOwners,
       dataScopeIds,
       apiScopeIds

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

@@ -69,7 +69,17 @@
           >
           </el-tree>
         </el-tab-pane>
-
+            <el-tab-pane label="档案菜单权限">
+          <el-tree
+            :data="archivesMenuList"
+            show-checkbox
+            node-key="id"
+            ref="treeArchivestMenu"
+            :default-checked-keys="archivesmenuObj"
+            :props="props"
+          >
+          </el-tree>
+        </el-tab-pane>
         <el-tab-pane label="表单权限">
           <el-tree
             :data="tableOwnerList"
@@ -137,6 +147,7 @@
           value: "key"
         },
         menuGrantList: [],
+        archivesMenuList:[],
         dataScopeGrantList: [],
         menuClientList: [],
         apiScopeGrantList: [],
@@ -144,6 +155,7 @@
         apiGrantList: [],
         menuTreeObj: [],
         menuClientObj: [],
+        archivesmenuObj:[],
         tableOwnerObj: [],
         dataScopeTreeObj: [],
         apiScopeTreeObj: [],
@@ -293,14 +305,17 @@
       submit() {
         const menuList = this.$refs.treeMenu.getCheckedKeys();
         const menuClientList = this.$refs.treeClientMenu.getCheckedKeys();
+        const menuArchivesList = this.$refs.treeArchivestMenu.getCheckedKeys();
         const menuListHanlf = this.$refs.treeMenu.getHalfCheckedKeys();
         const menuClientListHanlf = this.$refs.treeClientMenu.getHalfCheckedKeys();
+        const menuArchivesListHalf = this.$refs.treeArchivestMenu.getCheckedKeys();
         const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
         const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
         const tableOwnersList = this.$refs.tableOwners.getCheckedKeys();
 
         let menuAll = [];
         let menuClientAll = [];
+        let menuArchivesAll = [];
         menuList.forEach((id)=>{
           menuAll.push(id+'---all')
         })
@@ -314,9 +329,15 @@
         menuClientListHanlf.forEach((id)=>{
           menuClientAll.push(id+'---hanlf')
         })
+         menuArchivesList.forEach((id)=>{
+          menuArchivesAll.push(id+'---all')
+        })
+        menuArchivesListHalf.forEach((id)=>{
+          menuArchivesAll.push(id+'---hanlf')
+        })
 
 
-        grant(this.idsArray, menuAll, menuClientAll, dataScopeList, apiScopeList, tableOwnersList).then(() => {
+        grant(this.idsArray, menuAll, menuClientAll,menuArchivesAll, dataScopeList, apiScopeList, tableOwnersList).then(() => {
           this.box = false;
           this.$message({
             type: "success",
@@ -403,12 +424,14 @@
         }
         this.menuTreeObj = [];
         this.menuClientObj = [];
+        this.archivesmenuObj=[];
         this.dataScopeTreeObj = [];
         this.apiScopeTreeObj = [];
         this.tableOwnerObj = [];
         grantTree()
           .then(res => {
             this.menuGrantList = res.data.data.menu;
+            this.archivesMenuList= res.data.data.archivesMenu;
             this.menuClientList = res.data.data.usermenu;
             this.tableOwnerList = res.data.data.tableOwners;
             this.dataScopeGrantList = res.data.data.dataScope;
@@ -424,13 +447,16 @@
               this.menuTreeObj = menuTreeObj;
 
               let menuClientObj = [];
+              let archivesmenuObj=[];
               res.data.data.usermenu.forEach((item)=>{
                 let arr = item.split("---");
                 if(arr[1] == 'all'){
                   menuClientObj.push(arr[0])
+                  archivesmenuObj.push(arr[0])
                 }
               });
               this.menuClientObj = menuClientObj;
+              this.archivesmenuObj=archivesmenuObj
 
               this.tableOwnerObj = res.data.data.tableOwners;
               this.dataScopeTreeObj = res.data.data.dataScope;