Commit ae08d61e authored by wanghao's avatar wanghao

1 前端 使用 nginx 配置后,从 看板 到 管理系统后 样式混炼调整

parent 9b03c44c
...@@ -5,7 +5,6 @@ Vue.use(Router) ...@@ -5,7 +5,6 @@ Vue.use(Router)
/* Layout */ /* Layout */
import Layout from '@/layout' import Layout from '@/layout'
import ParentView from '@/components/ParentView';
/** /**
* Note: 路由配置项 * Note: 路由配置项
...@@ -41,8 +40,8 @@ export const constantRoutes = [ ...@@ -41,8 +40,8 @@ export const constantRoutes = [
{ {
path: '/bigScreen', path: '/bigScreen',
name: 'Screen', name: 'Screen',
component: () => require('@/views/screen/index.vue'), component: () => import('@/views/screen/index.vue'),
meta: { title: '数据看板界面' , noCache: true} meta: { title: '数据看板界面' }
}, },
{ {
path: '/login', path: '/login',
...@@ -59,15 +58,14 @@ export const constantRoutes = [ ...@@ -59,15 +58,14 @@ export const constantRoutes = [
component: (resolve) => require(['@/views/error/401'], resolve), component: (resolve) => require(['@/views/error/401'], resolve),
hidden: true hidden: true
}, },
// 避免空路径,使用明确的路径
{ {
path: '/', path: '',
component: Layout, component: Layout,
redirect: '/index', redirect: 'index',
children: [ children: [
{ {
path: 'index', path: 'index',
component: () => require('@/views/index'), component: (resolve) => require(['@/views/index'], resolve),
name: '首页', name: '首页',
meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true } meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
} }
...@@ -133,3 +131,4 @@ export default new Router({ ...@@ -133,3 +131,4 @@ export default new Router({
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes
}) })
...@@ -305,12 +305,4 @@ export default { ...@@ -305,12 +305,4 @@ export default {
.legend-color.gray { .legend-color.gray {
background-color: #f0f0f0; background-color: #f0f0f0;
} }
/* 调整app-container样式,作为外层容器 */
.app-container {
position: relative;
background-color: #030b2a; /* 整体背景色,与其他界面保持一致 */
min-height: 100vh; /* 确保占满全屏高度 */
padding: 0;
}
</style> </style>
...@@ -126,19 +126,32 @@ export default { ...@@ -126,19 +126,32 @@ export default {
this.selectedMenu = index; this.selectedMenu = index;
}, },
goToAdmin() { goToAdmin() {
console.log('当前路由:', this.$route);
console.log('目标路由: /index');
console.log('完整URL:', window.location.href);
// 先清除可能的DataV影响 // 先清除可能的DataV影响
const dvContainers = document.querySelectorAll('.dv-full-screen-container'); const dvContainers = document.querySelectorAll('.dv-full-screen-container');
dvContainers.forEach(container => container.remove()); dvContainers.forEach(container => {
container.remove();
});
// 清除 DataV 相关的样式
const dvStyles = document.querySelectorAll('style');
dvStyles.forEach(style => {
if (style.innerHTML.includes('dv-full-screen-container') ||
style.innerHTML.includes('data-v-')) {
style.remove();
}
});
// 强制清除 body 样式
document.body.style.background = '';
document.body.className = '';
// 直接使用绝对路径跳转,避免路由问题 // 直接使用绝对路径跳转,避免路由问题
const baseUrl = window.location.origin; const baseUrl = window.location.origin;
const targetUrl = `${baseUrl}/index?refresh=${Date.now()}&r=${Math.random()}`; // 添加时间戳确保不缓存
const targetUrl = `${baseUrl}/index?timestamp=${Date.now()}&refresh=${Math.random()}`;
// 使用location.assign确保浏览器处理重定向 // 使用location.replace确保不产生历史记录
window.location.assign(targetUrl); window.location.replace(targetUrl);
}, },
} }
} }
......
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