fix: opt page style
This commit is contained in:
@@ -22,6 +22,7 @@ interface CateData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let state = reactive({
|
let state = reactive({
|
||||||
|
trendDays: 30,
|
||||||
basicData: {
|
basicData: {
|
||||||
message_total_num: 0,
|
message_total_num: 0,
|
||||||
hosted_message_total_num: 0,
|
hosted_message_total_num: 0,
|
||||||
@@ -66,7 +67,8 @@ const getTrendStatisticData = async () => {
|
|||||||
// 根据屏幕大小决定请求的天数
|
// 根据屏幕大小决定请求的天数
|
||||||
const isSmallScreen = window.innerWidth < 768;
|
const isSmallScreen = window.innerWidth < 768;
|
||||||
const days = isSmallScreen ? 15 : 30;
|
const days = isSmallScreen ? 15 : 30;
|
||||||
|
state.trendDays = days;
|
||||||
|
|
||||||
const rsp = await request.get(`/statistic?type=trend&days=${days}`);
|
const rsp = await request.get(`/statistic?type=trend&days=${days}`);
|
||||||
if (rsp && rsp.data && rsp.data.code == 200) {
|
if (rsp && rsp.data && rsp.data.code == 200) {
|
||||||
state.trendData = rsp.data.data;
|
state.trendData = rsp.data.data;
|
||||||
@@ -116,7 +118,7 @@ const loadAllStatisticData = async () => {
|
|||||||
|
|
||||||
const renderLineChart = () => {
|
const renderLineChart = () => {
|
||||||
const latestSendData = state.trendData.latest_send_data || [];
|
const latestSendData = state.trendData.latest_send_data || [];
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
@@ -327,9 +329,20 @@ const renderLineChart = () => {
|
|||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
position: 'top',
|
position: 'top',
|
||||||
horizontalAlign: 'center',
|
horizontalAlign: 'right',
|
||||||
offsetY: 0,
|
floating: true,
|
||||||
offsetX: 0
|
offsetY: -20,
|
||||||
|
offsetX: -5,
|
||||||
|
fontSize: '10px',
|
||||||
|
markers: {
|
||||||
|
width: 6,
|
||||||
|
height: 6,
|
||||||
|
radius: 3
|
||||||
|
},
|
||||||
|
itemMargin: {
|
||||||
|
horizontal: 5,
|
||||||
|
vertical: 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
@@ -443,41 +456,16 @@ onMounted(() => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-[90%] mx-auto pt-4 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4">
|
<div class="w-[90%] mx-auto pt-4 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4">
|
||||||
|
|
||||||
<StatCard
|
<StatCard title="托管消息数" :value="state.basicData.hosted_message_total_num" description="" :icon="InboxIcon"
|
||||||
title="托管消息数"
|
route-path="/hostedmessage" />
|
||||||
:value="state.basicData.hosted_message_total_num"
|
<StatCard title="发送日志数" :value="state.basicData.message_total_num" description="" :icon="FileTextIcon"
|
||||||
description=""
|
route-path="/sendlogs" />
|
||||||
:icon="InboxIcon"
|
<StatCard title="今日发送数" :value="state.basicData.today_total_num" description="" :icon="SendIcon"
|
||||||
route-path="/hostedmessage"
|
:route-path="`/sendlogs?query=${encodeURIComponent(JSON.stringify({ day_created_on: getTodayDate() }))}`" />
|
||||||
/>
|
<StatCard title="今日成功数" :value="state.basicData.today_succ_num" description="" :icon="CheckCircleIcon"
|
||||||
<StatCard
|
:route-path="`/sendlogs?query=${encodeURIComponent(JSON.stringify({ status: '1', day_created_on: getTodayDate() }))}`" />
|
||||||
title="发送日志数"
|
<StatCard title="今日失败数" :value="state.basicData.today_failed_num" description="" :icon="XCircleIcon"
|
||||||
:value="state.basicData.message_total_num"
|
:route-path="`/sendlogs?query=${encodeURIComponent(JSON.stringify({ status: '0', day_created_on: getTodayDate() }))}`" />
|
||||||
description=""
|
|
||||||
:icon="FileTextIcon"
|
|
||||||
route-path="/sendlogs"
|
|
||||||
/>
|
|
||||||
<StatCard
|
|
||||||
title="今日发送数"
|
|
||||||
:value="state.basicData.today_total_num"
|
|
||||||
description=""
|
|
||||||
:icon="SendIcon"
|
|
||||||
:route-path="`/sendlogs?query=${encodeURIComponent(JSON.stringify({day_created_on: getTodayDate()}))}`"
|
|
||||||
/>
|
|
||||||
<StatCard
|
|
||||||
title="今日成功数"
|
|
||||||
:value="state.basicData.today_succ_num"
|
|
||||||
description=""
|
|
||||||
:icon="CheckCircleIcon"
|
|
||||||
:route-path="`/sendlogs?query=${encodeURIComponent(JSON.stringify({status: '1', day_created_on: getTodayDate()}))}`"
|
|
||||||
/>
|
|
||||||
<StatCard
|
|
||||||
title="今日失败数"
|
|
||||||
:value="state.basicData.today_failed_num"
|
|
||||||
description=""
|
|
||||||
:icon="XCircleIcon"
|
|
||||||
:route-path="`/sendlogs?query=${encodeURIComponent(JSON.stringify({status: '0', day_created_on: getTodayDate()}))}`"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 折线图 -->
|
<!-- 折线图 -->
|
||||||
@@ -498,7 +486,7 @@ onMounted(() => {
|
|||||||
<Card class="w-full lg:col-span-7">
|
<Card class="w-full lg:col-span-7">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>消息发送趋势</CardTitle>
|
<CardTitle>消息发送趋势</CardTitle>
|
||||||
<CardDescription>最近30天的发送情况统计</CardDescription>
|
<CardDescription>最近{{ state.trendDays }}天的发送情况统计</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div id="sales-chart" class="w-full h-[350px]"></div>
|
<div id="sales-chart" class="w-full h-[350px]"></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user