优化主页数据统计
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="art-card h-105 p-4 box-border mb-5 max-sm:mb-4">
|
||||
<div class="art-card-header">
|
||||
<div class="title">
|
||||
<h4>月度登录汇总</h4>
|
||||
<h4>月度玩家充值汇总</h4>
|
||||
</div>
|
||||
</div>
|
||||
<ArtBarChart
|
||||
@@ -17,22 +17,22 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { fetchLoginBarChart } from '@/api/dashboard'
|
||||
import { fetchRechargeBarChart } from '@/api/dashboard'
|
||||
|
||||
/**
|
||||
* 登录数据
|
||||
* 充值金额数据
|
||||
*/
|
||||
const yData = ref<number[]>([])
|
||||
|
||||
/**
|
||||
* 时间数据
|
||||
* 月份数据
|
||||
*/
|
||||
const xData = ref<string[]>([])
|
||||
|
||||
onMounted(async () => {
|
||||
fetchLoginBarChart().then((data) => {
|
||||
yData.value = data.login_count
|
||||
xData.value = data.login_month
|
||||
fetchRechargeBarChart().then((data: any) => {
|
||||
yData.value = data?.recharge_amount ?? []
|
||||
xData.value = data?.recharge_month ?? []
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user