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

View File

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

View File

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

View File

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