ControlAuction.vue
3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
<auction-base-info :auction="auction" :controllable="controllable" @add-vehicles="reloadAuction"></auction-base-info>
<a-card :bordered="false" size="small" class="mt-10">
<template #title>
拍卖实时统计
</template>
<template #extra>
最后更新时间:{{ currentTime }}
<a-button type="text" class="mr-10" @click="reloadAuction">
<template #icon>
<ReloadOutlined/>
</template>
</a-button>
</template>
<a-row :gutter="16" class="mt-10 mb-12">
<a-col :span="5">
<a-card class="stat-card">
<a-statistic title="围观人数" :value="auction?.browsingCount" :precision="0" suffix="人"></a-statistic>
</a-card>
</a-col>
<a-col :span="5">
<a-card class="stat-card">
<a-statistic title="参拍人数" :value="auction?.accountCount??0" :precision="0" suffix="人"></a-statistic>
</a-card>
</a-col>
<a-col :span="5">
<a-card class="stat-card">
<a-statistic title="总出价次数" :value="auction?.bidCount??0" :precision="0" suffix="次"></a-statistic>
</a-card>
</a-col>
<a-col :span="5">
<a-card class="stat-card">
<a-statistic title="当前中拍总额" :value="auction?.transactionVolume" :precision="0" suffix="元" prefix="¥"></a-statistic>
</a-card>
</a-col>
<a-col :span="4">
<a-card class="stat-card">
<a-statistic title="中拍率" :value="(auction?.auctionedCount/auction?.vehicleCount)*100" :precision="2" suffix="%"></a-statistic>
</a-card>
</a-col>
</a-row>
</a-card>
<auction-vehicle-page ref="auctionVehiclePage" v-sec="'control_15'" :auction-id="auctionId" :auction="auction"></auction-vehicle-page>
</template>
<script lang="ts">
import {Component, Ref, Vue} from "vue-facing-decorator";
import {Auction} from "lib/src/entity/auction/entity/Auction";
import {AuctionController} from "@/api/AuctionController";
import AuctionVehiclePage from "@/views/auction/control/AuctionVehiclePage.vue";
import AuctionBaseInfo from "@/views/auction/auction/AuctionBaseInfo.vue";
import {ReloadOutlined} from "@ant-design/icons-vue";
import dayjs from "dayjs";
import VehicleDrawer from "@/views/vehicle/inventory/VehicleDrawer.vue";
@Component({
components: {VehicleDrawer, AuctionBaseInfo, AuctionVehiclePage, ReloadOutlined}
})
export default class ControlAuction extends Vue {
auctionId: any;
auction: Auction | null = null;
currentTime = null;
@Ref("auctionVehiclePage")
auctionVehiclePage: any;
created(): void {
this.auctionId = Number(this.$route.query.auctionId);
this.reloadAuction();
}
reloadAuction(): void {
AuctionController.getAuctionInfoById(this.axios, this.auctionId).then(response => {
this.auction = response.data;
this.currentTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
});
if (this.auctionVehiclePage) {
this.auctionVehiclePage.pageRefresh();
}
}
get controllable(): boolean {
if (!this.auction) {
return false;
}
return this.auction.auctionState === 'WAIT_AUCTION' || this.auction.auctionState === 'PREVIEW' || this.auction.auctionState === 'AUCTIONING';
}
}
</script>
<style scoped lang="ts">
</style>