This commit is contained in:
Taric Xin
2022-02-11 10:52:44 +08:00
parent 079e222ca9
commit e2ef3366a9
11 changed files with 31 additions and 60 deletions

View File

@ -37,6 +37,9 @@ export class SettingMenuComponent implements OnInit, OnChanges {
this.authority = this.isAuthorityIdDTOList || [];
}
}
if (changes.authorityAssistId) {
this.defaultCheckedKeys = [...this.authorityAssistId];
}
}
ngOnInit() {}
@ -51,7 +54,6 @@ export class SettingMenuComponent implements OnInit, OnChanges {
// }
this.functionList = res;
this.defaultCheckedKeys = this.authorityAssistId;
this.cdr.detectChanges();
});
}
addAuthority(origin: { id: any; all: any }, node: { buttonInfoList: any[] }, item?: { checked: any; functionButtonId: any }) {
@ -166,6 +168,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
this.checkTreeNode(node, origin);
}
checkTreeNode(node: any, origin: { id: any }) {
const checkedNode: any = this.nzTreeComponent.getCheckedNodeList();
const allCheckedArr: any[] = [];
@ -192,12 +195,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
});
this.defaultCheckedKeys = allCheckedArr;
}
addAuthorityAll(origin: any, node: { checked: any; buttonInfoList: any[] }) {
if (node.checked) {
node.buttonInfoList.forEach((item: any) => {});
} else {
}
}
overTree(children: any[], a: any[]) {
children.forEach(item => {
a.push(item.key);
@ -209,16 +207,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
});
}
// 获取角色模板权限
getRoleTpl(id: any) {
const params = {
id
};
this.service.request(this.service.$api_getRoleTemplateInfo, params).subscribe(res => {
this.authority = res.authority;
this.defaultCheckedKeys = res.authorityAssistId;
});
}
addDisabledTree(arr: any[]) {
arr.forEach((item: any) => {
item.disableCheckbox = true;
@ -294,6 +283,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
});
}
initButtonList(id: any, origin: any) {
const params = {
id
@ -329,6 +319,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
});
}
initDictList(id: any, origin: any) {
const params = {
id