| | |
| | | }, |
| | | computed: {}, |
| | | mounted() {}, |
| | | created() {}, |
| | | created() { |
| | | this.addIndex = this.classifyAuthData.length <= 0 ? 0 :this.classifyAuthData.length -1; |
| | | }, |
| | | watch: { |
| | | // 监听父组件传的窗口显示隐藏的值 |
| | | visible() { |
| | |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,true); |
| | | }); |
| | | |
| | | //添加 “查看全部禁用条件” |
| | | if (item.code === "classify_view") { |
| | | this.$set(this.classifyAuthData[index].authButton, "allDisabled", true); |
| | | console.log(this.classifyAuthData[index].authButton.allDisabled) |
| | | } |
| | | |
| | | } else { |
| | | Object.keys(this.classifyAuthData[index]).forEach((key) => { |
| | | this.$set(this.classifyAuthData[index].authButton,item.code,false); |
| | | }); |
| | | |
| | | if(item.code === "classify_view"){ |
| | | this.classifyAuthData[index].authButton.allDisabled = false; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | //添加 “查看全部禁用条件” |
| | | if (this.classifyAuthData) { |
| | | 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.$message.warning("当前租户不存在角色信息!"); |
| | | return; |
| | | } |
| | | // console.log('this.roleList', this.roleList) |
| | | this.addIndex++; //自定义生成添加行下标 |
| | | |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | | classifyItem: this.classifyData.label, |
| | |
| | | }); |
| | | this.classifyAuthData.push(item); |
| | | this.roleHandlerMethods(this.roleList[0].id, "add", this.addIndex); |
| | | this.addIndex++; //自定义生成添加行下标 |
| | | }, |
| | | // 删除行 |
| | | subClassifyAuth() { |
| | |
| | | this.$message.warning("角色和分类已经存在,请重新配置!"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | let flag = false; |
| | | this.classifyAuthData.forEach((item) => { |
| | | let itemButtonList = []; |
| | |
| | | Vue.set(item, data, true); |
| | | }); |
| | | this.classifyAuthData.push(item); |
| | | this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1 |
| | | this.roleHandlerMethods(authData.roleId, "create", index); |
| | | // console.log('index', index) |
| | | }); |