Explorar el Código

修改权限树选中

zhaoke hace 3 años
padre
commit
a41ec2ee74
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5 3
      src/components/permissiontree/index.vue

+ 5 - 3
src/components/permissiontree/index.vue

@@ -264,7 +264,6 @@ export default {
         Status: 0,
         UpAuthId: -2,
         Type: 0,
-        disabled: true,
         children: arr,
       };
       this.dataObj = _.cloneDeep(items);
@@ -293,12 +292,15 @@ export default {
     currentChange () {
       this.checkedList = [];
       const arr = this.$refs.tree.getCheckedNodes();
-      arr.forEach((item) => {
+      const half = this.$refs.tree.getHalfCheckedNodes();
+      const halfAll = half.filter(item => item.AuthId != -1 && item.AuthName != '所有权限');
+      const datas = halfAll.concat(arr);
+      datas.forEach((item) => {
         // if(item.disabled==false){
         this.checkedList.push(item.AuthId);
         // }
       });
-      this.setDataObj(arr);
+      this.setDataObj(datas);
     },
     // 选中后设置初始数据
     setDataObj (arr) {