| | |
| | | <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> |
| | |
| | | roleData: authData.roleId, |
| | | classifyItem: this.classifyData.label, |
| | | index: index, |
| | | authButton:{}, |
| | | uuid: uuidv4(),//生成唯一的id |
| | | } |
| | | //将按钮设置进去 |
| | |
| | | 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) |
| | | }) |
| | | } |
| | |
| | | !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(); |
| | | }); |
| | |
| | | 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; |
| | | } |
| | | }); |
| | | } |
| | |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | | classifyItem: this.classifyData.label, |
| | | authButton:{}, |
| | | uuid: uuidv4(),//生成唯一的id, |
| | | index: this.addIndex, |
| | | } |