| | |
| | | currentRow: {} |
| | | }; |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | }, |
| | | watch: { |
| | | // 监听父组件传的窗口显示隐藏的值 |
| | | visible() { |
| | |
| | | this.classifyAuthData.push(item); |
| | | this.addIndex = this.classifyAuthData.length - 1; //添加行下标等于classifyAuthData的长度-1 |
| | | this.roleHandlerMethods(authData.roleId, 'create', index) |
| | | console.log('index', index) |
| | | // console.log('index', index) |
| | | }) |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | computed: {}, |
| | | mounted() { |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | roleHandlerMethods(id, type, index) { |
| | |
| | | const filteredItems = this.classifyAuthButton.filter(item => { |
| | | return !res.data.data.find(x => x.id === item.id); |
| | | }); |
| | | console.log('禁用按钮',filteredItems) |
| | | console.log('不禁用按钮',res.data.data) |
| | | // console.log('禁用按钮',filteredItems) |
| | | // console.log('不禁用按钮',res.data.data) |
| | | //拿表格列头循环和没有对应的属性进行比较 |
| | | this.classifyAuthHeader.forEach((item) => { |
| | | const isMatched = filteredItems.some(x => x.id === item.prop); |
| | |
| | | this.classifyAuthData[classIndex].allDisabled = false; |
| | | } |
| | | }); |
| | | console.log('classifyAuthData',this.classifyAuthData) |
| | | // console.log('classifyAuthData',this.classifyAuthData) |
| | | //强制刷新表格 |
| | | this.itemKey = uuidv4(); |
| | | }) |
| | |
| | | this.$message.warning("当前租户不存在角色信息!"); |
| | | return; |
| | | } |
| | | console.log('this.roleList', this.roleList) |
| | | // console.log('this.roleList', this.roleList) |
| | | this.addIndex++; //自定义生成添加行下标 |
| | | let item = { |
| | | roleData: this.roleList[0].id, |
| | |
| | | this.classifyAuthButton.forEach(data => { |
| | | Vue.set(item, data.id, false); |
| | | }) |
| | | //console.log(item) |
| | | this.classifyAuthData.push(item); |
| | | this.roleHandlerMethods(this.roleList[0].id, 'add', this.addIndex) |
| | | }, |