From 3a90d710eb53bb28741d2a3da02aa77b15f887af Mon Sep 17 00:00:00 2001 From: wangshiming Date: Thu, 24 Feb 2022 20:19:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../list/particulars.component.html | 51 ++++++++++++--- .../components/list/particulars.component.ts | 63 +++++++++++++------ 2 files changed, 85 insertions(+), 29 deletions(-) diff --git a/src/app/routes/partner/rebate-management/components/list/particulars.component.html b/src/app/routes/partner/rebate-management/components/list/particulars.component.html index f252aa0e..0ebf82f0 100644 --- a/src/app/routes/partner/rebate-management/components/list/particulars.component.html +++ b/src/app/routes/partner/rebate-management/components/list/particulars.component.html @@ -1,13 +1,46 @@ + + - - +
+ +
+ +
+ + + +
+ +
+
+ + + + +
+
+
diff --git a/src/app/routes/partner/rebate-management/components/list/particulars.component.ts b/src/app/routes/partner/rebate-management/components/list/particulars.component.ts index 5894e71d..88bc6e8f 100644 --- a/src/app/routes/partner/rebate-management/components/list/particulars.component.ts +++ b/src/app/routes/partner/rebate-management/components/list/particulars.component.ts @@ -4,7 +4,7 @@ import { STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st'; import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; import { processSingleSort, ShipperBaseService } from '@shared'; import { NzModalService } from 'ng-zorro-antd/modal'; -import { RebateManagementService } from '../../services/rebate-management.service'; +import { RebateManagementService } from '../../services/rebate-management.service'; @Component({ selector: 'app-parter-channel-rebate-management-particulars', @@ -19,22 +19,41 @@ export class ParterRebateManageMentParticularsComponent implements OnInit { @ViewChild('sf', { static: false }) sf!: SFComponent; spuStatus = '1'; - - data=[{name1:1111}] + _$expand = false; + data = [{ name1: 1111 }]; constructor( public router: Router, public ar: ActivatedRoute, public service: RebateManagementService, private modalService: NzModalService, public shipperservice: ShipperBaseService - ) {} - /** - * 查询参数 + * 查询字段个数 */ - get reqParams() { - return { ...this.sf?.value }; + get queryFieldCount(): number { + return Object.keys(this.schema?.properties || {}).length; + } + /** + * 伸缩查询条件 + */ + expandToggle(): void { + this._$expand = !this._$expand; + this.sf?.setValue('/_$expand', this._$expand); + } + /** + * 查询参数 + */ + get reqParams() { + const params: any = Object.assign({}, this.sf?.value || {}); + delete params._$expand; + return { + ...params, + deadlineTime: { + start: this.sf?.value?.deadlineTime?.[0] || '', + end: this.sf?.value?.deadlineTime?.[1] || '', + }, + }; } ngOnInit() { this.initSF(); @@ -44,6 +63,7 @@ export class ParterRebateManageMentParticularsComponent implements OnInit { initSF() { this.schema = { properties: { + _$expand: { type: 'boolean', ui: { hidden: true } }, name: { type: 'string', title: '订单号' @@ -63,15 +83,20 @@ export class ParterRebateManageMentParticularsComponent implements OnInit { widget: 'select', placeholder: '请选择', visibleIf: { - _$expand: (value: boolean) => value, + _$expand: (value: boolean) => value }, allowClear: true, - asyncData: () => this.shipperservice.getNetworkFreightForwarder(), - }, + asyncData: () => this.shipperservice.getNetworkFreightForwarder() + } }, phone3: { type: 'string', - title: '合伙人名称' + title: '合伙人名称', + ui: { + visibleIf: { + _$expand: (value: boolean) => value + }, + } }, deadlineTime: { title: '时间范围', @@ -81,15 +106,16 @@ export class ParterRebateManageMentParticularsComponent implements OnInit { mode: 'range', format: 'yyyy-MM-dd', visibleIf: { - _$expand: (value: boolean) => value, + _$expand: (value: boolean) => value }, - allowClear: true, - } as SFDateWidgetSchema, - }, + allowClear: true + } as SFDateWidgetSchema + } } }; this.ui = { '*': { + spanLabelFixed: 140, grid: { span: 8, gutter: 4 } } }; @@ -148,8 +174,7 @@ export class ParterRebateManageMentParticularsComponent implements OnInit { { title: '返佣时间', index: 'name1' - }, - + } ]; } @@ -160,6 +185,4 @@ export class ParterRebateManageMentParticularsComponent implements OnInit { this.sf.reset(); this.st.load(1); } - - }