| | |
| | | }) |
| | | } |
| | | }); |
| | | console.log('created', this.classifyAuthData) |
| | | }); |
| | | } |
| | | }, |
| | |
| | | this.$set(this.classifyAuthData[classIndex], 'allDisabled', true) |
| | | } |
| | | }); |
| | | |
| | | console.log(this.classifyAuthData) |
| | | //强制刷新表格 |
| | | this.itemKey = uuidv4(); |
| | | }) |
| | |
| | | roleList: [], |
| | | //当前选中的表格行 |
| | | selectList: [], |
| | | itemKey: '', |
| | | addIndex: Number, |
| | | currentRow: {} |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | let columnItem = { |
| | | label: item.name, |
| | | prop: item.id, |
| | | code: item.code, |
| | | type: "checkbox", |
| | | width: 180, |
| | | }; |
| | |
| | | }); |
| | | //console.log(item) |
| | | this.classifyAuthData.push(item); |
| | | this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1 |
| | | // this.roleHandlerMethods(authData.roleId, 'create', this.addIndex) |
| | | }) |
| | | } |
| | | }); |
| | |
| | | created() { |
| | | }, |
| | | methods: { |
| | | roleHandlerMethods(id, type, index) { |
| | | if (this.classifyAuthData.length < 0) { |
| | | return; |
| | | } |
| | | |
| | | getButtonsByRoleId({roleId: id, code: 'classifyTree'}).then(res => { |
| | | // 找到this.classifyAuthButton中没有对应的属性 |
| | | const filteredItems = this.classifyAuthButton.filter(item => { |
| | | return !res.data.data.find(x => x.id === item.id); |
| | | }); |
| | | |
| | | //拿表格列头循环和没有对应的属性进行比较 |
| | | this.classifyAuthHeader.forEach((item) => { |
| | | if (filteredItems.some(x => x.id === item.prop)) { |
| | | this.$nextTick(() => { |
| | | if (this.classifyAuthData[index] !== undefined && this.classifyAuthData[index] !== null) { |
| | | 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.classifyAuthData.forEach((classkey, classIndex) => { |
| | | if (classkey.classify_view) { |
| | | this.$set(this.classifyAuthData[classIndex], 'allDisabled', true) |
| | | } |
| | | }); |
| | | |
| | | //强制刷新表格 |
| | | this.itemKey = uuidv4(); |
| | | }) |
| | | }, |
| | | // 关闭对话框 |
| | | closeDialog() { |
| | | this.$emit('update:visible', false); |