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

View File

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

View File

@@ -2,7 +2,7 @@
<view class="about-container">
<!-- 顶部 Logo 区域 -->
<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="version">版本 {{ version }}</text>
</view>

View File

@@ -28,7 +28,7 @@ const gridList = reactive([
title: "系统管理",
children: [
{
icon: "/static/icons/user1.png",
icon: "/static/icons/user.png",
title: "用户管理",
url: "/pages/work/user/index",
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