Commit 2155d4e9 authored by wanghao's avatar wanghao

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

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