edit
This commit is contained in:
@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnInit, O
|
|||||||
import { EAEnvironmentService } from '@shared';
|
import { EAEnvironmentService } from '@shared';
|
||||||
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNode } from 'ng-zorro-antd/tree';
|
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNode } from 'ng-zorro-antd/tree';
|
||||||
import { SystemService } from '../../../services/system.service';
|
import { SystemService } from '../../../services/system.service';
|
||||||
|
// TODO 父节点修改 更新子节点权限点
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-menu-tree',
|
selector: 'app-menu-tree',
|
||||||
templateUrl: './menu-tree.component.html',
|
templateUrl: './menu-tree.component.html',
|
||||||
@ -130,6 +130,7 @@ export class MenuTreeComponent implements OnInit, OnChanges {
|
|||||||
this.recursionSetNodeAuth(event.node.origin);
|
this.recursionSetNodeAuth(event.node.origin);
|
||||||
} else {
|
} else {
|
||||||
this.recursionDeleteNodeAuth(event.node?.origin);
|
this.recursionDeleteNodeAuth(event.node?.origin);
|
||||||
|
console.log(this.origin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -195,13 +196,6 @@ export class MenuTreeComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private recursionDeleteParantNode(node: NzTreeNode) {
|
|
||||||
this.authorityAssistId = this.authorityAssistId.filter(auth => auth !== node.origin.id);
|
|
||||||
if (node.parentNode) {
|
|
||||||
this.recursionDeleteParantNode(node.parentNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
washTree() {
|
washTree() {
|
||||||
// const checkedNode: any = this.nzTreeComponent.getCheckedNodeList();
|
// const checkedNode: any = this.nzTreeComponent.getCheckedNodeList();
|
||||||
// const halfCheckedNode: any = this.nzTreeComponent.getHalfCheckedNodeList();
|
// const halfCheckedNode: any = this.nzTreeComponent.getHalfCheckedNodeList();
|
||||||
@ -222,10 +216,24 @@ export class MenuTreeComponent implements OnInit, OnChanges {
|
|||||||
if (res) {
|
if (res) {
|
||||||
origin.buttonInfoList = res;
|
origin.buttonInfoList = res;
|
||||||
origin.all = false;
|
origin.all = false;
|
||||||
// if (origin.checked) {
|
// 如果树节点未勾选 剔除源数据中该节点的权限数据
|
||||||
// res.forEach(auth => this._apiAuthSet.add(auth.functionButtonId));
|
if (!origin.checked) {
|
||||||
// }
|
res.forEach(auth => this._apiAuthSet.delete(auth.functionButtonId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向上递归取消父节点勾选
|
||||||
|
* 清理勾选数据
|
||||||
|
*
|
||||||
|
* @param node
|
||||||
|
*/
|
||||||
|
private recursionDeleteParantNode(node: NzTreeNode) {
|
||||||
|
this.authorityAssistId = this.authorityAssistId.filter(auth => auth !== node.origin.id);
|
||||||
|
if (node.parentNode) {
|
||||||
|
this.recursionDeleteParantNode(node.parentNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user