This commit is contained in:
Taric Xin
2022-01-10 16:46:51 +08:00
parent 4fec082b18
commit df5a8b71bf
8 changed files with 72 additions and 42 deletions

View File

@ -7,9 +7,9 @@
<button nz-button (click)="resetSF()">重置</button>
</div>
<st #st [data]="service.$mock_url" [columns]="columns" bordered size="small"
<st #st [data]="service.$api_get_etc_cart_list" [columns]="columns" bordered size="small"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, process: beforeReq }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[res]="{ reName: { list: 'data.records', total: 'data.total' }, process: afterRes }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100] }" [loading]="service.http.loading"
[scroll]="{ x:'650px',y: '400px' }" (change)="stChange($event)"></st>
</div>

View File

@ -7,7 +7,7 @@ import { TicketService } from '../../../services/ticket.service';
@Component({
selector: 'app-add-cart',
templateUrl: './add-cart.component.html',
templateUrl: './add-cart.component.html'
})
export class AddCartComponent implements OnInit {
data = [];
@ -18,25 +18,25 @@ export class AddCartComponent implements OnInit {
sf!: SFComponent;
columns: STColumn[] = [
{ title: '', index: 'key', type: 'checkbox' },
{ title: '车牌号', index: 'no' },
{ title: '车辆所有人', index: 'callNo' }
{ title: '车牌号', index: 'carNo' },
{ title: '车辆所有人', index: 'carOwner' }
];
searchSchema: SFSchema = {
properties: {
params1: {
carNo: {
title: '',
type: 'string',
ui: {
placeholder: '请输入车牌号'
}
},
params2: {
carOwner: {
title: '',
type: 'string',
ui: {
placeholder: '请输入车辆所有人'
}
},
}
}
};
@ -53,6 +53,10 @@ export class AddCartComponent implements OnInit {
return requestOptions;
};
afterRes = (data: any[], rawData?: any) => {
return data.map(item => ({ ...item, disabled: item.isWhiteList }));
};
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':