From 7cfee636e2ae3afc46a3717ae0d42057c2cefef5 Mon Sep 17 00:00:00 2001 From: Taric Xin Date: Sat, 7 May 2022 15:53:06 +0800 Subject: [PATCH] reuse --- .../driver/captain/captain.component.ts | 3 --- .../components/driver/driver.component.ts | 3 --- .../components/freight/list/list.component.ts | 21 +++++++++---------- .../components/freight/user/user.component.ts | 6 +----- .../components/audit/audit.component.ts | 3 --- .../vehicle/components/list/list.component.ts | 3 --- 6 files changed, 11 insertions(+), 28 deletions(-) diff --git a/src/app/routes/usercenter/components/driver/captain/captain.component.ts b/src/app/routes/usercenter/components/driver/captain/captain.component.ts index d197169b..247bdc96 100644 --- a/src/app/routes/usercenter/components/driver/captain/captain.component.ts +++ b/src/app/routes/usercenter/components/driver/captain/captain.component.ts @@ -58,9 +58,6 @@ export class UserCenterComponentsDriverCaptainComponent extends BasicTableCompon } ngOnInit() { - this.ar.url.subscribe(params => { - this.st?.load(1); - }); } dataProcess(data: STData[]): STData[] { return data.map((i, index) => { diff --git a/src/app/routes/usercenter/components/driver/driver.component.ts b/src/app/routes/usercenter/components/driver/driver.component.ts index d903300b..0b803729 100644 --- a/src/app/routes/usercenter/components/driver/driver.component.ts +++ b/src/app/routes/usercenter/components/driver/driver.component.ts @@ -63,9 +63,6 @@ export class UserCenterComponentsDriverComponent extends BasicTableComponent imp } ngOnInit() { - this.ar.url.subscribe(params => { - this.st?.load(1); - }); } selectChange(e: any) { diff --git a/src/app/routes/usercenter/components/freight/list/list.component.ts b/src/app/routes/usercenter/components/freight/list/list.component.ts index adb7e904..020eb8c4 100644 --- a/src/app/routes/usercenter/components/freight/list/list.component.ts +++ b/src/app/routes/usercenter/components/freight/list/list.component.ts @@ -25,8 +25,6 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen loadingList = true; - sfValue = { enterpriseName: '', contactName: '' }; - constructor( public service: UsermanageService, private modal: NzModalService, @@ -36,6 +34,7 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen public searchDrawerService: SearchDrawerService ) { super(searchDrawerService); + this.sfValue = { enterpriseName: '', contactName: '' }; } ngOnInit() { @@ -49,23 +48,23 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen beforeReq = (requestOptions: STRequestOptions) => { Object.assign(requestOptions.body, { listSource: 1 }); - if (this.sf) { + if (this.sfValue) { Object.assign(requestOptions.body, { - ...this.sf?.value + ...this.sfValue }); - if (this.sf?.value.createTime) { + if (this.sfValue.createTime) { Object.assign(requestOptions.body, { createTime: { - start: this.sf?.value.createTime[0], - end: this.sf?.value.createTime[1] + start: this.sfValue.createTime[0], + end: this.sfValue.createTime[1] } }); } - if (this.sf?.value.approvalTime) { + if (this.sfValue.approvalTime) { Object.assign(requestOptions.body, { approvalTime: { - start: this.sf?.value.approvalTime[0], - end: this.sf?.value.approvalTime[1] + start: this.sfValue.approvalTime[0], + end: this.sfValue.approvalTime[1] } }); } @@ -518,7 +517,7 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen const params = { listSource: 1, pageSize: -1 }; if (this.sf) { Object.assign(params, { - ...this.sf?.value + ...this.sfValue }); } this.service.downloadFile(this.service.$api_export_enterprise, params); diff --git a/src/app/routes/usercenter/components/freight/user/user.component.ts b/src/app/routes/usercenter/components/freight/user/user.component.ts index 58e2f015..53e29aa0 100644 --- a/src/app/routes/usercenter/components/freight/user/user.component.ts +++ b/src/app/routes/usercenter/components/freight/user/user.component.ts @@ -36,11 +36,7 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen this.st?.load(1); } - ngOnInit() { - this.ar.url.subscribe(params => { - this.st?.load(1); - }); - } + ngOnInit() {} beforeReq = (requestOptions: STRequestOptions) => { Object.assign(requestOptions.body, { certificationStatus: this.resourceStatus }); diff --git a/src/app/routes/vehicle/components/audit/audit.component.ts b/src/app/routes/vehicle/components/audit/audit.component.ts index bc5fd25f..b6d1a88d 100644 --- a/src/app/routes/vehicle/components/audit/audit.component.ts +++ b/src/app/routes/vehicle/components/audit/audit.component.ts @@ -56,9 +56,6 @@ export class VehicleComponentsAuditComponent extends BasicTableComponent impleme ngOnInit() { this.initSF(); this.initST(); - this.ar.url.subscribe(params => { - this.st?.load(1); - }); } search() { diff --git a/src/app/routes/vehicle/components/list/list.component.ts b/src/app/routes/vehicle/components/list/list.component.ts index 96e68569..3ffe25b9 100644 --- a/src/app/routes/vehicle/components/list/list.component.ts +++ b/src/app/routes/vehicle/components/list/list.component.ts @@ -48,9 +48,6 @@ export class VehicleComponentsListComponent extends BasicTableComponent implemen ngOnInit() { this.initSF(); this.initST(); - this.ar.url.subscribe(params => { - this.st?.load(1); - }); } dataProcess(data: STData[]): STData[] { return data.map((i, index) => {