Commit 51b1a70b by zhangxw

参拍车辆管理tab数量修复

1 parent c2219ba8
......@@ -89,6 +89,13 @@ export class VehicleController{
return axios.post('vehicle/vehicleStateCount', params);
}
/**
* 参拍车辆管理tab统计数据
*/
static getVehicleAllStateCount(axios:AxiosStatic, params: any): Promise<AxiosResponse<any>> {
return axios.post('vehicle/vehicleAllStateCount', params);
}
/**
*/
static getVehicleCountByStateAndDateRange(axios:AxiosStatic, startDate: Dayjs | string, endDate: Dayjs | string): Promise<AxiosResponse<any>> {
......
......@@ -114,12 +114,11 @@ export default class AuctionVehiclePage extends PaginationComponent<Vehicle> {
get tabs() {
let total = 0;
for (const vehicleState of this.vehicleStates) {
total = total + (this.vehicleCount[vehicleState] ?? 0);
total = total + (this.vehicleCount?.stateCountMap[vehicleState] ?? 0);
}
const tabs = [{key: '', tab: `全部(${total})`}];
this.vehicleStates.forEach(item => {
tabs.push({key: item, tab: this.$t('enum.vehicle.vehicleState.' + item) + `(${this.vehicleCount[item] ?? 0})`});
tabs.push({key: item, tab: this.$t('enum.vehicle.vehicleState.' + item) + `(${this.vehicleCount?.stateCountMap[item] ?? 0})`});
});
return tabs;
}
......@@ -139,8 +138,9 @@ export default class AuctionVehiclePage extends PaginationComponent<Vehicle> {
}
loadVehicleCount() {
VehicleController.getVehicleCountByState(this.axios).then(res => {
this.vehicleCount = res.data;
VehicleController.getVehicleAllStateCount(this.axios, this.pagination.requestParams).then(res => {
console.log(res.data?.data)
this.vehicleCount = res.data.data;
});
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!