edit
This commit is contained in:
		| @ -1,6 +1,6 @@ | ||||
| import { Component, OnInit, ViewChild } from '@angular/core'; | ||||
| import { ActivatedRoute, Router } from '@angular/router'; | ||||
| import { STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st'; | ||||
| import { STColumn, STColumnBadge, STComponent, STData, STRequestOptions } from '@delon/abc/st'; | ||||
| import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; | ||||
| import { NzModalService } from 'ng-zorro-antd/modal'; | ||||
| import { UsermanageService } from '../../../services/usercenter.service'; | ||||
| @ -21,40 +21,41 @@ export class FreightComponentsUserComponent implements OnInit { | ||||
|   promoterModal!: any; | ||||
|   promotersTelephone = ''; | ||||
|  | ||||
|   resourceStatus: any = 0; | ||||
|  | ||||
|   constructor(public service: UsermanageService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {} | ||||
|  | ||||
|   /** | ||||
|    * 查询参数 | ||||
|    */ | ||||
|   get reqParams() { | ||||
|     const params: any = { | ||||
|       ...(this.sf && this.sf.value) | ||||
|     }; | ||||
|     if (this.sf?.value.effectiveDate) { | ||||
|       Object.assign(params, { | ||||
|         time: { | ||||
|           start: this.sf?.value.effectiveDate[0], | ||||
|           end: this.sf?.value.effectiveDate[1] | ||||
|         } | ||||
|       }); | ||||
|       // params.effectiveDateStart = this.sf?.value.effectiveDate[0]; | ||||
|       // params.effectiveDateEnd = this.sf?.value.effectiveDate[1]; | ||||
|     } | ||||
|     delete params.effectiveDate; | ||||
|     delete params.expand; | ||||
|     return params; | ||||
|   } | ||||
|  | ||||
|   get selectedRows() { | ||||
|     return this.st?.list.filter(item => item.checked) || []; | ||||
|   } | ||||
|  | ||||
|   ngOnInit() { | ||||
|     this.ar.url.subscribe(params => { | ||||
|       this.st?.load(1); | ||||
|     }); | ||||
|   } | ||||
|  | ||||
|   beforeReq = (requestOptions: STRequestOptions) => { | ||||
|     Object.assign(requestOptions.body, { certificationStatus: this.resourceStatus }); | ||||
|     if (this.sf) { | ||||
|       Object.assign(requestOptions.body, { | ||||
|         ...this.sf.value | ||||
|       }); | ||||
|       if (this.sf?.value.effectiveDate) { | ||||
|         Object.assign(requestOptions.body, { | ||||
|           time: { | ||||
|             start: this.sf?.value.effectiveDate[0], | ||||
|             end: this.sf?.value.effectiveDate[1] | ||||
|           } | ||||
|         }); | ||||
|       } | ||||
|       delete requestOptions.body.effectiveDate; | ||||
|       delete requestOptions.body.expand; | ||||
|     } | ||||
|     return requestOptions; | ||||
|   }; | ||||
|  | ||||
|   selectChange(e: any) { | ||||
|     this.resourceStatus = e; | ||||
|     this.st.load(); | ||||
|   } | ||||
|  | ||||
|   addPromoter(item?: any) { | ||||
|     this.promotersTelephone = item?.promotersTelephone; | ||||
|     const modal = this.modal.create({ | ||||
| @ -109,9 +110,6 @@ export class FreightComponentsUserComponent implements OnInit { | ||||
|     this._$expand = !this._$expand; | ||||
|     this.sf?.setValue('/expand', this._$expand); | ||||
|   } | ||||
|   creat() { | ||||
|     this.router.navigate(['./new'], { relativeTo: this.ar }); | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * 重置表单 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user