This commit is contained in:
Taric Xin
2022-01-12 10:47:36 +08:00
parent 9d8da4f37e
commit 75808bbaf5
27 changed files with 330 additions and 395 deletions

View File

@ -7,11 +7,10 @@
</div>
<div nz-col [nzXl]="_$expand ? 24 : 8" [nzLg]="24" [nzSm]="24" [nzXs]="24" class="text-right"
[class.expend-options]="_$expand">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="service.http.loading"
(click)="st?.load(1)">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button *ngIf="tabType === 1" nz-button nzType="primary" [nzLoading]="service.http.loading"
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button *ngIf="tabType === 1" nz-button nzType="primary" [disabled]="service.http.loading"
(click)="exportList()">导出</button>
<button nz-button (click)="resetSF()" [disabled]="service.http.loading">重置</button>
<button nz-button nzType="link" (click)="expandToggle(!_$expand)">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
@ -23,7 +22,7 @@
<nz-card>
<!-- 数据列表 -->
<st #st multiSort [data]="service.$api_get_freight_list" [columns]="tabType===1?enterColumns:adminColumns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading">

View File

@ -1,6 +1,6 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STChange, STColumn, STComponent, STData } from '@delon/abc/st';
import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
import { NzModalService } from 'ng-zorro-antd/modal';
import { UsermanageService } from '../../../services/usercenter.service';
@ -34,16 +34,15 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
];
constructor(public service: UsermanageService, private router: Router, private modal: NzModalService) {}
/**
* 查询参数
*/
get reqParams() {
const params = Object.assign({}, this.sf?.value || {}, {
flag: this.tabType
});
delete params._$expand;
return { ...params, listSource: 2 };
}
beforeReq = (requestOptions: STRequestOptions) => {
if (this.sf) {
Object.assign(requestOptions.body, {
...this.sf.value
});
}
Object.assign(requestOptions.body, { flag: this.tabType, listSource: 2 });
return requestOptions;
};
/**
* 伸缩查询条件
@ -65,13 +64,6 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
*/
ngOnInit() {}
/**
* 数据列表状态变化事件
*/
change(e: STChange) {
// console.log(e.checkbox);
}
/**
* 查看详情
*/
@ -145,7 +137,7 @@ export class FreightComponentsEnterpriseAuditComponent implements OnInit {
}
exportList() {
const params = this.reqParams;
const params = { ...this.sf.value, flag: this.tabType, listSource: 2 };
this.service.downloadFile(this.service.$api_export_enterprise, params);
}