first commit
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useUserStore } from '../../store/user';
|
||||
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const user = userStore.userInfo || {};
|
||||
|
||||
const quickLinks = [
|
||||
{ title: '落丝记录', desc: '缫丝生产 · 落丝管理', icon: 'DataLine', path: '/prod/lsjl', color: '#1e6b52' },
|
||||
{ title: '纤度检验', desc: '纤度 / 野纤等级判定', icon: 'ScaleToOriginal', path: '/prod/xdjy', color: '#c9a54a' },
|
||||
{ title: '黑板检验', desc: '清洁 / 洁净等级', icon: 'Grid', path: '/prod/hbjy', color: '#3f8f6e' },
|
||||
{ title: '考勤打卡', desc: '上下班签到签退', icon: 'AlarmClock', path: '/attendance/punch', color: '#b8873a' }
|
||||
];
|
||||
|
||||
function go(path) { router.push(path); }
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<el-card shadow="never" class="welcome-card">
|
||||
<div class="welcome">
|
||||
<div class="welcome-text">
|
||||
<h2>欢迎回来,{{ user.nickname || user.realName }}!</h2>
|
||||
<p>智慧缫丝系统 · 蚕丝缫制生产数字化管理平台,覆盖落丝、检验、考勤与消息协同。</p>
|
||||
</div>
|
||||
<div class="welcome-info">
|
||||
<div class="info-item">
|
||||
<span class="label">所属部门</span>
|
||||
<span class="value">{{ user.departmentName || '-' }}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">当前角色</span>
|
||||
<span class="value">{{ (user.roles || []).join('、') || '-' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-row :gutter="20" class="stat-row">
|
||||
<el-col v-for="link in quickLinks" :key="link.path" :span="6">
|
||||
<el-card shadow="hover" class="stat-card" @click="go(link.path)">
|
||||
<div class="stat">
|
||||
<el-icon class="stat-icon" :color="link.color"><component :is="link.icon" /></el-icon>
|
||||
<div>
|
||||
<div class="stat-value">{{ link.title }}</div>
|
||||
<div class="stat-label">{{ link.desc }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.welcome-card {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.welcome {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.welcome-text h2 {
|
||||
margin-bottom: 8px;
|
||||
color: #1e3a5f;
|
||||
}
|
||||
|
||||
.welcome-text p {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.welcome-info {
|
||||
display: flex;
|
||||
gap: 40px;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.info-item .label {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.info-item .value {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.stat {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.stat-icon {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user