Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop
This commit is contained in:
		| @ -30,7 +30,7 @@ module.exports = { | |||||||
|   // }, |   // }, | ||||||
|   '//api': { |   '//api': { | ||||||
|     target: { |     target: { | ||||||
|       host: 'tms-api-dev.eascs.com', |       host: 'tms-api-test.eascs.com', | ||||||
|       protocol: 'https:', |       protocol: 'https:', | ||||||
|       port: 443 |       port: 443 | ||||||
|     }, |     }, | ||||||
|  | |||||||
| @ -42,6 +42,7 @@ const APPINIT_PROVIDES = [ | |||||||
|     multi: true |     multi: true | ||||||
|   }, |   }, | ||||||
|   { provide: DEFAULT_CURRENCY_CODE, useValue: '¥' }, |   { provide: DEFAULT_CURRENCY_CODE, useValue: '¥' }, | ||||||
|  |   { provide: RouteReuseStrategy, useClass: ReuseTabStrategy, deps: [ReuseTabService] }, | ||||||
|   AuthGuard |   AuthGuard | ||||||
| ]; | ]; | ||||||
| // #endregion | // #endregion | ||||||
| @ -55,6 +56,8 @@ import { SharedModule } from './shared/shared.module'; | |||||||
| import { STWidgetModule } from './shared/widget/st-widget.module'; | import { STWidgetModule } from './shared/widget/st-widget.module'; | ||||||
| import { registerLocaleData } from '@angular/common'; | import { registerLocaleData } from '@angular/common'; | ||||||
| import { AuthGuard } from './core/guards/auth.guard'; | import { AuthGuard } from './core/guards/auth.guard'; | ||||||
|  | import { RouteReuseStrategy } from '@angular/router'; | ||||||
|  | import { ReuseTabService, ReuseTabStrategy } from '@delon/abc/reuse-tab'; | ||||||
|  |  | ||||||
| @NgModule({ | @NgModule({ | ||||||
|   declarations: [AppComponent], |   declarations: [AppComponent], | ||||||
|  | |||||||
| @ -14,7 +14,7 @@ | |||||||
|   </div> |   </div> | ||||||
| </ng-template> | </ng-template> | ||||||
| <ng-template #subLink let-i> | <ng-template #subLink let-i> | ||||||
|   <a *ngIf="!i.externalLink" [routerLink]="i.link" [target]="i.target">{{ i.text }} </a> |   <a *ngIf="!i.externalLink" (click)="routeTo(i.link)" [target]="i.target">{{ i.text }} </a> | ||||||
|   <a *ngIf="i.externalLink" [attr.href]="i.externalLink" [attr.target]="i.target">{{ i.text }} </a> |   <a *ngIf="i.externalLink" [attr.href]="i.externalLink" [attr.target]="i.target">{{ i.text }} </a> | ||||||
| </ng-template> | </ng-template> | ||||||
| <ul *ngIf="menus" nz-menu [nzMode]="mode" [nzTheme]="pro.theme" | <ul *ngIf="menus" nz-menu [nzMode]="mode" [nzTheme]="pro.theme" | ||||||
| @ -22,7 +22,7 @@ | |||||||
|   <ng-container *ngFor="let l1 of menus"> |   <ng-container *ngFor="let l1 of menus"> | ||||||
|     <li *ngIf="l1.children!.length === 0" nz-menu-item class="alain-pro__menu-item" |     <li *ngIf="l1.children!.length === 0" nz-menu-item class="alain-pro__menu-item" | ||||||
|       [class.alain-pro__menu-item--disabled]="l1.disabled" [nzSelected]="l1._selected" [nzDisabled]="l1.disabled"> |       [class.alain-pro__menu-item--disabled]="l1.disabled" [nzSelected]="l1._selected" [nzDisabled]="l1.disabled"> | ||||||
|       <a *ngIf="!l1.externalLink" [routerLink]="l1.link" (click)="closeCollapsed()" class="alain-pro__menu-title"> |       <a *ngIf="!l1.externalLink" (click)="routeTo(l1.link);closeCollapsed()" class="alain-pro__menu-title"> | ||||||
|         <ng-template [ngTemplateOutlet]="mainLink" [ngTemplateOutletContext]="{ $implicit: l1 }"></ng-template> |         <ng-template [ngTemplateOutlet]="mainLink" [ngTemplateOutletContext]="{ $implicit: l1 }"></ng-template> | ||||||
|       </a> |       </a> | ||||||
|       <a *ngIf="l1.externalLink" [attr.href]="l1.externalLink" [attr.target]="l1.target" (click)="closeCollapsed()" |       <a *ngIf="l1.externalLink" [attr.href]="l1.externalLink" [attr.target]="l1.target" (click)="closeCollapsed()" | ||||||
|  | |||||||
| @ -1,5 +1,6 @@ | |||||||
| import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core'; | import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core'; | ||||||
| import { NavigationEnd, Router } from '@angular/router'; | import { NavigationEnd, Router } from '@angular/router'; | ||||||
|  | import { ReuseTabService } from '@delon/abc/reuse-tab'; | ||||||
| import { MenuService } from '@delon/theme'; | import { MenuService } from '@delon/theme'; | ||||||
| import { InputBoolean } from '@delon/util'; | import { InputBoolean } from '@delon/util'; | ||||||
| import { NzMenuModeType } from 'ng-zorro-antd/menu'; | import { NzMenuModeType } from 'ng-zorro-antd/menu'; | ||||||
| @ -25,7 +26,13 @@ export class LayoutProMenuComponent implements OnInit, OnDestroy { | |||||||
|   @Input() @InputBoolean() disabledAcl = false; |   @Input() @InputBoolean() disabledAcl = false; | ||||||
|   @Input() mode: NzMenuModeType = 'inline'; |   @Input() mode: NzMenuModeType = 'inline'; | ||||||
|  |  | ||||||
|   constructor(private menuSrv: MenuService, private router: Router, public pro: BrandService, private cdr: ChangeDetectorRef) {} |   constructor( | ||||||
|  |     private menuSrv: MenuService, | ||||||
|  |     private router: Router, | ||||||
|  |     public pro: BrandService, | ||||||
|  |     private cdr: ChangeDetectorRef, | ||||||
|  |     private reuseService: ReuseTabService | ||||||
|  |   ) {} | ||||||
|  |  | ||||||
|   private cd(): void { |   private cd(): void { | ||||||
|     this.cdr.markForCheck(); |     this.cdr.markForCheck(); | ||||||
| @ -121,4 +128,11 @@ export class LayoutProMenuComponent implements OnInit, OnDestroy { | |||||||
|     unsubscribe$.next(); |     unsubscribe$.next(); | ||||||
|     unsubscribe$.complete(); |     unsubscribe$.complete(); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   routeTo(link: string | undefined) { | ||||||
|  |     if (link) { | ||||||
|  |       this.reuseService.clear(); | ||||||
|  |       this.router.navigate([link]); | ||||||
|  |     } | ||||||
|  |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'; | import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'; | ||||||
|  | import { OnReuseDestroy } from '@delon/abc/reuse-tab'; | ||||||
| import { SFComponent, SFSchema } from '@delon/form'; | import { SFComponent, SFSchema } from '@delon/form'; | ||||||
| import { SearchDrawerService } from '@shared'; | import { SearchDrawerService } from '@shared'; | ||||||
| import { fromEvent, Subscription } from 'rxjs'; | import { fromEvent, Subscription } from 'rxjs'; | ||||||
| @ -24,7 +25,7 @@ import { debounceTime } from 'rxjs/operators'; | |||||||
| @Component({ | @Component({ | ||||||
|   template: '' |   template: '' | ||||||
| }) | }) | ||||||
| export class BasicTableComponent implements AfterViewInit, OnDestroy { | export class BasicTableComponent implements AfterViewInit, OnDestroy, OnReuseDestroy { | ||||||
|   scrollY = '400px'; |   scrollY = '400px'; | ||||||
|  |  | ||||||
|   sf!: SFComponent; |   sf!: SFComponent; | ||||||
| @ -35,6 +36,9 @@ export class BasicTableComponent implements AfterViewInit, OnDestroy { | |||||||
|   deviationHeight = 0; |   deviationHeight = 0; | ||||||
|  |  | ||||||
|   constructor(public searchDrawerService: SearchDrawerService) {} |   constructor(public searchDrawerService: SearchDrawerService) {} | ||||||
|  |   _onReuseDestroy(): void { | ||||||
|  |     this.drawer.forEach(sub => sub.unsubscribe()); | ||||||
|  |   } | ||||||
|  |  | ||||||
|   ngAfterViewInit(): void { |   ngAfterViewInit(): void { | ||||||
|     setTimeout(() => { |     setTimeout(() => { | ||||||
|  | |||||||
| @ -65,6 +65,7 @@ export class RefundRecordComponent extends BasicTableComponent implements OnInit | |||||||
|         { |         { | ||||||
|           label: '拒绝', |           label: '拒绝', | ||||||
|           type: 'default', |           type: 'default', | ||||||
|  |           loading: () => this.service.http.loading, | ||||||
|           onClick: () => { |           onClick: () => { | ||||||
|             if (!this.msg) { |             if (!this.msg) { | ||||||
|               this.service.msgSrv.warning('请填写原因'); |               this.service.msgSrv.warning('请填写原因'); | ||||||
| @ -88,6 +89,7 @@ export class RefundRecordComponent extends BasicTableComponent implements OnInit | |||||||
|         { |         { | ||||||
|           label: '通过', |           label: '通过', | ||||||
|           type: 'primary', |           type: 'primary', | ||||||
|  |           loading: () => this.service.http.loading, | ||||||
|           onClick: () => { |           onClick: () => { | ||||||
|             this.service |             this.service | ||||||
|               .request(this.service.$api_agree_refund_record, { |               .request(this.service.$api_agree_refund_record, { | ||||||
|  | |||||||
| @ -144,7 +144,6 @@ export class MenuModalComponent implements OnInit { | |||||||
|       i18n: null, |       i18n: null, | ||||||
|       // i18n: this.sf?.value.keyCode, |       // i18n: this.sf?.value.keyCode, | ||||||
|       menuType: 0, |       menuType: 0, | ||||||
|       reuse: 0, |  | ||||||
|       shortcut: 0, |       shortcut: 0, | ||||||
|       hideInBreadcrumb: 0, |       hideInBreadcrumb: 0, | ||||||
|       functionType: 0, |       functionType: 0, | ||||||
|  | |||||||
| @ -79,7 +79,9 @@ export class SupplyManagementBulkComponent extends BasicTableComponent implement | |||||||
|   beforeReq = (requestOptions: STRequestOptions) => { |   beforeReq = (requestOptions: STRequestOptions) => { | ||||||
|     const a: any = {}; |     const a: any = {}; | ||||||
|     if (this.resourceStatus) { |     if (this.resourceStatus) { | ||||||
|       a.resourceStatus = this.resourceStatus; |       Object.assign(requestOptions.body, { | ||||||
|  |         resourceStatus: this.resourceStatus | ||||||
|  |       }); | ||||||
|     } |     } | ||||||
|     const params: any = Object.assign({}, this.sf?.value || {}); |     const params: any = Object.assign({}, this.sf?.value || {}); | ||||||
|     delete params._$expand; |     delete params._$expand; | ||||||
|  | |||||||
| @ -75,7 +75,9 @@ export class SupplyManagementVehicleComponent extends BasicTableComponent implem | |||||||
|       ...params |       ...params | ||||||
|     }; |     }; | ||||||
|     if (this.resourceStatus) { |     if (this.resourceStatus) { | ||||||
|       a.resourceStatus = this.resourceStatus; |       Object.assign(requestOptions.body, { | ||||||
|  |         resourceStatus: this.resourceStatus | ||||||
|  |       }); | ||||||
|     } |     } | ||||||
|     if (this.sf) { |     if (this.sf) { | ||||||
|       Object.assign(requestOptions.body, { |       Object.assign(requestOptions.body, { | ||||||
|  | |||||||
| @ -214,7 +214,7 @@ export class BillingOrderComponent extends BasicTableComponent { | |||||||
|         className: 'text-center', |         className: 'text-center', | ||||||
|         index: 'paymentMethodRate', |         index: 'paymentMethodRate', | ||||||
|         width: 130, |         width: 130, | ||||||
|         format: record => `${record.paymentMethodRate}%` |         format: record => `${record.paymentMethodRate*100}%` | ||||||
|       }, |       }, | ||||||
|       { title: '货主名称', index: 'shipperAppUserName', width: '180px', className: 'text-center' }, |       { title: '货主名称', index: 'shipperAppUserName', width: '180px', className: 'text-center' }, | ||||||
|       { title: '所属项目', index: 'enterpriseProjectName', width: '180px', className: 'text-center' }, |       { title: '所属项目', index: 'enterpriseProjectName', width: '180px', className: 'text-center' }, | ||||||
|  | |||||||
| @ -58,9 +58,6 @@ export class UserCenterComponentsDriverCaptainComponent extends BasicTableCompon | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     this.ar.url.subscribe(params => { |  | ||||||
|       this.st?.load(1); |  | ||||||
|     }); |  | ||||||
|   } |   } | ||||||
|   dataProcess(data: STData[]): STData[] { |   dataProcess(data: STData[]): STData[] { | ||||||
|     return data.map((i, index) => { |     return data.map((i, index) => { | ||||||
|  | |||||||
| @ -63,9 +63,6 @@ export class UserCenterComponentsDriverComponent extends BasicTableComponent imp | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     this.ar.url.subscribe(params => { |  | ||||||
|       this.st?.load(1); |  | ||||||
|     }); |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   selectChange(e: any) { |   selectChange(e: any) { | ||||||
|  | |||||||
| @ -25,8 +25,6 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen | |||||||
|  |  | ||||||
|   loadingList = true; |   loadingList = true; | ||||||
|  |  | ||||||
|   sfValue = { enterpriseName: '', contactName: '' }; |  | ||||||
|  |  | ||||||
|   constructor( |   constructor( | ||||||
|     public service: UsermanageService, |     public service: UsermanageService, | ||||||
|     private modal: NzModalService, |     private modal: NzModalService, | ||||||
| @ -36,14 +34,12 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen | |||||||
|     public searchDrawerService: SearchDrawerService |     public searchDrawerService: SearchDrawerService | ||||||
|   ) { |   ) { | ||||||
|     super(searchDrawerService); |     super(searchDrawerService); | ||||||
|  |     this.sfValue = { enterpriseName: '', contactName: '' }; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     this.initSF(); |     this.initSF(); | ||||||
|     this.initST(); |     this.initST(); | ||||||
|     this.ar.url.subscribe(params => { |  | ||||||
|       this.st?.load(1); |  | ||||||
|     }); |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   search() { |   search() { | ||||||
| @ -52,23 +48,23 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen | |||||||
|  |  | ||||||
|   beforeReq = (requestOptions: STRequestOptions) => { |   beforeReq = (requestOptions: STRequestOptions) => { | ||||||
|     Object.assign(requestOptions.body, { listSource: 1 }); |     Object.assign(requestOptions.body, { listSource: 1 }); | ||||||
|     if (this.sf) { |     if (this.sfValue) { | ||||||
|       Object.assign(requestOptions.body, { |       Object.assign(requestOptions.body, { | ||||||
|         ...this.sf?.value |         ...this.sfValue | ||||||
|       }); |       }); | ||||||
|       if (this.sf?.value.createTime) { |       if (this.sfValue.createTime) { | ||||||
|         Object.assign(requestOptions.body, { |         Object.assign(requestOptions.body, { | ||||||
|           createTime: { |           createTime: { | ||||||
|             start: this.sf?.value.createTime[0], |             start: this.sfValue.createTime[0], | ||||||
|             end: this.sf?.value.createTime[1] |             end: this.sfValue.createTime[1] | ||||||
|           } |           } | ||||||
|         }); |         }); | ||||||
|       } |       } | ||||||
|       if (this.sf?.value.approvalTime) { |       if (this.sfValue.approvalTime) { | ||||||
|         Object.assign(requestOptions.body, { |         Object.assign(requestOptions.body, { | ||||||
|           approvalTime: { |           approvalTime: { | ||||||
|             start: this.sf?.value.approvalTime[0], |             start: this.sfValue.approvalTime[0], | ||||||
|             end: this.sf?.value.approvalTime[1] |             end: this.sfValue.approvalTime[1] | ||||||
|           } |           } | ||||||
|         }); |         }); | ||||||
|       } |       } | ||||||
| @ -521,7 +517,7 @@ export class FreightComponentsListComponent extends BasicTableComponent implemen | |||||||
|     const params = { listSource: 1, pageSize: -1 }; |     const params = { listSource: 1, pageSize: -1 }; | ||||||
|     if (this.sf) { |     if (this.sf) { | ||||||
|       Object.assign(params, { |       Object.assign(params, { | ||||||
|         ...this.sf?.value |         ...this.sfValue | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|     this.service.downloadFile(this.service.$api_export_enterprise, params); |     this.service.downloadFile(this.service.$api_export_enterprise, params); | ||||||
|  | |||||||
| @ -36,11 +36,7 @@ export class FreightComponentsUserComponent extends BasicTableComponent implemen | |||||||
|     this.st?.load(1); |     this.st?.load(1); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   ngOnInit() { |   ngOnInit() {} | ||||||
|     this.ar.url.subscribe(params => { |  | ||||||
|       this.st?.load(1); |  | ||||||
|     }); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
|   beforeReq = (requestOptions: STRequestOptions) => { |   beforeReq = (requestOptions: STRequestOptions) => { | ||||||
|     Object.assign(requestOptions.body, { certificationStatus: this.resourceStatus }); |     Object.assign(requestOptions.body, { certificationStatus: this.resourceStatus }); | ||||||
|  | |||||||
| @ -56,9 +56,6 @@ export class VehicleComponentsAuditComponent extends BasicTableComponent impleme | |||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     this.initSF(); |     this.initSF(); | ||||||
|     this.initST(); |     this.initST(); | ||||||
|     this.ar.url.subscribe(params => { |  | ||||||
|       this.st?.load(1); |  | ||||||
|     }); |  | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   search() { |   search() { | ||||||
|  | |||||||
| @ -48,9 +48,6 @@ export class VehicleComponentsListComponent extends BasicTableComponent implemen | |||||||
|   ngOnInit() { |   ngOnInit() { | ||||||
|     this.initSF(); |     this.initSF(); | ||||||
|     this.initST(); |     this.initST(); | ||||||
|     this.ar.url.subscribe(params => { |  | ||||||
|       this.st?.load(1); |  | ||||||
|     }); |  | ||||||
|   } |   } | ||||||
|   dataProcess(data: STData[]): STData[] { |   dataProcess(data: STData[]): STData[] { | ||||||
|     return data.map((i, index) => { |     return data.map((i, index) => { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user