edit
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
<st #st [data]="url" [columns]="columns"
|
||||
<st #st [data]="url" [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' } }"
|
||||
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
|
||||
|
||||
@ -1,28 +1,48 @@
|
||||
import { CurrencyPipe } from '@angular/common';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STComponent, STColumn, STRequestOptions } from '@delon/abc/st';
|
||||
import { BaseService } from '../../services';
|
||||
|
||||
@Component({
|
||||
selector: 'app-account-detail',
|
||||
templateUrl: './account-detail.component.html'
|
||||
templateUrl: './account-detail.component.html',
|
||||
providers:[CurrencyPipe]
|
||||
})
|
||||
export class AccountDetailComponent implements OnInit {
|
||||
@ViewChild('st', { static: true })
|
||||
st!: STComponent;
|
||||
columns: STColumn[] = [
|
||||
{ title: '网络货运人', index: 'phone' },
|
||||
{ title: '平安账户余额', index: 'ltdName' },
|
||||
{ title: '浦发账户余额', index: 'bankTypeLabel' }
|
||||
];
|
||||
columns: STColumn[] = [];
|
||||
|
||||
url = '';
|
||||
|
||||
isCanCreate = false;
|
||||
constructor(public service: BaseService) {}
|
||||
constructor(public service: BaseService, private currencyPipe: CurrencyPipe) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
ngOnInit(): void {
|
||||
setTimeout(() => {
|
||||
this.initST();
|
||||
}, 200);
|
||||
}
|
||||
|
||||
beforeReq = (requestOptions: STRequestOptions) => {
|
||||
return requestOptions;
|
||||
};
|
||||
|
||||
initST() {
|
||||
this.columns = [
|
||||
{ title: '网络货运人', index: 'phone', className: 'text-center' },
|
||||
{
|
||||
title: '平安账户余额',
|
||||
index: 'ltdName',
|
||||
type: 'currency',
|
||||
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
|
||||
},
|
||||
{
|
||||
title: '浦发账户余额',
|
||||
index: 'bankTypeLabel',
|
||||
type: 'currency',
|
||||
format: item => `${this.currencyPipe.transform(item.availableBalance)}`
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user