Source/UBCS-WEB/src/components/Theme/DataAuthDialog.vue
@@ -60,7 +60,7 @@
          <el-checkbox
            v-if="item.type === 'checkbox'"
            v-model="row[item.prop]"
            :disabled="row.allDisabled ? true :row[item.code]">
            :disabled="row.authButton.allDisabled ? true : row.authButton[item.code]">
          </el-checkbox>
        </template>
      </el-table-column>
@@ -172,6 +172,7 @@
                  roleData: authData.roleId,
                  classifyItem: this.classifyData.label,
                  index: index,
                  authButton:{},
                  uuid: uuidv4(),//生成唯一的id
                }
                //将按钮设置进去
@@ -179,7 +180,7 @@
                  Vue.set(item, data, true);
                });
                this.classifyAuthData.push(item);
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1
                this.roleHandlerMethods(authData.roleId, 'create', index)
              })
            }
@@ -209,26 +210,33 @@
          !res.data.data.some(x => x.id === item.id)
        );
        //和表格列进行对比
        this.classifyAuthHeader.forEach(item => {
          const isMatched = filteredItems.some(x => x.id === item.prop);
        this.classifyAuthHeader.forEach((item) => {
          const isMatched = filteredItems.some((x) => x.id === item.prop);
          this.$nextTick(() => {
            if (this.classifyAuthData[index] && item.prop in this.classifyAuthData[index]) {
            if (this.classifyAuthData[index]) {
              if (isMatched) {
                this.$set(this.classifyAuthData[index], item.code, this.classifyAuthData[index].classify_view);
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,true);
                });
              } else {
                this.$set(this.classifyAuthData[index], item.code, false);
                Object.keys(this.classifyAuthData[index]).forEach((key) => {
                  this.$set(this.classifyAuthData[index].authButton,item.code,false);
                });
              }
            }
          });
        });
        //添加‘查看’禁用
        this.classifyAuthData.forEach((classkey, classIndex) => {
          if (classkey.classify_view) {
            this.$set(this.classifyAuthData[classIndex], 'allDisabled', true);
          } else {
            this.$set(this.classifyAuthData[classIndex], 'allDisabled', false);
          }
        });
        if (this.classifyAuthData.authButton) {
          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();
      });
@@ -248,17 +256,17 @@
          this.$nextTick(() => {
            if (currentRow) {
              if (isMatched) {
                Object.keys(currentRow).forEach(key => {
                  currentRow[item.code] = item.prop === key ? false : true;
                  if (!currentRow.classify_view) {
                    currentRow.allDisabled = false;
                Object.keys(currentRow).forEach((key) => {
                  currentRow.authButton[item.code] = true;
                  if (!currentRow.authButton.classify_view) {
                    currentRow.authButton.allDisabled = false;
                  }
                });
              } else {
                Object.keys(currentRow).forEach(key => {
                  currentRow[item.code] = item.prop === key ? true : false;
                  if (!currentRow.classify_view) {
                    currentRow.allDisabled = false;
                Object.keys(currentRow).forEach((key) => {
                  currentRow.authButton[item.code] = false;
                  if (!currentRow.authButton.classify_view) {
                    currentRow.authButton.allDisabled = false;
                  }
                });
              }
@@ -280,6 +288,7 @@
      let item = {
        roleData: this.roleList[0].id,
        classifyItem: this.classifyData.label,
        authButton:{},
        uuid: uuidv4(),//生成唯一的id,
        index: this.addIndex,
      }