| | |
| | | type: '' |
| | | } |
| | | const { data: res } = await RoleAssociationRight(data)// 接口获取数据 |
| | | // '0'显示 '1' 不显示 |
| | | |
| | | this.dialogFormRight.rightPCArr = res[0][0].is_delete === '0' ? res[0] : [] |
| | | this.dialogFormRight.rightAPPArr = res[1][0].is_delete === '0' ? res[1] : [] |
| | | |
| | | this.PCTrue = res[0][0].is_delete === '0' |
| | | this.APPTrue = res[1][0].is_delete === '0' |
| | | |
| | | // '0'显示 '1' 不显示 过滤出相对应的菜单 |
| | | if (this.PCTrue) { |
| | | this.dialogFormRight.rightPCArr[0].children.forEach((item, index) => { |
| | | if (item.is_delete === '1') { |
| | | this.dialogFormRight.rightPCArr[0].children.splice(index, 1) |
| | | } else { |
| | | if (item.children.length > 0 && item.children) { |
| | | item.children.forEach((it, ind) => { |
| | | console.log(it, 9) |
| | | console.log(it.is_delete, 9) |
| | | if (it.is_delete === '1') { |
| | | item.children.splice(ind, 1) |
| | | } |
| | | }) |
| | | } |
| | | if (item.children.length === 0) { |
| | | this.dialogFormRight.rightPCArr[0].children.splice(index, 1) |
| | | } |
| | | } |
| | | this.dialogFormRight.rightPCArr[0].children = this.dialogFormRight.rightPCArr[0].children.filter(item => item.is_delete === '0') |
| | | this.dialogFormRight.rightPCArr[0].children.forEach(item => { |
| | | item.children = item.children.filter(it => it.is_delete === '0') |
| | | }) |
| | | } |
| | | |
| | | if (this.APPTrue) { |
| | | this.dialogFormRight.rightAPPArr[0].children.forEach((item, index) => { |
| | | if (item.is_delete === '1') { |
| | | this.dialogFormRight.rightAPPArr[0].children.splice(index, 1) |
| | | } else { |
| | | if (item.children.length > 0 && item.children) { |
| | | item.children.forEach((it, ind) => { |
| | | if (it.is_delete === '1') { |
| | | item.children.splice(ind, 1) |
| | | } |
| | | }) |
| | | } |
| | | if (item.children.length === 0) { |
| | | this.dialogFormRight.rightAPPArr[0].children.splice(index, 1) |
| | | } |
| | | } |
| | | this.dialogFormRight.rightAPPArr[0].children = this.dialogFormRight.rightAPPArr[0].children.filter(item => item.is_delete === '0') |
| | | this.dialogFormRight.rightAPPArr[0].children.forEach(item => { |
| | | item.children = item.children.filter(it => it.is_delete === '0') |
| | | }) |
| | | } |
| | | |