ソースを参照

角色权限半选

gangyj 3 年 前
コミット
0f8af3076f
1 ファイル変更8 行追加2 行削除
  1. 8 2
      src/views/authority/role.vue

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

@@ -291,12 +291,18 @@
       },
 
       submit() {
-        const menuList = this.$refs.treeMenu.getCheckedKeys(false,true);
-        const menuClientList = this.$refs.treeClientMenu.getCheckedKeys(false,true);
+        let menuList = this.$refs.treeMenu.getCheckedKeys();
+        let menuClientList = this.$refs.treeClientMenu.getCheckedKeys();
+        const menuListHanlf = this.$refs.treeMenu.getHalfCheckedKeys();
+        const menuClientListHanlf = this.$refs.treeMenu.getHalfCheckedKeys();
         const dataScopeList = this.$refs.treeDataScope.getCheckedKeys();
         const apiScopeList = this.$refs.treeApiScope.getCheckedKeys();
         const tableOwnersList = this.$refs.tableOwners.getCheckedKeys();
 
+        //合并半选
+        menuList = menuList.concat(menuListHanlf)
+        menuClientList = menuClientList.concat(menuClientListHanlf)
+
         grant(this.idsArray, menuList, menuClientList, dataScopeList, apiScopeList, tableOwnersList).then(() => {
           this.box = false;
           this.$message({