This commit is contained in:
Taric Xin
2022-02-24 15:34:36 +08:00
parent f1fde49ea8
commit d06b7ca974
8 changed files with 104 additions and 72 deletions

View File

@ -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);
}
});
}
}