From ba7e41c78eeb62363977ea74ff81cbd1ffe97a18 Mon Sep 17 00:00:00 2001
From: ray <1490493387@qq.com>
Date: Tue, 26 Nov 2024 22:20:45 +0800
Subject: [PATCH] =?UTF-8?q?style:=20:lipstick:=20=E7=AE=80=E5=8C=96?=
=?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/dashboard/index.vue | 63 ++++++++---------------------------
1 file changed, 14 insertions(+), 49 deletions(-)
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index 512c23d5..88a5191d 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -16,20 +16,6 @@
-
-
-
-
-
-
-
- {{ item.title }}
-
-
- /100
-
-
-
@@ -167,6 +153,18 @@ import { useUserStore } from "@/store/modules/user";
import StatsAPI, { VisitStatsVO } from "@/api/system/log";
import NoticeAPI, { NoticePageVO } from "@/api/system/notice";
+interface VisitStats {
+ title: string;
+ icon: string;
+ tagType: "primary" | "success" | "warning";
+ growthRate: number;
+ // 粒度
+ granularity: string;
+ // 今日数量
+ todayCount: number;
+ totalCount: number;
+}
+
const noticeDetailRef = ref();
const userStore = useUserStore();
@@ -186,44 +184,11 @@ const greetings = computed(() => {
}
});
-// 右上角数量
-const statisticData = ref([
- {
- value: 99,
- iconClass: "message",
- title: "消息",
- key: "message",
- },
- {
- value: 50,
- iconClass: "todo",
- title: "待办",
- suffix: "/100",
- key: "upcoming",
- },
- {
- value: 10,
- iconClass: "project",
- title: "项目",
- key: "project",
- },
-]);
-
const onlineUserCount = ref(0);
const visitStatsLoading = ref(true);
const visitStatsList = ref(Array(3).fill({}));
-interface VisitStats {
- title: string;
- icon: string;
- tagType: "primary" | "success" | "warning";
- growthRate: number;
- // 粒度
- granularity: string;
- // 今日数量
- todayCount: number;
- totalCount: number;
-}
+
// 加载访问统计数据
const loadVisitStatsData = async () => {
const list: VisitStatsVO[] = await StatsAPI.getVisitStats();
@@ -244,7 +209,7 @@ const loadVisitStatsData = async () => {
}
};
-/** 格式化增长率 */
+// 格式化增长率
const formatGrowthRate = (growthRate: number): string => {
if (growthRate === 0) {
return "-";