Files
JayuCloud/Frontend/src/views/admin/DashboardView.vue
T
2026-02-25 10:37:16 +08:00

166 lines
4.1 KiB
Vue

<template>
<div class="dashboard">
<a-page-header title="仪表盘" sub-title="欢迎使用后台管理系统" />
<a-row :gutter="16" class="stat-cards">
<a-col :span="6">
<a-card>
<a-statistic
title="总用户数"
:value="128"
:value-style="{ color: '#3f8600' }"
>
<template #prefix>
<UserOutlined />
</template>
</a-statistic>
</a-card>
</a-col>
<a-col :span="6">
<a-card>
<a-statistic
title="商品总数"
:value="56"
:value-style="{ color: '#1890ff' }"
>
<template #prefix>
<ShopOutlined />
</template>
</a-statistic>
</a-card>
</a-col>
<a-col :span="6">
<a-card>
<a-statistic
title="店铺数量"
:value="8"
:value-style="{ color: '#722ed1' }"
>
<template #prefix>
<HomeOutlined />
</template>
</a-statistic>
</a-card>
</a-col>
<a-col :span="6">
<a-card>
<a-statistic
title="今日订单"
:value="24"
:value-style="{ color: '#cf1322' }"
>
<template #prefix>
<ShoppingOutlined />
</template>
</a-statistic>
</a-card>
</a-col>
</a-row>
<a-row :gutter="16" class="charts-section">
<a-col :span="16">
<a-card title="订单趋势" :bordered="false" class="chart-card">
<div class="chart-placeholder">
<BarChartOutlined :style="{ fontSize: '64px', color: '#d9d9d9' }" />
<p>订单趋势图表</p>
</div>
</a-card>
</a-col>
<a-col :span="8">
<a-card title="热门商品" :bordered="false" class="chart-card">
<a-list :data-source="hotProducts" size="small">
<template #renderItem="{ item }">
<a-list-item>
<a-list-item-meta>
<template #title>
<a href="#">{{ item.name }}</a>
</template>
<template #description>
销量: {{ item.sales }}
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
</a-card>
</a-col>
</a-row>
<a-card title="最近活动" :bordered="false" class="activity-card">
<a-timeline>
<a-timeline-item color="green">
<p>用户张三完成了订单 #1024</p>
<p style="font-size: 12px; color: #999;">2小时前</p>
</a-timeline-item>
<a-timeline-item color="blue">
<p>新品"星空美甲"已上架</p>
<p style="font-size: 12px; color: #999;">5小时前</p>
</a-timeline-item>
<a-timeline-item color="red">
<p>店铺"时尚美甲店"信息已更新</p>
<p style="font-size: 12px; color: #999;">昨天</p>
</a-timeline-item>
<a-timeline-item>
<p>新用户李四注册成功</p>
<p style="font-size: 12px; color: #999;">2天前</p>
</a-timeline-item>
</a-timeline>
</a-card>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import {
UserOutlined,
ShopOutlined,
HomeOutlined,
ShoppingOutlined,
BarChartOutlined
} from '@ant-design/icons-vue'
const hotProducts = ref([
{ name: '法式美甲', sales: 156 },
{ name: '星空美甲', sales: 132 },
{ name: '渐变美甲', sales: 98 },
{ name: '贴钻美甲', sales: 87 },
{ name: '纯色美甲', sales: 65 }
])
</script>
<style scoped>
.dashboard {
padding: 0;
}
.stat-cards {
margin-bottom: 24px;
}
.charts-section {
margin-bottom: 24px;
}
.chart-card {
height: 400px;
}
.chart-placeholder {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 300px;
color: #999;
}
.chart-placeholder p {
margin-top: 16px;
font-size: 14px;
}
.activity-card {
margin-top: 24px;
}
</style>