This commit is contained in:
Taric Xin
2021-12-13 20:57:26 +08:00
parent c4b249fe94
commit 5c7a303abc
14 changed files with 800 additions and 1164 deletions

View File

@ -78,7 +78,7 @@ export class FreightComponentsUserComponent implements OnInit {
});
}
userAction(status: number) {
userAction(status: number, appUserId: Array<number>) {
this.modal.warning({
nzTitle: status === 1 ? '确定启用该用户吗?' : '确定冻结该用户吗?',
nzContent:
@ -86,8 +86,17 @@ export class FreightComponentsUserComponent implements OnInit {
? '停用后,该用户将被限制使用,不限于访问受限、无法发布货源等,请谨慎操作'
: '启用后,该用户将恢复正常使用功能,请再次确认',
nzOnOk: () => {
// this.service.request(this.service.$api_lock_user)
this.st.reload();
this.service
.request(this.service.$api_lock_app_user, {
appUserId,
freezeOrResume: !!!status
})
.subscribe(res => {
if (res) {
this.service.msgSrv.success(status === 1 ? '启用成功' : '冻结成功');
this.st.reload();
}
});
}
});
}
@ -213,18 +222,18 @@ export class FreightComponentsUserComponent implements OnInit {
{
text: '查看',
click: (item: any) => {
this.router.navigate(['./view', item.id], { relativeTo: this.ar });
this.router.navigate(['./view', item.appUserId], { relativeTo: this.ar });
}
},
{
text: '冻结',
iif: item => item.stateLocked === 0,
click: (item: any) => this.userAction(0)
click: (item: any) => this.userAction(0, [Number(item.appUserId)])
},
{
text: '启用',
iif: item => item.stateLocked === 1,
click: (item: any) => this.userAction(1)
click: (item: any) => this.userAction(1, [Number(item.appUserId)])
}
]
}