田源
2024-01-26 e30d67f3b88515759bc468962375a2e1b07bf655
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
@@ -136,7 +136,9 @@
  },
  computed: {},
  mounted() {},
  created() {},
  created() {
    this.addIndex = this.classifyAuthData.length <= 0 ? 0 :this.classifyAuthData.length -1;
  },
  watch: {
    // 监听父组件传的窗口显示隐藏的值
    visible() {
@@ -165,24 +167,26 @@
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,true);
                });
                //添加 “查看全部禁用条件”
                if (item.code === "classify_view") {
                  this.$set(this.classifyAuthData[index].authButton, "allDisabled", true);
                  console.log(this.classifyAuthData[index].authButton.allDisabled)
                }
              } else {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,false);
                });
                if(item.code === "classify_view"){
                  this.classifyAuthData[index].authButton.allDisabled = false;
                }
              }
            }
          });
        });
        //添加 “查看全部禁用条件”
        if (this.classifyAuthData) {
          this.classifyAuthData.forEach((classkey, classIndex) => {
            if (classkey.authButton.classify_view) {
              this.$set(this.classifyAuthData[classIndex].authButton,"allDisabled",true);
            } else {
              this.classifyAuthData[classIndex].authButton.allDisabled = false;
            }
          });
        }
        //强制刷新表格
        this.itemKey = uuidv4();
      });
@@ -238,8 +242,7 @@
        this.$message.warning("当前租户不存在角色信息!");
        return;
      }
      // console.log('this.roleList', this.roleList)
      this.addIndex++; //自定义生成添加行下标
      let item = {
        roleData: this.roleList[0].id,
        classifyItem: this.classifyData.label,
@@ -253,6 +256,7 @@
      });
      this.classifyAuthData.push(item);
      this.roleHandlerMethods(this.roleList[0].id, "add", this.addIndex);
      this.addIndex++; //自定义生成添加行下标
    },
    // 删除行
    subClassifyAuth() {
@@ -305,7 +309,7 @@
          this.$message.warning("角色和分类已经存在,请重新配置!");
          return;
        }
        let flag = false;
        this.classifyAuthData.forEach((item) => {
          let itemButtonList = [];
@@ -432,7 +436,6 @@
                Vue.set(item, data, true);
              });
              this.classifyAuthData.push(item);
              this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
              this.roleHandlerMethods(authData.roleId, "create", index);
              // console.log('index', index)
            });