Files
f9-web-ai-test/web/src/views/dashboard/index.vue
T
yanpeng200212 c3e2665257 生产模块拆分为前缫/后缫;修复菜单卡顿与重复请求;支持 IIS 单站点部署
1. 生产模块按工序拆分为两个一级菜单
   - 生产-前缫(落丝记录)、生产-后缫(纤度检验、黑板检验)
   - 旧的「生产管理」(/prod) 目录及子菜单由种子自动清理,页面组件与权限标识保持不变
   - 消息中心跳转路径、首页快捷入口路径同步更新

2. 职工管理独立为一级菜单(原挂在「基础数据」目录下),并清理历史子菜单

3. 修复侧边栏菜单展开卡顿(基础数据等子项较多的目录尤其明显)
   - 去掉 Element Plus 的 height 过渡动画(会逐帧重排全部子项)
   - 收起时改用 height:0 + visibility:hidden 而非 display:none,子项提前完成布局
   - 菜单区独立滚动并预留滚动条宽度(scrollbar-gutter),消除展开时的横向抖动
   - 菜单项增加 contain 布局隔离,淡入动画改为容器级

4. 修复页面首次打开重复请求
   - 分页组件挂载时会触发一次 current-change,页码未变化时不再重复加载(18 个页面)
   - 职工管理去掉 onMounted 与默认选中部门的重复加载
   - 工种管理、原料庄口的注册表下拉由按 key 多次请求改为一次全量拉取

5. 后端增加前端静态托管与 SPA 路由回退,支持 IIS 单站点部署(前后端同源)
6. 新增部署脚本 deploy-iis.ps1(首次部署)与 update-iis.ps1(更新发布)
2026-10-12 14:09:59 +08:00

126 lines
2.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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/qianxian/lsjl', color: '#1e6b52' },
{ title: '纤度检验', desc: '后缫 · 纤度 / 野纤等级判定', icon: 'ScaleToOriginal', path: '/prod/houxian/xdjy', color: '#c9a54a' },
{ title: '黑板检验', desc: '后缫 · 清洁 / 洁净等级', icon: 'Grid', path: '/prod/houxian/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>