| | |
| | | <div v-for="(item,index) in treeCenter[0].children" :key="item.menucode"> |
| | | |
| | | <div |
| | | v-if="item.buttoncodelist ===null " |
| | | v-if="!item.buttoncodelist" |
| | | style="margin-left: 40px;height:26px;display: flex;" |
| | | /> |
| | | |
| | |
| | | <div v-if="treeCenter.length>0"> |
| | | <div v-for="item in treeCenter[0].children" :key="item.menucode"> |
| | | <div |
| | | v-if="item.datacodelist ===null " |
| | | v-if="!item.datacodelist" |
| | | style="margin-left: 40px;height:26px;display: flex;" |
| | | /> |
| | | |
| | |
| | | this.treeCenter[0].children.forEach(item => { |
| | | if (item.children && item.children.length) { |
| | | item.children.forEach(it => { |
| | | it.buttoncodelist = it.buttoncodelist !== null ? it.buttoncodelist.split(',') : [] |
| | | it.buttoncodelist = it.buttoncodelist !== '' && it.buttoncodelist !== null ? it.buttoncodelist.split(',') : [] |
| | | if (it.buttoncodelist && it.buttoncodelist.length > 0) { |
| | | it.buttoncodelist = this.$ButtonData.filter(j => |
| | | it.buttoncodelist.includes(j.buttoncode) |
| | |
| | | }, |
| | | // 单个按钮改变 |
| | | handleCheckedButtonChange(oldValue, index, code, newValue, flag) { |
| | | console.log(oldValue, index, code, newValue, 2) |
| | | // console.log(oldValue, index, code, newValue, 2) |
| | | // 判断是否包含在内 |
| | | if (!flag) { |
| | | if (!this.menuCheckedCodeArr.includes(code) && oldValue.length === 0 && newValue.length === 1) { // 否 |
| | |
| | | // 处理中间树形选中值改变 |
| | | handleTreeCenterCheckChange(obj, selfChecked, selfChildrenTreeCheck) { |
| | | // console.log(obj, selfChecked, selfChildrenTreeCheck, '王老吉') |
| | | console.log(selfChecked, 10) |
| | | if (!selfChildrenTreeCheck) { |
| | | if (!selfChecked) { // 从选中到不选中 |
| | | obj.buttonChecked = [] |
| | |
| | | this.menuCheckedCodeArr = this.menuCheckedCodeArr.filter(i => i !== obj.menucode) |
| | | } |
| | | if (selfChecked) { // 从不选中到选中 |
| | | console.log(obj, 9) |
| | | obj.buttonCheckedCode = [] |
| | | this.treeCenter[0].children.forEach(item => { |
| | | if (item.children && item.children.length) { |
| | |
| | | } |
| | | }) |
| | | |
| | | console.log(arr, 'arr') |
| | | // console.log(arr, 'arr') |
| | | const rolecode = this.$refs.treeLeftRef.getCurrentKey() |
| | | const res = await RolePermissionSava(JSON.stringify(arr), rolecode, this.activeName) |
| | | if (res.code === '200') { |