变更首页

This commit is contained in:
砂糖
2025-07-22 16:28:43 +08:00
parent 4422ca9099
commit 93d2618022
9 changed files with 731 additions and 131 deletions

View File

@@ -2,6 +2,14 @@
<template>
<div class="dashboard-root">
<!-- 第一行头像+欢迎语 -->
<div class="user-greeting-row">
<img :src="avatar" class="user-avatar" alt="头像" />
<div class="greeting-text">
<div class="greeting-title">{{ greeting }}{{ name }}</div>
<div class="greeting-desc">愿你天黑有灯下雨有伞</div>
</div>
</div>
<!-- 数据概览区 -->
<div class="data-overview">
<div v-for="(card, index) in dataCards" :key="index"
@@ -22,21 +30,16 @@
<!-- 业务功能区 -->
<div class="business-modules">
<div v-for="(module, index) in businessModules" :key="index"
class="business-module">
<div class="business-module-header">
<div :class="['business-module-icon', getModuleBg(module.bgColor)]">
<i :class="['business-module-icon-inner', module.icon]"></i>
</div>
<div>
<h3 class="business-module-title">{{ module.title }}</h3>
<p class="business-module-desc">{{ module.description }}</p>
</div>
class="business-module" @click="handleLink(module.link)">
<div :class="['business-module-icon', getModuleBg(module.bgColor)]">
<i :class="module.icon"></i>
</div>
<h3 class="business-module-title">{{ module.title }}</h3>
</div>
</div>
<!-- 监控面板 -->
<div class="monitor-panel">
<!-- <div class="monitor-panel">
<div class="monitor-resource">
<h3 class="monitor-title">系统资源监控</h3>
<div class="monitor-resource-charts">
@@ -60,38 +63,48 @@
</div>
</div>
</div>
</div>
</div> -->
<!-- 全部应用 -->
<AllApplications />
</div>
</template>
<script>
import * as echarts from 'echarts';
import AllApplications from '@/views/components/AllApplications.vue';
export default {
components: {
AllApplications
},
data() {
return {
avatar: '',
name: '',
greeting: '',
dataCards: [
{
title: '订单总量',
value: '2,384',
icon: 'fas fa-shopping-cart',
color: 'text-blue-500',
chartData: [30, 40, 20, 50, 40, 60, 70]
chartData: [30, 40, 20, 50, 40, 60, 70],
},
{
title: '库存总量',
value: '12,857',
icon: 'fas fa-box',
color: 'text-green-500',
chartData: [40, 30, 50, 40, 60, 50, 70]
},
{
title: '今日任务',
value: '48',
icon: 'fas fa-tasks',
color: 'text-yellow-500',
chartData: [20, 40, 30, 50, 40, 60, 50]
chartData: [40, 30, 50, 40, 60, 50, 70],
},
// {
// title: '今日任务',
// value: '48',
// icon: 'fas fa-tasks',
// color: 'text-yellow-500',
// chartData: [20, 40, 30, 50, 40, 60, 50],
// },
{
title: '系统状态',
value: '正常',
@@ -105,37 +118,43 @@ export default {
title: '仓库管理',
description: '库存管理与货位管理',
icon: 'fas fa-warehouse',
bgColor: 'bg-blue-500'
bgColor: 'bg-blue-500',
link: '/wms/stock'
},
{
title: '订单处理',
description: '订单审核与发货管理',
icon: 'fas fa-clipboard-check',
bgColor: 'bg-green-500'
bgColor: 'bg-green-500',
link: '/wms/order'
},
{
title: '人员管理',
description: '员工信息与权限管理',
icon: 'fas fa-users',
bgColor: 'bg-yellow-500'
bgColor: 'bg-yellow-500',
link: '/system/user'
},
{
title: '数据分析',
description: '业务数据可视化分析',
title: '订单分析',
description: '订单数据可视化分析',
icon: 'fas fa-chart-line',
bgColor: 'bg-purple-500'
bgColor: 'bg-purple-500',
link: '/wms/order/dashboard'
},
{
title: '设备管理',
description: '仓储设备维护管理',
title: '出库入库',
description: '出库入库管理',
icon: 'fas fa-tools',
bgColor: 'bg-red-500'
bgColor: 'bg-red-500',
link: '/wms/stcokIo'
},
{
title: '系统设置',
description: '系统参数配置管理',
icon: 'fas fa-cog',
bgColor: 'bg-indigo-500'
bgColor: 'bg-indigo-500',
link: '/system/setting'
}
],
resourceCharts: [
@@ -181,6 +200,9 @@ export default {
mounted() {
this.initCharts();
this.initResourceCharts();
this.avatar = this.$store.getters.avatar;
this.name = this.$store.getters.name;
this.greeting = this.getGreeting();
},
methods: {
getIconColor(color) {
@@ -193,6 +215,19 @@ export default {
default: return '';
}
},
handleLink(item) {
this.$router.push(item);
},
getGreeting() {
const hour = new Date().getHours();
if (hour < 6) return '凌晨好';
if (hour < 9) return '早上好';
if (hour < 12) return '上午好';
if (hour < 14) return '中午好';
if (hour < 18) return '下午好';
if (hour < 21) return '晚上好';
return '夜深了';
},
getModuleBg(bgColor) {
switch (bgColor) {
case 'bg-blue-500': return 'bg-blue';
@@ -376,37 +411,36 @@ export default {
.business-modules {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(6, 1fr);
gap: 24px;
margin-bottom: 32px;
}
.business-module {
padding: 24px;
border-radius: 16px;
background: linear-gradient(135deg, #fff 0%, #f3f4f6 100%);
box-shadow: 0 4px 24px 0 rgba(0,0,0,0.06);
border: 1px solid rgba(255,255,255,0.2);
transition: box-shadow 0.2s;
display: flex;
align-items: center;
padding: 16px;
border-radius: 12px;
background: #fff;
box-shadow: 0 2px 12px 0 rgba(0,0,0,0.05);
transition: all 0.2s;
cursor: pointer;
}
.business-module:hover {
box-shadow: 0 8px 32px 0 rgba(0,0,0,0.10);
}
.business-module-header {
display: flex;
align-items: center;
gap: 16px;
box-shadow: 0 4px 16px 0 rgba(0,0,0,0.1);
transform: translateY(-2px);
}
.business-module-icon {
width: 48px;
height: 48px;
border-radius: 50%;
width: 40px;
height: 40px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-right: 12px;
}
.business-module-icon-inner {
font-size: 24px;
.business-module-icon i {
font-size: 20px;
color: #fff;
}
.bg-blue { background: #3b82f6; }
@@ -416,13 +450,9 @@ export default {
.bg-red { background: #ef4444; }
.bg-indigo { background: #6366f1; }
.business-module-title {
font-size: 18px;
font-size: 16px;
font-weight: 500;
margin-bottom: 4px;
}
.business-module-desc {
color: #6b7280;
font-size: 14px;
color: #303133;
}
.monitor-panel {
@@ -485,5 +515,41 @@ export default {
font-size: 12px;
color: #6b7280;
}
.user-greeting-row {
display: flex;
align-items: center;
gap: 24px;
margin-bottom: 24px;
}
.user-avatar {
width: 80px;
height: 80px;
border-radius: 50%;
object-fit: cover;
border: 2px solid #e0e0e0;
background: #fff;
}
.greeting-text {
display: flex;
flex-direction: column;
justify-content: center;
}
.greeting-title {
font-size: 28px;
font-weight: 600;
color: #333;
}
.greeting-desc {
font-size: 16px;
color: #888;
margin-top: 4px;
}
</style>
<style>
.business-module-header,
.business-module-icon-inner,
.business-module-desc {
display: none;
}
</style>