mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +08:00
'admin-21.07.26:修复tagsview右键菜单点击开启当前页全屏问题'
This commit is contained in:
parent
0e45548c06
commit
e3f3a9cc5e
@ -211,8 +211,8 @@ export default {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 2px;
|
||||
height: 44px;
|
||||
width: 65px;
|
||||
height: 50px;
|
||||
width: 60px;
|
||||
transform: translateX(-50%);
|
||||
z-index: 0;
|
||||
transition: 0.3s ease-in-out;
|
||||
@ -221,7 +221,6 @@ export default {
|
||||
.columns-card {
|
||||
@extend .columns-round;
|
||||
top: 0;
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
@ -178,23 +178,48 @@ export default {
|
||||
addBrowserSetSession(state.tagsViewList);
|
||||
};
|
||||
// 6、开启当前页面全屏
|
||||
const openCurrenFullscreen = (path: string) => {
|
||||
const item = state.tagsViewList.find((v: any) => v.path === path);
|
||||
const openCurrenFullscreen = (path: string, currentRouteInfo: object) => {
|
||||
const { meta, name, params, query } = currentRouteInfo;
|
||||
if (meta.isDynamic) router.push({ name, params });
|
||||
else router.push({ path, query });
|
||||
nextTick(() => {
|
||||
router.push({ path, query: item.query });
|
||||
const element = document.querySelector('.layout-main');
|
||||
const screenfulls: any = screenfull;
|
||||
screenfulls.request(element);
|
||||
// 加延时器,防止非本界面点击 `开启当前页面全屏`,高度不对问题
|
||||
setTimeout(() => {
|
||||
const element = document.body;
|
||||
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 路由数组,取当前点击项的详细路由信息
|
||||
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);
|
||||
};
|
||||
// 当前项右键菜单点击
|
||||
const onCurrentContextmenuClick = (item) => {
|
||||
const { id, path } = item;
|
||||
const { meta, name, params, query } = getCurrentRouteItem(path);
|
||||
const currentRouteInfo = getCurrentRouteItem(path);
|
||||
const { meta, name, params, query } = currentRouteInfo;
|
||||
switch (id) {
|
||||
case 0:
|
||||
refreshCurrentTagsView(path);
|
||||
@ -213,7 +238,7 @@ export default {
|
||||
closeAllTagsView(path);
|
||||
break;
|
||||
case 4:
|
||||
openCurrenFullscreen(path);
|
||||
openCurrenFullscreen(path, currentRouteInfo);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
@ -54,6 +54,7 @@ body,
|
||||
.el-scrollbar {
|
||||
width: 100%;
|
||||
}
|
||||
// 此字段多次用到,不可删除,如需修改,请重写覆盖样式
|
||||
.layout-view-bg-white {
|
||||
background: white;
|
||||
width: 100%;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="chart-scrollbar" :style="{ height: `calc(100vh - ${initTagViewHeight}` }">
|
||||
<div class="chart-warp layout-view-bg-white">
|
||||
<div class="chart-scrollbar layout-view-bg-white" :style="{ height: `calc(100vh - ${initTagViewHeight}` }">
|
||||
<div class="chart-warp">
|
||||
<div class="chart-warp-top">
|
||||
<ChartHead />
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user