7310
This commit is contained in:
@ -158,6 +158,7 @@ export class MenuTreeComponent implements OnInit, OnChanges {
|
|||||||
auths.push(origin.id);
|
auths.push(origin.id);
|
||||||
const authsSet = new Set<string>(auths);
|
const authsSet = new Set<string>(auths);
|
||||||
this.authorityAssistId = [...Array.from(authsSet)];
|
this.authorityAssistId = [...Array.from(authsSet)];
|
||||||
|
this.recursionAddParantNode(node);
|
||||||
} else {
|
} else {
|
||||||
data.forEach(auth => this._apiAuthSet.delete(auth.functionButtonId));
|
data.forEach(auth => this._apiAuthSet.delete(auth.functionButtonId));
|
||||||
this._NodeAuthMap.delete(origin.id);
|
this._NodeAuthMap.delete(origin.id);
|
||||||
@ -243,9 +244,29 @@ export class MenuTreeComponent implements OnInit, OnChanges {
|
|||||||
private recursionDeleteParantNode(node: NzTreeNode) {
|
private recursionDeleteParantNode(node: NzTreeNode) {
|
||||||
this.authorityAssistId = this.authorityAssistId.filter(auth => auth !== node.origin.id);
|
this.authorityAssistId = this.authorityAssistId.filter(auth => auth !== node.origin.id);
|
||||||
if (node.parentNode) {
|
if (node.parentNode) {
|
||||||
|
if (!node.parentNode.children.find(node => node.isChecked) && node.parentNode.origin.level !== 0) {
|
||||||
|
this._NodeAuthMap.delete(node.parentNode.origin.id);
|
||||||
|
}
|
||||||
this.recursionDeleteParantNode(node.parentNode);
|
this.recursionDeleteParantNode(node.parentNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向上递归添加父节点到源数据
|
||||||
|
* 清理勾选数据
|
||||||
|
*
|
||||||
|
* @param node
|
||||||
|
*/
|
||||||
|
private recursionAddParantNode(node: NzTreeNode) {
|
||||||
|
this._NodeAuthMap.set(node.origin.id, {
|
||||||
|
authorityId: node.origin.id,
|
||||||
|
buttonAuthorityIds: [],
|
||||||
|
isUpdateAuthority: 1
|
||||||
|
});
|
||||||
|
if (node.parentNode) {
|
||||||
|
this.recursionAddParantNode(node.parentNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AuthorityIdVO {
|
export interface AuthorityIdVO {
|
||||||
|
|||||||
Reference in New Issue
Block a user