| | |
| | | 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: {}, |
| | |
| | | |
| | | //和表格列进行对比 |
| | | 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); |
| | |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // console.log(this.classifyAuthData) |
| | | //强制刷新表格 |
| | | this.itemKey = uuidv4(); |
| | | }); |
| | |
| | | classifyItem: this.classifyData.label, |
| | | authButton: {}, |
| | | uuid: uuidv4(),//生成唯一的id, |
| | | index: this.addIndex, |
| | | index: this.classifyAuthData.length -1, |
| | | } |
| | | //将按钮设置进去 |
| | | this.classifyAuthButton.forEach(data => { |
| | |
| | | }) |
| | | //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() { |
| | |
| | | let itemButtonList = []; |
| | | //筛选出按钮勾选为true的列 |
| | | for (let key in item) { |
| | | if (item[key] === true) { |
| | | if (item[key] === true && key !== 'checkTheStatus') { |
| | | itemButtonList.push(key); |
| | | } |
| | | } |