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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user