'admin-21.07.26:修复tagsview右键菜单点击开启当前页全屏问题'
This commit is contained in:
parent
0e45548c06
commit
e3f3a9cc5e
@ -211,8 +211,8 @@ export default {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
top: 2px;
|
top: 2px;
|
||||||
height: 44px;
|
height: 50px;
|
||||||
width: 65px;
|
width: 60px;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
transition: 0.3s ease-in-out;
|
transition: 0.3s ease-in-out;
|
||||||
@ -221,7 +221,6 @@ export default {
|
|||||||
.columns-card {
|
.columns-card {
|
||||||
@extend .columns-round;
|
@extend .columns-round;
|
||||||
top: 0;
|
top: 0;
|
||||||
height: 50px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
@ -178,23 +178,48 @@ export default {
|
|||||||
addBrowserSetSession(state.tagsViewList);
|
addBrowserSetSession(state.tagsViewList);
|
||||||
};
|
};
|
||||||
// 6、开启当前页面全屏
|
// 6、开启当前页面全屏
|
||||||
const openCurrenFullscreen = (path: string) => {
|
const openCurrenFullscreen = (path: string, currentRouteInfo: object) => {
|
||||||
const item = state.tagsViewList.find((v: any) => v.path === path);
|
const { meta, name, params, query } = currentRouteInfo;
|
||||||
|
if (meta.isDynamic) router.push({ name, params });
|
||||||
|
else router.push({ path, query });
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
router.push({ path, query: item.query });
|
// 加延时器,防止非本界面点击 `开启当前页面全屏`,高度不对问题
|
||||||
const element = document.querySelector('.layout-main');
|
setTimeout(() => {
|
||||||
const screenfulls: any = screenfull;
|
const element = document.body;
|
||||||
screenfulls.request(element);
|
const aside = document.querySelector('aside');
|
||||||
|
const header = document.querySelector('header');
|
||||||
|
const columAside = document.querySelector('.layout-columns-aside');
|
||||||
|
const layoutView = document.querySelector('.layout-view-bg-white');
|
||||||
|
screenfull.on('change', () => {
|
||||||
|
if (screenfull.isFullscreen) {
|
||||||
|
if (aside) aside.style.display = `none`;
|
||||||
|
if (header) header.style.display = `none`;
|
||||||
|
if (columAside) columAside.style.display = `none`;
|
||||||
|
if (layoutView) layoutView.style.height = `calc(100vh - 30px)`;
|
||||||
|
} else {
|
||||||
|
if (aside) aside.style.display = `flex`;
|
||||||
|
if (header) header.style.display = `block`;
|
||||||
|
if (columAside) columAside.style.display = `block`;
|
||||||
|
if (!layoutView) return false;
|
||||||
|
let { isTagsview } = getThemeConfig.value;
|
||||||
|
if (isTagsview) layoutView.style.height = `calc(100vh - 114px)`;
|
||||||
|
else layoutView.style.height = `calc(100vh - 80px)`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
screenfull.request(element);
|
||||||
|
}, 800);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 当前项右键菜单点击,拿当前点击的路由路径对比 浏览器缓存中的 tagsView 路由数组,取当前点击项的详细路由信息
|
// 当前项右键菜单点击,拿当前点击的路由路径对比 浏览器缓存中的 tagsView 路由数组,取当前点击项的详细路由信息
|
||||||
const getCurrentRouteItem = (path: string) => {
|
const getCurrentRouteItem = (path: string) => {
|
||||||
|
if (!Session.get('tagsViewList')) return state.tagsViewList.find((v: any) => v.path === path);
|
||||||
return Session.get('tagsViewList').find((v: any) => v.path === path);
|
return Session.get('tagsViewList').find((v: any) => v.path === path);
|
||||||
};
|
};
|
||||||
// 当前项右键菜单点击
|
// 当前项右键菜单点击
|
||||||
const onCurrentContextmenuClick = (item) => {
|
const onCurrentContextmenuClick = (item) => {
|
||||||
const { id, path } = item;
|
const { id, path } = item;
|
||||||
const { meta, name, params, query } = getCurrentRouteItem(path);
|
const currentRouteInfo = getCurrentRouteItem(path);
|
||||||
|
const { meta, name, params, query } = currentRouteInfo;
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case 0:
|
case 0:
|
||||||
refreshCurrentTagsView(path);
|
refreshCurrentTagsView(path);
|
||||||
@ -213,7 +238,7 @@ export default {
|
|||||||
closeAllTagsView(path);
|
closeAllTagsView(path);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
openCurrenFullscreen(path);
|
openCurrenFullscreen(path, currentRouteInfo);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -54,6 +54,7 @@ body,
|
|||||||
.el-scrollbar {
|
.el-scrollbar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
// 此字段多次用到,不可删除,如需修改,请重写覆盖样式
|
||||||
.layout-view-bg-white {
|
.layout-view-bg-white {
|
||||||
background: white;
|
background: white;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="chart-scrollbar" :style="{ height: `calc(100vh - ${initTagViewHeight}` }">
|
<div class="chart-scrollbar layout-view-bg-white" :style="{ height: `calc(100vh - ${initTagViewHeight}` }">
|
||||||
<div class="chart-warp layout-view-bg-white">
|
<div class="chart-warp">
|
||||||
<div class="chart-warp-top">
|
<div class="chart-warp-top">
|
||||||
<ChartHead />
|
<ChartHead />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user