diff --git a/src/store/modules/common.js b/src/store/modules/common.js index d808b36..ce90247 100644 --- a/src/store/modules/common.js +++ b/src/store/modules/common.js @@ -14,6 +14,8 @@ export default { menuActiveName: '', // 内容, 是否需要刷新 contentIsNeedRefresh: false, + // 隐藏顶栏、侧栏和页签,让当前页面铺满窗口。全系统共用。 + contentFullscreen: false, // 主入口标签页 mainTabs: [], mainTabsActiveName: '', @@ -42,6 +44,9 @@ export default { updateContentIsNeedRefresh (state, status) { state.contentIsNeedRefresh = status }, + updateContentFullscreen (state, status) { + state.contentFullscreen = status + }, updateMainTabs (state, tabs) { state.mainTabs = tabs }, diff --git a/src/views/main-content.vue b/src/views/main-content.vue index d436d0a..418d5ea 100644 --- a/src/views/main-content.vue +++ b/src/views/main-content.vue @@ -181,10 +181,19 @@ get () { return this.$store.state.common.mainTabsActiveName }, set (val) { this.$store.commit('common/updateMainTabsActiveName', val) } }, + contentFullscreen: { + get () { return this.$store.state.common.contentFullscreen } + }, siteContentViewHeight () { - var height = this.documentClientHeight - 50 - 2 + var height = this.documentClientHeight - 2 + // 全屏时顶栏和页签已隐藏,内容区按整窗高度计算。 + if (!this.contentFullscreen) { + height -= 50 + if (this.$route.meta.isTab) { + height -= 40 + } + } if (this.$route.meta.isTab) { - height -= 40 return isURL(this.$route.meta.iframeUrl) ? { height: height + 'px' } : { minHeight: height + 'px' } } return { minHeight: height + 'px' } diff --git a/src/views/main-navbar.vue b/src/views/main-navbar.vue index fc8cd89..d3e70d8 100644 --- a/src/views/main-navbar.vue +++ b/src/views/main-navbar.vue @@ -17,7 +17,6 @@
@@ -404,6 +407,9 @@ export default { this.$refs.updateLanguage.init() }) }, + enterContentFullscreen() { + this.$store.commit('common/updateContentFullscreen', true) + }, // 退出 logoutHandle() { this.$confirm(`确定进行[退出]操作?`, '提示', { @@ -517,5 +523,24 @@ export default { width: 105px; height: 35px; } + +.site-navbar__fullscreen { + float: right; + height: 35px; + margin-right: 4px; + padding: 0 8px; + border: 0; + background: transparent; + color: #3b4249; + font-size: 12px; + line-height: 35px; + cursor: pointer; +} + +.site-navbar__fullscreen i { + margin-right: 4px; + font-size: 14px; + vertical-align: middle; +} diff --git a/src/views/main.vue b/src/views/main.vue index 9bddbed..e192c0e 100644 --- a/src/views/main.vue +++ b/src/views/main.vue @@ -1,7 +1,7 @@