fix bug
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
<!--
|
||||||
|
* @Description :
|
||||||
|
* @Version : 1.0
|
||||||
|
* @Author : Shiming
|
||||||
|
* @Date : 2022-04-21 13:49:22
|
||||||
|
* @LastEditors : Shiming
|
||||||
|
* @LastEditTime : 2022-04-25 14:32:43
|
||||||
|
* @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\components\\role-management\\edit\\edit.component.html
|
||||||
|
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||||
|
-->
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<div class="modal-title">{{ params.id === 0 ? '新增角色' : '编辑角色' }}</div>
|
<div class="modal-title">{{ params.id === 0 ? '新增角色' : '编辑角色' }}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -11,7 +21,7 @@
|
|||||||
<se label="角色权限" required [labelWidth]="120">
|
<se label="角色权限" required [labelWidth]="120">
|
||||||
<app-cuc-menu #menu (changeData)="getData($event)" [type]="params.id === 0 ? 'add' : 'edit'" [roleId]="params.id" [appId]="params.appId"
|
<app-cuc-menu #menu (changeData)="getData($event)" [type]="params.id === 0 ? 'add' : 'edit'" [roleId]="params.id" [appId]="params.appId"
|
||||||
[isAuthorityIdDTOList]="roleInfoData.authority || []"
|
[isAuthorityIdDTOList]="roleInfoData.authority || []"
|
||||||
[authorityAssistId]="roleInfoData.authorityAssistId || []">
|
[authorityAssistId]="roleInfoData.authorityAssistId || []" (changeIF)="changeIF($event)">
|
||||||
</app-cuc-menu>
|
</app-cuc-menu>
|
||||||
</se>
|
</se>
|
||||||
</se-container>
|
</se-container>
|
||||||
|
|||||||
@ -21,6 +21,7 @@ export class SettingRoleEditComponent implements OnInit {
|
|||||||
roleInfoData: any = {};
|
roleInfoData: any = {};
|
||||||
authorityAssistId: any[] = [];
|
authorityAssistId: any[] = [];
|
||||||
params: any;
|
params: any;
|
||||||
|
changeValue: boolean = false
|
||||||
schema!: SFSchema;
|
schema!: SFSchema;
|
||||||
authority: any[] = [];
|
authority: any[] = [];
|
||||||
constructor(private modal: NzModalRef, public service: SystemService) {}
|
constructor(private modal: NzModalRef, public service: SystemService) {}
|
||||||
@ -81,11 +82,18 @@ console.log(this.params.infoUrl)
|
|||||||
close() {
|
close() {
|
||||||
this.modal.destroy();
|
this.modal.destroy();
|
||||||
}
|
}
|
||||||
|
changeIF(value: boolean) {
|
||||||
|
console.log(value);
|
||||||
|
console.log('54545');
|
||||||
|
this.changeValue = true
|
||||||
|
}
|
||||||
sure() {
|
sure() {
|
||||||
if (!this.sf?.valid) {
|
if (!this.sf?.valid) {
|
||||||
this.service.msgSrv.warning('角色名称不能为空');
|
this.service.msgSrv.warning('角色名称不能为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log(this.changeValue);
|
||||||
|
|
||||||
const auths = this.menu?.washTree();
|
const auths = this.menu?.washTree();
|
||||||
if (auths.authorityAssistId.length === 0) {
|
if (auths.authorityAssistId.length === 0) {
|
||||||
this.service.msgSrv.warning('请选择权限!');
|
this.service.msgSrv.warning('请选择权限!');
|
||||||
@ -97,6 +105,10 @@ console.log(this.params.infoUrl)
|
|||||||
authority: auths.authority,
|
authority: auths.authority,
|
||||||
authorityAssistId: auths.authorityAssistId
|
authorityAssistId: auths.authorityAssistId
|
||||||
};
|
};
|
||||||
|
if(this.changeValue) {
|
||||||
|
params.isUpdateAuthority = 1
|
||||||
|
}
|
||||||
|
|
||||||
if (this.params.id === 0) {
|
if (this.params.id === 0) {
|
||||||
delete params.id;
|
delete params.id;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,6 +26,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
|
|||||||
@Input() isAuthorityIdDTOList: any[] = [];
|
@Input() isAuthorityIdDTOList: any[] = [];
|
||||||
@Input() authorityAssistId: any[] = [];
|
@Input() authorityAssistId: any[] = [];
|
||||||
@Input() roleId: any;
|
@Input() roleId: any;
|
||||||
|
@Output() changeIF= new EventEmitter();
|
||||||
@Output() changeData = new EventEmitter();
|
@Output() changeData = new EventEmitter();
|
||||||
constructor(public service: SystemService, private cdr: ChangeDetectorRef, private envSrv: EAEnvironmentService) {}
|
constructor(public service: SystemService, private cdr: ChangeDetectorRef, private envSrv: EAEnvironmentService) {}
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
@ -67,6 +68,7 @@ export class SettingMenuComponent implements OnInit, OnChanges {
|
|||||||
if (menuItem.authorityId === origin.id) {
|
if (menuItem.authorityId === origin.id) {
|
||||||
menuItem.buttonAuthorityIds = menuItem.buttonAuthorityIds || []; // 防止属性不存在,给属性指定数据类型
|
menuItem.buttonAuthorityIds = menuItem.buttonAuthorityIds || []; // 防止属性不存在,给属性指定数据类型
|
||||||
if (item) {
|
if (item) {
|
||||||
|
this.changeIF.emit(true);
|
||||||
// 单选
|
// 单选
|
||||||
if (item.checked) {
|
if (item.checked) {
|
||||||
if (menuItem.buttonAuthorityIds.indexOf(item.functionButtonId) === -1) {
|
if (menuItem.buttonAuthorityIds.indexOf(item.functionButtonId) === -1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user