Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
wangshiming
2022-01-12 13:12:36 +08:00
7 changed files with 96 additions and 60 deletions

View File

@ -5,4 +5,10 @@
</button>
<button nz-button (click)="menuImport(1)" [nzLoading]="service.http.loading">
导入运营后台菜单
</button>
<button nz-button (click)="delMenu(0)" [nzLoading]="service.http.loading">
清空货主菜单
</button>
<button nz-button (click)="delMenu(1)" [nzLoading]="service.http.loading">
清空运营后台菜单
</button>

View File

@ -46,8 +46,6 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
loadMenus(appId: string) {
this.service.request(this.service.$api_get_one, { appId }, 'POST', false).subscribe(res => {
console.log(res);
this.menus = res;
});
}
@ -63,8 +61,6 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
}
this.service.http.request('GET', `assets/mocks/platform/${this.selectedPlatform.enName}.json`).subscribe((res: any) => {
console.log(res);
this.addMenu(res.menu);
});
}
@ -96,24 +92,23 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
addMenuRecursion() {}
delMenu(appId: string, menus: Array<Menu>) {
if (!menus || menus.length === 0) {
return;
}
let notice = `确认删除菜单[${menus[0].text}]?`;
if (menus.length > 1) {
notice = `确认删除勾选的${menus.length}行菜单记录?`;
}
const ids = menus.map(r => r.id);
delMenu(type: number) {
this.modal.confirm({
nzTitle: '<i>删除确认</i>',
nzContent: `<b>${notice}</b><br>是否删除?`,
nzOnOk: () =>
this.service.delMany(ids).subscribe(res => {
if (res === true) {
this.service.msgSrv.success('删除成功!');
}
})
nzContent: `是否确认删除?`,
nzOnOk: () => {
this.deleteMenuByAppID(type === 0 ? 'A48F72F0A304427F921794BAD86B3522' : this.envSrv.env.appId);
}
});
}
deleteMenuByAppID(appId: string) {
this.service.request(this.service.$api_get_one, { appId }, 'POST', false).subscribe(res => {
console.log(res);
if (res) {
this.menus = res;
}
});
}
}

View File

@ -18,10 +18,14 @@
</div>
</div>
</nz-card>
<nz-card>
<!-- 数据列表 -->
<!-- [data]="service.$api_get_supplier_page" -->
<nz-card class="content-box">
<nz-tabset [nzSelectedIndex]="1">
<nz-tab nzTitle="全部" (nzClick)="selectChange(null)"></nz-tab>
<nz-tab nzTitle="待审核" (nzClick)="selectChange(0)"></nz-tab>
<nz-tab nzTitle="已审核" (nzClick)="selectChange(1)"></nz-tab>
</nz-tabset>
<!-- 数据列表 -->
<st #st [columns]="columns" [data]='service.$api_get_driver_list'
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"

View File

@ -19,4 +19,10 @@
nz-range-picker {
width: 100%;
}
.content-box {
.ant-card-body {
padding-top: 6px;
}
}
}

View File

@ -22,6 +22,7 @@ export class UserCenterComponentsDriverComponent implements OnInit {
promoterModal!: any;
promotersTelephone = '';
resourceStatus: any = 0;
constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
/**
@ -52,6 +53,11 @@ export class UserCenterComponentsDriverComponent implements OnInit {
});
}
selectChange(e: any) {
this.resourceStatus = e;
this.st.load();
}
addPromoter(item?: any) {
this.promotersTelephone = item?.promotersTelephone;
const modal = this.modal.create({