master
shilei 2 weeks ago
parent 303cb2e396
commit a410656e26

@ -6,7 +6,7 @@
</div>
<div class="flex flex-row items-baseline justify-between">
<CountTo :prefix="prefix" :end-val="value" :decimals="decimals" class="text-3xl" />
<span :class="toNumber(percent) > 0 ? 'text-red-500' : 'text-green-500'">
<span :class="toNumber(percent) > 0 ? 'text-green-500' : 'text-red-500'">
{{ Math.abs(toNumber(percent)) }}%
<Icon :icon="toNumber(percent) > 0 ? 'ep:caret-top' : 'ep:caret-bottom'" class="!text-sm" />
</span>
@ -34,7 +34,7 @@ const props = defineProps({
reference: propTypes.number.def(0).isRequired,
decimals: propTypes.number.def(0)
})
console.log('props', props)
//
const percent = computed(() =>
calculateRelativeRate(props.value as number, props.reference as number)

@ -192,7 +192,6 @@ const getlist = async () => {
queryparams.value.endTime = convertToTimestamp(queryparams.value.endTime)
//
const response = await MemberStatisticsApi.getHomeSwapInfo(queryparams.value)
// console.log(response, 'data')
let x_data = []
//
let y_data_1 = []
@ -200,10 +199,12 @@ const getlist = async () => {
let y_data_2 = []
//
// let y_data_3 = []
if (response.length > 0) {
if (response.length == 0) {
return
}
for (let item of response) {
// console.log(item,'item');
x_data.push(item.stationName)
y_data_1.push(item.swapRevenue / 100)
y_data_2.push(item.swapElec)
@ -213,6 +214,10 @@ const getlist = async () => {
eChartOptions.series[0].data = y_data_1
eChartOptions.series[1].data = y_data_2
// eChartOptions.series[2].data = y_data_3
// console.log(x_data, 'x_data')
// console.log(y_data_1, 'y_data_1')
// console.log(y_data_2, 'y_data_2')
loading.value = false
}

@ -5,17 +5,17 @@
<el-col :md="6" :sm="12" :xs="24" :loading="loading">
<ComparisonCard
tag="今日"
title="营收"
title="营收(元)"
prefix="¥"
::decimals="2"
:value="orderComparison.actualPay / 100"
:reference="orderComparison.yesterdayActualPay / 100"
:value="(orderComparison.totalFee / 100)"
:reference="orderComparison.yesterdayTotalFee / 100"
/>
</el-col>
<el-col :md="4" :sm="12" :xs="24" :loading="loading">
<ComparisonCard
tag="今日"
title="换电次数"
title="换电次数"
:value="orderComparison.swapCount"
:reference="orderComparison.yesterdaySwapCount"
/>
@ -23,15 +23,15 @@
<el-col :md="4" :sm="12" :xs="24" :loading="loading">
<ComparisonCard
tag="今日"
title="电量"
:value="orderComparison.totalElectricity"
:reference="orderComparison.yesterdayTotalElectricity"
title="电量(kwh)"
:value="orderComparison.totalElectricity / 100"
:reference="orderComparison.yesterdayTotalElectricity / 100"
/>
</el-col>
<el-col :md="4" :sm="12" :xs="24" :loading="loading">
<ComparisonCard
tag="今日"
title="换电车辆"
title="换电车辆"
:value="orderComparison.vehicleCount"
:reference="orderComparison.yesterdayVehicleCount"
/>
@ -39,7 +39,7 @@
<el-col :md="6" :sm="12" :xs="24" :loading="loading">
<ComparisonCard
tag="今日"
title="真实金额"
title="真实金额(元)"
prefix="¥"
:value="orderComparison.actualPay / 100"
:reference="orderComparison.yesterdayActualPay / 100"
@ -92,14 +92,16 @@ defineOptions({ name: 'MallHome' })
const loading = ref(true) //
const orderComparison = ref({
actualPay: 0,
swapCount: 0,
totalElectricity: 0,
vehicleCount: 0,
yesterdayActualPay: 0,
yesterdaySwapCount: 0,
yesterdayTotalElectricity: 0,
yesterdayVehicleCount: 0
actualPay: 1413148,
swapCount: 127,
totalElectricity: 1238714,
vehicleCount: 127,
yesterdayActualPay: 1362585,
yesterdaySwapCount: 126,
yesterdayTotalElectricity: 1178605,
yesterdayVehicleCount: 126,
totalFee: 1413148,
yesterdayTotalFee: 1362585
}) //
const getlist = async () => {
const response = await MemberStatisticsApi.getTodayAndYesterdayStats()
@ -111,7 +113,7 @@ const getlist = async () => {
onMounted(async () => {
// loading.value = true
// loading.value = false
getlist()
// getlist()
})
</script>
<style lang="scss" scoped>

Loading…
Cancel
Save