This commit is contained in:
Taric Xin
2022-02-22 16:43:14 +08:00
parent 6285aa085c
commit 212be1e066
9 changed files with 78 additions and 2005 deletions

View File

@ -1,10 +1,8 @@
import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { EAEnvironmentService } from '@shared';
import { NzFormatEmitEvent, NzTreeNode, NzTreeNodeOptions } from 'ng-zorro-antd/core/tree';
import { NzTreeComponent } from 'ng-zorro-antd/tree';
import { SystemService } from '../../../services/system.service';
import { Funcs } from './funcs';
@Component({
selector: 'app-cuc-menu',
@ -20,10 +18,9 @@ export class SettingMenuComponent implements OnInit, OnChanges {
defaultExpandedKeys: any[] = [];
defaultCheckedKeys: any[] = [];
functionList: any[] = [];
selectProject: any = {};
selectApp: any = {};
@Input() type = 'edit';
@Input() source = '';
@Input() appId = this.envSrv.env.appId;
@Input() isAuthorityIdDTOList: any[] = [];
@Input() authorityAssistId: any[] = [];
@Input() roleId: any;
@ -44,17 +41,15 @@ export class SettingMenuComponent implements OnInit, OnChanges {
ngOnInit() {}
getAllFunction() {
this.service
.request(this.service.$api_getAllFunctionInfoByAppId, { appId: this.envSrv.env.appId }, 'POST', true, 'FORM')
.subscribe(res => {
// if (this.source === 'onlyRelationAuth') {
// this.addDisabledTree(res);
// } else {
// // this.addDisabledLeafTree(res);
// }
this.functionList = res;
this.defaultCheckedKeys = this.authorityAssistId;
});
this.service.request(this.service.$api_getAllFunctionInfoByAppId, { appId: this.appId }, 'POST', true, 'FORM').subscribe(res => {
// if (this.source === 'onlyRelationAuth') {
// this.addDisabledTree(res);
// } else {
// // this.addDisabledLeafTree(res);
// }
this.functionList = res;
this.defaultCheckedKeys = this.authorityAssistId;
});
}
addAuthority(origin: { id: any; all: any }, node: { buttonInfoList: any[] }, item?: { checked: any; functionButtonId: any }) {
if (this.authority.length && this.authority.filter(authItem => authItem.authorityId === origin.id).length) {
@ -207,7 +202,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
});
}
addDisabledTree(arr: any[]) {
arr.forEach((item: any) => {
item.disableCheckbox = true;
@ -283,7 +278,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
}
});
}
initButtonList(id: any, origin: any) {
const params = {
id