田源
2024-01-18 0943f51b2ecb9e2a456ea9ee9245d52f98c78177
Source/UBCS-WEB/src/components/Theme/ClassifyAuthDialog.vue
@@ -176,7 +176,8 @@
                });
                this.classifyAuthData.push(item);
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.roleHandlerMethods(authData.roleId, 'create', this.addIndex)
                this.roleHandlerMethods(authData.roleId, 'create', index)
                console.log('index', index)
              })
            }
          });
@@ -200,16 +201,33 @@
        const filteredItems = this.classifyAuthButton.filter(item => {
          return !res.data.data.find(x => x.id === item.id);
        });
        console.log('禁用按钮',filteredItems)
        console.log('不禁用按钮',res.data.data)
        //拿表格列头循环和没有对应的属性进行比较
        this.classifyAuthHeader.forEach((item) => {
          if (filteredItems.some(x => x.id === item.prop)) {
          const isMatched = filteredItems.some(x => x.id === item.prop);
          if (isMatched) {
            this.$nextTick(() => {
              if (this.classifyAuthData[index] !== undefined && this.classifyAuthData[index] !== null) {
              if (this.classifyAuthData[index]) {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                    if (this.classifyAuthData[index].classify_view) {
                      this.$set(this.classifyAuthData[index], item.code, true);
                    } else {
                      this.classifyAuthData[index][item.code] = false;
                    }
                    // console.log(item.code)
                    // this.$set(this.classifyAuthData[index], item.code, true);
                });
              }
            })
          } else {
            this.$nextTick(() => {
              if (this.classifyAuthData[index]) {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  if (item.prop === key) {
                    // this.classifyAuthData[index] = Object.assign({}, this.classifyAuthData[index], {[key]: undefined});
                    this.$set(this.classifyAuthData[index], item.code, true);
                    this.$set(this.classifyAuthData[index], item.code, false);
                  }
                });
              }
@@ -221,9 +239,11 @@
        this.classifyAuthData.forEach((classkey, classIndex) => {
          if (classkey.classify_view) {
            this.$set(this.classifyAuthData[classIndex], 'allDisabled', true)
          } else {
            this.classifyAuthData[classIndex].allDisabled = false;
          }
        });
        console.log(this.classifyAuthData)
        console.log('classifyAuthData',this.classifyAuthData)
        //强制刷新表格
        this.itemKey = uuidv4();
      })
@@ -358,6 +378,7 @@
          roleId: item.roleData,
          classifyId: this.classifyData.oid,
          buttonIds: itemButtonList.join(","),
          authType: "classify_auth",
        }
        form.push(data);
      });