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