refactor: ♻️ 优化图标和LOGO

This commit is contained in:
Ray.Hao
2024-12-08 21:05:20 +08:00
parent 1cdec3e5ea
commit 4f1969fe6f
20 changed files with 40 additions and 67 deletions

View File

@@ -37,7 +37,7 @@ const LogAPI = {
* @returns * @returns
*/ */
getVisitStats() { getVisitStats() {
return request<VisitStatsVO[]>({ return request<VisitStatsVO>({
url: `${LOG_BASE_URL}/visit-stats`, url: `${LOG_BASE_URL}/visit-stats`,
method: "GET", method: "GET",
}); });
@@ -108,17 +108,16 @@ export interface VisitTrendQuery {
/** 访问统计 */ /** 访问统计 */
export interface VisitStatsVO { export interface VisitStatsVO {
/** 标题 */ /** 今日访客数(UV) */
title: string; todayUvCount: number;
/** 类型 */ /** 总访客数 */
type: "pv" | "uv" | "ip"; totalUvCount: number;
/** 访客数同比增长率(相对于昨天同一时间段的增长率) */
/** 今日访问量 */ uvGrowthRate: number;
todayCount: number; /** 今日浏览量(PV) */
/** 总访问量 */ todayPvCount: number;
totalCount: number; /** 总浏览量 */
totalPvCount: number;
/** 同比增长率(相对于昨天同一时间段的增长率) */ /** 同比增长率(相对于昨天同一时间段的增长率) */
growthRate: number; pvGrowthRate: number;
totalCountOutput: number;
} }

View File

@@ -40,18 +40,24 @@
<!-- 数据统计 --> <!-- 数据统计 -->
<wd-grid :column="2" :gutter="2"> <wd-grid :column="2" :gutter="2">
<wd-grid-item <wd-grid-item use-slot custom-class="custom-item">
v-for="(item, index) in visitStatsData"
:key="index"
use-slot
custom-class="custom-item"
>
<view class="flex justify-start pl-5"> <view class="flex justify-start pl-5">
<view class="flex-center"> <view class="flex-center">
<image class="w-80rpx h-80rpx rounded-8rpx" :src="item.icon" /> <image class="w-80rpx h-80rpx rounded-8rpx" src="/static/icons/visitor.png" />
<view class="ml-5 text-left"> <view class="ml-5 text-left">
<view class="font-bold">{{ item.title }}</view> <view class="font-bold">访客数</view>
<view class="mt-2">{{ item.todayCount }}</view> <view class="mt-2">{{ visitStatsData.todayUvCount }}</view>
</view>
</view>
</view>
</wd-grid-item>
<wd-grid-item use-slot custom-class="custom-item">
<view class="flex justify-start pl-5">
<view class="flex-center">
<image class="w-80rpx h-80rpx rounded-8rpx" src="/static/icons/browser.png" />
<view class="ml-5 text-left">
<view class="font-bold">浏览量</view>
<view class="mt-2">{{ visitStatsData.todayPvCount }}</view>
</view> </view>
</view> </view>
</view> </view>
@@ -111,40 +117,14 @@ interface VisitStats {
const current = ref<number>(0); const current = ref<number>(0);
const visitStatsData = ref<VisitStats[] | null>([ const visitStatsData = ref<VisitStatsVO>({
{ todayUvCount: 0,
type: "online", uvGrowthRate: 0,
title: "在线用户数", totalUvCount: 0,
icon: "/static/icons/user2.png", todayPvCount: 0,
growthRate: 0, pvGrowthRate: 0,
granularity: "-", totalPvCount: 0,
todayCount: 1, });
},
{
type: "pv",
title: "浏览量(PV)",
icon: "/static/icons/stat1.png",
growthRate: 0,
granularity: "日",
todayCount: 0,
},
{
type: "uv",
title: "访客数(UV)",
icon: "/static/icons/visitor.png",
growthRate: 0,
granularity: "日",
todayCount: 0,
},
{
type: "ip",
title: "访问IP数",
icon: "/static/icons/stat4.png",
growthRate: 0,
granularity: "日",
todayCount: 0,
},
]);
// 图表数据 // 图表数据
const chartData = ref({}); const chartData = ref({});
@@ -157,7 +137,7 @@ const swiperList = ref(["https://oss.youlai.tech/blog/banner9.png"]);
// 快捷导航列表 // 快捷导航列表
const navList = reactive([ const navList = reactive([
{ {
icon: "/static/icons/user1.png", icon: "/static/icons/user.png",
title: "用户管理", title: "用户管理",
url: "/pages/work/user/index", url: "/pages/work/user/index",
prem: "sys:user:query", prem: "sys:user:query",
@@ -191,14 +171,8 @@ function onChange(e: any) {
// 加载访问统计数据 // 加载访问统计数据
const loadVisitStatsData = async () => { const loadVisitStatsData = async () => {
const list: VisitStatsVO[] = await LogAPI.getVisitStats(); LogAPI.getVisitStats().then((data) => {
visitStatsData.value = data;
visitStatsData.value?.forEach((item) => {
const data = list.find((v) => v.type === item.type);
if (data) {
item.todayCount = data.todayCount;
item.growthRate = data.growthRate;
}
}); });
}; };

View File

@@ -2,7 +2,7 @@
<view class="about-container"> <view class="about-container">
<!-- 顶部 Logo 区域 --> <!-- 顶部 Logo 区域 -->
<view class="logo-section"> <view class="logo-section">
<image class="logo" src="/static/images/logo.png" mode="aspectFit" /> <image class="logo" src="/static/logo.png" mode="aspectFit" />
<text class="app-name">vue-uniapp-template</text> <text class="app-name">vue-uniapp-template</text>
<text class="version">版本 {{ version }}</text> <text class="version">版本 {{ version }}</text>
</view> </view>

View File

@@ -28,7 +28,7 @@ const gridList = reactive([
title: "系统管理", title: "系统管理",
children: [ children: [
{ {
icon: "/static/icons/user1.png", icon: "/static/icons/user.png",
title: "用户管理", title: "用户管理",
url: "/pages/work/user/index", url: "/pages/work/user/index",
prem: "sys:user:query", prem: "sys:user:query",

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB