feat: 大屏改为纯流式自适应布局,新增KPI带与产线动态拓扑地图

This commit is contained in:
SunYF
2026-10-28 10:10:17 +08:00
parent 1f10c3091e
commit 4d3c4e2c3a
131 changed files with 18118 additions and 1728 deletions
@@ -45,6 +45,13 @@
</el-button>
</el-tooltip>
</el-badge>
<el-badge :hidden="!archiveOverdue" is-dot class="alert-badge">
<el-tooltip content="数据归档清理提醒:距上次成功备份已超期" placement="bottom">
<el-button class="alert-btn" text @click="goDataArchive">
<el-icon :size="18" :class="{ 'alert-ring': archiveOverdue }"><AlarmClock /></el-icon>
</el-button>
</el-tooltip>
</el-badge>
<el-button class="help-btn" text @click="openHelp">帮助</el-button>
<el-dropdown trigger="click" @command="onUserCmd">
<span class="user-name">{{ userName }} <span class="caret">▾</span></span>
@@ -70,9 +77,9 @@ import { useRouter } from 'vue-router'
import {
Document, Calendar, Box, Goods, ShoppingCart, Monitor, Tools,
Operation, Link, DataLine, Search, CircleCheck, Clock, User,
Key, Fold, Expand, Warning, Paperclip, Tickets, Bell, Setting, Van
Key, Fold, Expand, Warning, Paperclip, Tickets, Bell, Setting, Van, AlarmClock
} from '@element-plus/icons-vue'
import { ElNotification } from 'element-plus'
import { ElNotification, ElMessageBox } from 'element-plus'
import { getUser, logout } from '../utils/auth'
import request from '../utils/request'
@@ -166,6 +173,7 @@ const menuGroups = [
{ code: 'sys.alert', name: '预警中心', path: '/alert-center', icon: Warning },
{ code: 'sys.alertrule', name: '预警规则', path: '/alert-rule', icon: Setting },
{ code: 'sys.attachment', name: '附件中心', path: '/attachment', icon: Paperclip },
{ code: 'sys.backup', name: '数据归档', path: '/data-archive', icon: Tools },
{ code: 'sys.settings', name: '基础设置', path: '/settings', icon: Setting }
]
}
@@ -201,8 +209,35 @@ onMounted(async () => {
// 顶部预警铃铛:立即拉一次未读数,随后每 30s 轮询
pollAlerts()
alertTimer = setInterval(pollAlerts, 30000)
// 数据归档清理提醒:登录后拉取,超期则强提醒(每天一次)
checkArchiveReminder()
})
// ===== 数据归档清理提醒:登录后检查,超期弹强提醒 + 顶栏角标 =====
// 仅依赖 backup_record 真实数据;localStorage 只记“当天已弹过”,每天最多一次。
const archiveOverdue = ref(false)
async function checkArchiveReminder() {
try {
const r = await request.get('/backup/reminder')
if (!r || !r.overdue) {
archiveOverdue.value = false
return
}
archiveOverdue.value = true
const todayKey = new Date().toISOString().slice(0, 10)
const shown = localStorage.getItem('mes_archive_remind_shown') || ''
if (shown === todayKey) return // 当天已弹过
localStorage.setItem('mes_archive_remind_shown', todayKey)
ElMessageBox.alert(
`距上次成功备份已超过 ${r.remindDays} 天,建议清理旧数据以释放空间。\n请先在「数据归档」页确认 U 盘备份完整,再手动清理(仅提醒,不自动删除)。`,
'数据归档清理提醒',
{ type: 'warning', confirmButtonText: '我知道了', showClose: false }
).catch(() => {})
} catch { /* ignore */ }
}
// ===== 顶部预警铃铛(plan 4.10):未读角标 + 30s 轮询 + 新增弹提示 =====
const unreadAlerts = ref(0)
let alertTimer = null
@@ -231,6 +266,10 @@ function goAlertCenter() {
router.push('/alert-center')
}
function goDataArchive() {
router.push('/data-archive')
}
function doLogout() {
// 尽力通知后端记录"退出登录"操作日志,失败不阻塞本地退出
request.post('/logout').catch(() => {})