edit
This commit is contained in:
		| @ -88,6 +88,8 @@ export class SettingRoleEditComponent implements OnInit { | ||||
|     //   this.service.msgSrv.warning('请选择权限!'); | ||||
|     //   return; | ||||
|     // } | ||||
|     console.log(this.params); | ||||
|  | ||||
|     const auths = this.menu?.washTree(); | ||||
|     const params: any = { | ||||
|       id: this.params.id, | ||||
| @ -98,13 +100,22 @@ export class SettingRoleEditComponent implements OnInit { | ||||
|     if (this.params.id === 0) { | ||||
|       delete params.id; | ||||
|     } | ||||
|     if (this.params?.type === 'freight') { | ||||
|       Object.assign(params, { enterpriseId: 0, enterpriseProjectId: 0 }); | ||||
|     } | ||||
|     if (this.params.id) { | ||||
|       this.service.request(this.params.updateUrl, params).subscribe(res => { | ||||
|         this.modal.close(true); | ||||
|         if (res) { | ||||
|           this.service.msgSrv.success('编辑成功'); | ||||
|           this.modal.close(true); | ||||
|         } | ||||
|       }); | ||||
|     } else { | ||||
|       this.service.request(this.params.addUrl, params).subscribe(res => { | ||||
|         this.modal.close(true); | ||||
|         if (res) { | ||||
|           this.service.msgSrv.success('新增成功'); | ||||
|           this.modal.close(true); | ||||
|         } | ||||
|       }); | ||||
|     } | ||||
|   } | ||||
|  | ||||
| @ -30,7 +30,7 @@ export class RoleManagementComponent implements OnInit { | ||||
|   columns: STColumn[] = [ | ||||
|     { title: '角色名称', index: 'roleName' }, | ||||
|     { title: '角色描述', index: 'roleDescription' }, | ||||
|     { title: '企业数量', index: 'roleDescription', iif: _ => this.type === 'freight' }, | ||||
|     { title: '企业数量', index: 'userNumber', iif: _ => this.type === 'freight' }, | ||||
|     { title: '创建人手机号', index: 'telephone' }, | ||||
|     { | ||||
|       title: '创建时间', | ||||
| @ -46,13 +46,13 @@ export class RoleManagementComponent implements OnInit { | ||||
|           text: '编辑', | ||||
|           click: item => this.roleAction(item), | ||||
|           iif: item => item.roleName !== '超级管理员', | ||||
|           acl: { ability: ['SYSTEM-ROLE-edit'] }, | ||||
|           acl: { ability: ['SYSTEM-ROLE-edit'] } | ||||
|         }, | ||||
|         { | ||||
|           text: '删除', | ||||
|           click: item => this.deleteAction(item), | ||||
|           iif: item => item.roleName !== '超级管理员', | ||||
|           acl: { ability: ['SYSTEM-ROLE-delete'] }, | ||||
|           acl: { ability: ['SYSTEM-ROLE-delete'] } | ||||
|         } | ||||
|       ] | ||||
|     } | ||||
| @ -65,7 +65,8 @@ export class RoleManagementComponent implements OnInit { | ||||
|     infoUrl: this.service.$api_getRoleInfo, | ||||
|     addUrl: this.service.$api_save_role, | ||||
|     updateUrl: this.service.$api_update_role, | ||||
|     title:'角色管理' | ||||
|     title: '角色管理', | ||||
|     type: 'user' | ||||
|   }; | ||||
|  | ||||
|   constructor(public service: SystemService, private nzModalService: NzModalService, private route: ActivatedRoute) { | ||||
| @ -74,13 +75,14 @@ export class RoleManagementComponent implements OnInit { | ||||
|         this.type = type; | ||||
|         if (type !== 'user') { | ||||
|           this.params = { | ||||
|             listUrl: this.service.$api_get_role_page, | ||||
|             listUrl: this.service.$api_get_ent_role_page, | ||||
|             deleteUrl: this.service.$api_dalete_role, | ||||
|             infoUrl: this.service.$api_getRoleInfo, | ||||
|             addUrl: this.service.$api_save_role, | ||||
|             updateUrl: this.service.$api_update_role, | ||||
|             appId: 'A48F72F0A304427F921794BAD86B3522', | ||||
|             title:'企业角色管理' | ||||
|             title: '企业角色管理', | ||||
|             type: 'freight' | ||||
|           }; | ||||
|         } | ||||
|       } | ||||
| @ -103,7 +105,7 @@ export class RoleManagementComponent implements OnInit { | ||||
|     const modal = this.nzModalService.create({ | ||||
|       nzContent: SettingRoleEditComponent, | ||||
|       nzWidth: 900, | ||||
|       nzComponentParams: item ? { params: { ...item, ...this.params } } : { params: { id: 0 } }, | ||||
|       nzComponentParams: item ? { params: { ...item, ...this.params } } : { params: { id: 0, ...this.params } }, | ||||
|       nzFooter: null | ||||
|     }); | ||||
|     modal.afterClose.subscribe(res => { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user