feat: 大屏新增虚拟工位滚动栏与多订单轮播,附件表增加删除原因及彻底清除留痕字段
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, ElMessageBox } from 'element-plus'
|
||||
import { ElMessage } 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, Tools, Setting, AlarmClock
|
||||
Box, Monitor, EditPen, Fold, Expand, Location, Goods, Key, Operation, Van, Clock, RefreshLeft, Folder, WarningFilled, Tools, Setting
|
||||
} from '@element-plus/icons-vue'
|
||||
import { getUser, getToken, logout, setSession } from '../utils/auth'
|
||||
import request from '../utils/request'
|
||||
@@ -63,37 +63,10 @@ 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')
|
||||
}
|
||||
// 说明:数据归档清理提醒已从顶栏角标移除,统一在「数据归档」页内展示
|
||||
// (页面加载时会查询 /backup/reminder,超期即在页内给出醒目提示)。
|
||||
onBeforeUnmount(() => window.removeEventListener('resize', onScreenChange))
|
||||
|
||||
// 侧栏菜单:按业务域分组。分组无权限码,子项各自带 code(无 code 的常驻),
|
||||
@@ -241,13 +214,6 @@ 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>
|
||||
|
||||
Reference in New Issue
Block a user