feat: 大屏改为纯流式自适应布局,新增KPI带与产线动态拓扑地图
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onBeforeUnmount, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {
|
||||
HomeFilled, Download, Upload, Search, CircleCheck, List, Bell,
|
||||
Box, Monitor, EditPen, Fold, Expand, Location, Goods, Key, Operation, Van, Clock, RefreshLeft, Folder, WarningFilled
|
||||
Box, Monitor, EditPen, Fold, Expand, Location, Goods, Key, Operation, Van, Clock, RefreshLeft, Folder, WarningFilled, Tools, Setting, AlarmClock
|
||||
} from '@element-plus/icons-vue'
|
||||
import { getUser, getToken, logout, setSession } from '../utils/auth'
|
||||
import request from '../utils/request'
|
||||
@@ -63,7 +63,37 @@ onMounted(() => {
|
||||
onScreenChange()
|
||||
window.addEventListener('resize', onScreenChange)
|
||||
loadMe()
|
||||
// 数据归档清理提醒:登录后拉取,超期弹强提醒 + 顶栏常驻角标(每天一次)
|
||||
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('wms_archive_remind_shown') || ''
|
||||
if (shown === todayKey) return // 当天已弹过
|
||||
localStorage.setItem('wms_archive_remind_shown', todayKey)
|
||||
ElMessageBox.alert(
|
||||
`距上次成功备份已超过 ${r.remindDays} 天,建议清理旧数据以释放空间。\n请先在「数据归档」页确认 U 盘备份完整,再手动清理(仅提醒,不自动删除)。`,
|
||||
'数据归档清理提醒',
|
||||
{ type: 'warning', confirmButtonText: '我知道了', showClose: false }
|
||||
).catch(() => {})
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
|
||||
function goDataArchive() {
|
||||
router.push('/data-archive')
|
||||
}
|
||||
onBeforeUnmount(() => window.removeEventListener('resize', onScreenChange))
|
||||
|
||||
// 侧栏菜单:按业务域分组。分组无权限码,子项各自带 code(无 code 的常驻),
|
||||
@@ -100,7 +130,9 @@ const menuGroups = [
|
||||
{ path: '/users', title: '账号管理', icon: EditPen, code: 'user:manage' },
|
||||
{ path: '/roles', title: '角色管理', icon: Key, code: 'role:manage' },
|
||||
{ path: '/event-log', title: '操作日志', icon: Clock, code: 'eventlog:manage' },
|
||||
{ path: '/attachment', title: '附件中心', icon: Folder, code: 'attachment:view' }
|
||||
{ path: '/attachment', title: '附件中心', icon: Folder, code: 'attachment:view' },
|
||||
{ path: '/data-archive', title: '数据归档', icon: Tools, code: 'backup:manage' },
|
||||
{ path: '/settings', title: '基础设置', icon: Setting, code: 'sys.settings:view' }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -209,6 +241,13 @@ function openDisplay() {
|
||||
<span class="title">{{ pageTitle }}</span>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
<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 text type="primary" @click="openDisplay">
|
||||
<el-icon style="margin-right:4px"><Monitor /></el-icon>免登录大屏
|
||||
</el-button>
|
||||
@@ -256,6 +295,18 @@ function openDisplay() {
|
||||
.collapse-btn:hover { color: #1668dc; }
|
||||
.title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.spacer { flex: 1; }
|
||||
.alert-badge { margin-right: 4px; }
|
||||
.alert-btn { color: #606266; padding: 4px 6px; }
|
||||
.alert-btn:hover { color: #1668dc; background: #f2f6fc; }
|
||||
.alert-ring { color: #e6a23c; animation: alert-ring 1.1s ease-in-out infinite; transform-origin: top center; }
|
||||
@keyframes alert-ring {
|
||||
0%, 60%, 100% { transform: rotate(0); }
|
||||
10% { transform: rotate(14deg); }
|
||||
20% { transform: rotate(-12deg); }
|
||||
30% { transform: rotate(9deg); }
|
||||
40% { transform: rotate(-6deg); }
|
||||
50% { transform: rotate(0); }
|
||||
}
|
||||
.help-btn { font-size: 13px; color: #606266; }
|
||||
.user-name {
|
||||
display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
|
||||
|
||||
Reference in New Issue
Block a user