ludc
2024-08-22 988cf8b273a2015833c024727deb9acc46060b3e
Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
@@ -104,7 +104,7 @@
    return {
      // 对话框显示控制
      isShowDialog: this.visible,
      isLoading: false,
      isLoading: true,
      tableHeight: 'calc(100vh - 550px)',
      classifyAuthData: [],
      //列头
@@ -128,10 +128,8 @@
        this.loadAuthPage();
      }
    },
    classifyAuthData(newval){
      this.addIndex = newval.length <= 0 ? 0 :newval.length-1;
      console.log(this.addIndex)
    classifyAuthData(newval) {
      this.addIndex = newval.length <= 0 ? 0 : newval.length - 1;
    }
  },
  computed: {},
@@ -144,7 +142,7 @@
      if (code === "data_view") {
        row.checkTheStatus = check;
      } else if (!row.checkTheStatus) {
        this.$message.warning('请先勾选查看按钮!');
        this.$message.warning('清先勾选查看按钮!');
        // 在条件不满足时将多选框状态设置为false
        row[id] = false;
      }
@@ -173,13 +171,15 @@
        //和表格列进行对比
        this.classifyAuthHeader.forEach((item) => {
          // if (item.code !== 'data_view') {
          //   this.$set(this.classifyAuthData[index].authButton, "allDisabled", true);
          // }
          const isMatched = filteredItems.some((x) => x.id === item.prop);
          this.$nextTick(() => {
            if (this.classifyAuthData[index]) {
              if (isMatched) {
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton, item.code, true);
                  //添加 “查看全部禁用条件”
                  if (item.code === "data_view") {
                    this.$set(this.classifyAuthData[index].authButton, "allDisabled", true);
@@ -197,7 +197,7 @@
            }
          });
        });
        // console.log(this.classifyAuthData)
        //强制刷新表格
        this.itemKey = uuidv4();
      });
@@ -251,7 +251,7 @@
        classifyItem: this.classifyData.label,
        authButton: {},
        uuid: uuidv4(),//生成唯一的id,
        index: this.addIndex,
        index: this.classifyAuthData.length -1,
      }
      //将按钮设置进去
      this.classifyAuthButton.forEach(data => {
@@ -259,7 +259,7 @@
      })
      //console.log(item)
      this.classifyAuthData.push(item)
      this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex)
      this.roleHandlerMethods(this.roleList[0].id, 'add', this.classifyAuthData.length -1)
    },
    // 删除行
    subClassifyAuth() {
@@ -289,6 +289,7 @@
        classifyAuthList: [],
        isCLear: false, //默认是清空
        classifyId: this.TreeNode.oid,
        authType: 'data_auth',
      };
      let isRepeat = false;
      if (this.classifyAuthData.length > 0) {
@@ -314,7 +315,7 @@
          let itemButtonList = [];
          //筛选出按钮勾选为true的列
          for (let key in item) {
            if (item[key] === true) {
            if (item[key] === true && key !== 'checkTheStatus') {
              itemButtonList.push(key);
            }
          }
@@ -369,7 +370,7 @@
    },
    loadAuthPage() {
      return new Promise((resolve, reject) => {
        // console.log(this.classifyData);
        this.isLoading = true;
        getButtonByParentCode({code: this.classifyData.attributes.id}).then(res => {
          // 记录按钮数据
          this.classifyAuthButton = res.data.data;
@@ -431,6 +432,7 @@
            })
          }
        });
        this.isLoading = false;
      });
    },
  },