mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +08:00
处理图标页全屏后无法渲染的问题
This commit is contained in:
parent
0050120d79
commit
fd5d763de4
@ -190,7 +190,7 @@ export default {
|
||||
const { meta, name, params, query } = currentRouteInfo;
|
||||
if (meta.isDynamic) router.push({ name, params });
|
||||
else router.push({ path, query });
|
||||
store.dispatch('tagsViewRoutes/setCurrenFullscreen');
|
||||
store.dispatch('tagsViewRoutes/setCurrenFullscreen', 500);
|
||||
});
|
||||
};
|
||||
// 当前项右键菜单点击,拿当前点击的路由路径对比 浏览器缓存中的 tagsView 路由数组,取当前点击项的详细路由信息
|
||||
|
@ -29,33 +29,34 @@ const tagsViewRoutesModule: Module<TagsViewRoutesState, RootStateTypes> = {
|
||||
commit('getTagsViewRoutes', data);
|
||||
},
|
||||
// 设置卡片全屏
|
||||
setCurrenFullscreen({ commit }) {
|
||||
setCurrenFullscreen({ commit }, timeout: number = 0) {
|
||||
const screenfulls: any = screenfull;
|
||||
if (!screenfulls.isEnabled) {
|
||||
ElMessage.warning('暂不不支持全屏');
|
||||
return false;
|
||||
}
|
||||
screenfulls.toggle();
|
||||
const currenFullscreenChange = () => {
|
||||
const layoutViewBgWhite = document.querySelector('.layout-view-bg-white') as HTMLElement;
|
||||
if (screenfulls.isFullscreen) {
|
||||
commit('getCurrenFullscreen', true);
|
||||
// 设置全屏时,设置有 `layout-view-bg-white` 类的高度
|
||||
if (layoutViewBgWhite) layoutViewBgWhite.style.height = `calc(100vh - 30px)`;
|
||||
} else {
|
||||
screenfulls.off('change', currenFullscreenChange);
|
||||
commit('getCurrenFullscreen', false);
|
||||
if (!layoutViewBgWhite) return false;
|
||||
const getThemeConfig = Local.get('themeConfig');
|
||||
if (getThemeConfig) {
|
||||
let { isTagsview } = getThemeConfig;
|
||||
if (isTagsview) layoutViewBgWhite.style.height = `calc(100vh - 114px)`;
|
||||
else layoutViewBgWhite.style.height = `calc(100vh - 80px)`;
|
||||
setTimeout(() => {
|
||||
const currenFullscreenChange = () => {
|
||||
const layoutViewBgWhite = document.querySelector('.layout-view-bg-white') as HTMLElement;
|
||||
if (screenfulls.isFullscreen) {
|
||||
commit('getCurrenFullscreen', true);
|
||||
// 设置全屏时,设置有 `layout-view-bg-white` 类的高度
|
||||
if (layoutViewBgWhite) layoutViewBgWhite.style.height = `calc(100vh - 30px)`;
|
||||
} else {
|
||||
screenfulls.off('change', currenFullscreenChange);
|
||||
commit('getCurrenFullscreen', false);
|
||||
if (!layoutViewBgWhite) return false;
|
||||
const getThemeConfig = Local.get('themeConfig');
|
||||
if (getThemeConfig) {
|
||||
let { isTagsview } = getThemeConfig;
|
||||
if (isTagsview) layoutViewBgWhite.style.height = `calc(100vh - 114px)`;
|
||||
else layoutViewBgWhite.style.height = `calc(100vh - 80px)`;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
screenfulls.on('change', currenFullscreenChange);
|
||||
commit('getCurrenFullscreen', true);
|
||||
};
|
||||
screenfulls.on('change', currenFullscreenChange);
|
||||
screenfulls.toggle();
|
||||
}, timeout);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user