Commit 2155d4e9 authored by wanghao's avatar wanghao

1 进入管理系统 强制刷新界面调整

parent 55e4aaa4
<template>
<dv-full-screen-container class="screen-container">
<dv-full-screen-container v-if="!isRedirecting" class="screen-container">
<!-- 管理系统入口按钮 -->
<div @click="goToAdmin" class="management-entry" style="width:100px;height:30px;">进入管理系统</div>
<!-- 顶部导航栏 -->
......@@ -90,7 +90,8 @@ export default {
{ icon: '🔍', text: '老化层详情', component: 'AgingLayer' }, // 新增菜单项,
{ icon: '🔍', text: '托盘与设备绑定', component: 'TrayBinding' } // 新增菜单项
],
modbusDeviceData: null // 存储传递的柜子ID
modbusDeviceData: null, // 存储传递的柜子ID
isRedirecting: false
}
},
......@@ -126,19 +127,14 @@ export default {
this.selectedMenu = index;
},
goToAdmin() {
// 更可靠的刷新方法
this.$router.push('/index').then(() => {
// 确保完全刷新,避免任何缓存
const url = new URL(window.location.href);
url.searchParams.set('_t', Date.now());
url.searchParams.set('_r', Math.random().toString(36).substr(2));
// 使用replace而不是href跳转,避免历史记录问题
window.location.replace(url.toString());
}).catch(() => {
// 备用方案
window.location.href = '/index?_t=' + Date.now();
});
this.isRedirecting = true;
setTimeout(() => {
this.$router.push('/index').then(() => {
window.location.href = window.location.origin + '/index?_t=' + Date.now();
});
}, 100);
},
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment