'admin-21.07.26:修复tagsview右键菜单点击开启当前页全屏问题'

This commit is contained in:
lyt 2021-07-26 17:00:04 +08:00
parent 0e45548c06
commit e3f3a9cc5e
4 changed files with 38 additions and 13 deletions

View File

@ -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;
}

View File

@ -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;
}
};

View File

@ -54,6 +54,7 @@ body,
.el-scrollbar {
width: 100%;
}
// 此字段多次用到不可删除如需修改请重写覆盖样式
.layout-view-bg-white {
background: white;
width: 100%;

View File

@ -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>