master
shilei 2 weeks ago
parent 303cb2e396
commit a410656e26

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

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

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

Loading…
Cancel
Save