|
|
@ -1,5 +1,11 @@ |
|
|
|
import {Component, ViewChild} from '@angular/core'; |
|
|
|
import {Component, ViewChild} from '@angular/core'; |
|
|
|
import {NzTableComponent, NzTbodyComponent, NzTheadComponent, NzThMeasureDirective} from "ng-zorro-antd/table"; |
|
|
|
import { |
|
|
|
|
|
|
|
NzTableComponent, |
|
|
|
|
|
|
|
NzTableModule, |
|
|
|
|
|
|
|
NzTbodyComponent, |
|
|
|
|
|
|
|
NzTheadComponent, |
|
|
|
|
|
|
|
NzThMeasureDirective |
|
|
|
|
|
|
|
} from "ng-zorro-antd/table"; |
|
|
|
import {NzDividerComponent} from "ng-zorro-antd/divider"; |
|
|
|
import {NzDividerComponent} from "ng-zorro-antd/divider"; |
|
|
|
import {NzFormDirective, NzFormModule} from "ng-zorro-antd/form"; |
|
|
|
import {NzFormDirective, NzFormModule} from "ng-zorro-antd/form"; |
|
|
|
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
|
|
|
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
|
|
@ -18,9 +24,8 @@ import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/mod |
|
|
|
import {NzMessageService} from "ng-zorro-antd/message"; |
|
|
|
import {NzMessageService} from "ng-zorro-antd/message"; |
|
|
|
import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; |
|
|
|
import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; |
|
|
|
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
|
|
|
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
|
|
|
import {DATA} from "../../../data/login/localStorage.namespace"; |
|
|
|
|
|
|
|
import {MenuService} from "../../../servies/menu/menu.service"; |
|
|
|
import {MenuService} from "../../../servies/menu/menu.service"; |
|
|
|
import {NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions} from "ng-zorro-antd/tree"; |
|
|
|
import {NzTreeComponent, NzTreeNodeOptions} from "ng-zorro-antd/tree"; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-sys-role', |
|
|
|
selector: 'app-sys-role', |
|
|
@ -49,6 +54,7 @@ import {NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions} from "ng-zorro-an |
|
|
|
NzModalModule, |
|
|
|
NzModalModule, |
|
|
|
NgIf, |
|
|
|
NgIf, |
|
|
|
NzTreeComponent, |
|
|
|
NzTreeComponent, |
|
|
|
|
|
|
|
NzTableModule |
|
|
|
], |
|
|
|
], |
|
|
|
templateUrl: './sys-role.component.html', |
|
|
|
templateUrl: './sys-role.component.html', |
|
|
|
styleUrl: './sys-role.component.less' |
|
|
|
styleUrl: './sys-role.component.less' |
|
|
@ -75,9 +81,9 @@ export class SysRoleComponent { |
|
|
|
// 当前需要分配权限角色
|
|
|
|
// 当前需要分配权限角色
|
|
|
|
currentAssignRoleId: any = null; |
|
|
|
currentAssignRoleId: any = null; |
|
|
|
// 菜单树
|
|
|
|
// 菜单树
|
|
|
|
menuTree: any = []; |
|
|
|
menuTree: NzTreeNodeOptions[] = []; |
|
|
|
// 菜单已勾选数据
|
|
|
|
// 菜单已勾选数据
|
|
|
|
menuTreeCheckedKeys: any = []; |
|
|
|
menuTreeCheckedKeys = []; |
|
|
|
|
|
|
|
|
|
|
|
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; |
|
|
|
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; |
|
|
|
|
|
|
|
|
|
|
@ -123,6 +129,7 @@ export class SysRoleComponent { |
|
|
|
* 搜索表单提交 |
|
|
|
* 搜索表单提交 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
searchFormSubmit(): void { |
|
|
|
searchFormSubmit(): void { |
|
|
|
|
|
|
|
this.tablePageNum = 1; |
|
|
|
this.queryData(); |
|
|
|
this.queryData(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -221,7 +228,6 @@ export class SysRoleComponent { |
|
|
|
this.currentAssignRoleId = roleId; |
|
|
|
this.currentAssignRoleId = roleId; |
|
|
|
this.menuService.queryRoleMenuArray(roleId, (data: any) => { |
|
|
|
this.menuService.queryRoleMenuArray(roleId, (data: any) => { |
|
|
|
this.menuTreeCheckedKeys = data['return_data']; |
|
|
|
this.menuTreeCheckedKeys = data['return_data']; |
|
|
|
console.log(this.menuTreeCheckedKeys); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
this.assignRoleMenuVisible = true; |
|
|
|
this.assignRoleMenuVisible = true; |
|
|
|
} |
|
|
|
} |
|
|
@ -267,6 +273,7 @@ export class SysRoleComponent { |
|
|
|
this.menuService.assignMenu(param, (data: any) => { |
|
|
|
this.menuService.assignMenu(param, (data: any) => { |
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
this.message.create('success', '操作成功'); |
|
|
|
this.message.create('success', '操作成功'); |
|
|
|
|
|
|
|
this.closeAssignRoleMenu(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.message.create('error', data['return_msg']); |
|
|
|
this.message.create('error', data['return_msg']); |
|
|
|
} |
|
|
|
} |
|
|
|