forked from github/dataease
Merge pull request #1202 from dataease/pr@dev@refactor_panel
feat:仪表编辑状态,自动隐藏顶部餐单栏
This commit is contained in:
commit
e2883a86bf
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="classObj" class="app-wrapper">
|
<div :class="classObj" class="app-wrapper">
|
||||||
<licbar />
|
<licbar />
|
||||||
<topbar />
|
<topbar v-if="componentName!=='PanelEdit'" />
|
||||||
|
|
||||||
<de-container style="padding-top: 56px;">
|
<de-container :style="mainStyle">
|
||||||
<de-aside-container v-if="!sidebar.hide" class="le-aside-container">
|
<de-aside-container v-if="!sidebar.hide" class="le-aside-container">
|
||||||
<sidebar class="sidebar-container" />
|
<sidebar class="sidebar-container" />
|
||||||
</de-aside-container>
|
</de-aside-container>
|
||||||
|
|
||||||
<de-main-container class="la-main-container">
|
<de-main-container class="la-main-container" :class="{'full-height':fullHeightFlag}">
|
||||||
<app-main />
|
<app-main />
|
||||||
</de-main-container>
|
</de-main-container>
|
||||||
</de-container>
|
</de-container>
|
||||||
@ -29,6 +29,8 @@ import ResizeMixin from './mixin/ResizeHandler'
|
|||||||
import DeMainContainer from '@/components/dataease/DeMainContainer'
|
import DeMainContainer from '@/components/dataease/DeMainContainer'
|
||||||
import DeContainer from '@/components/dataease/DeContainer'
|
import DeContainer from '@/components/dataease/DeContainer'
|
||||||
import DeAsideContainer from '@/components/dataease/DeAsideContainer'
|
import DeAsideContainer from '@/components/dataease/DeAsideContainer'
|
||||||
|
import bus from '@/utils/bus'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Layout',
|
name: 'Layout',
|
||||||
components: {
|
components: {
|
||||||
@ -41,6 +43,11 @@ export default {
|
|||||||
DeAsideContainer
|
DeAsideContainer
|
||||||
},
|
},
|
||||||
mixins: [ResizeMixin],
|
mixins: [ResizeMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
componentName: 'PanelMain'
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
sidebar() {
|
sidebar() {
|
||||||
return this.$store.state.app.sidebar
|
return this.$store.state.app.sidebar
|
||||||
@ -54,6 +61,20 @@ export default {
|
|||||||
showSettings() {
|
showSettings() {
|
||||||
return this.$store.state.settings.showSettings
|
return this.$store.state.settings.showSettings
|
||||||
},
|
},
|
||||||
|
fullHeightFlag() {
|
||||||
|
return this.componentName === 'PanelEdit'
|
||||||
|
},
|
||||||
|
mainStyle() {
|
||||||
|
if (this.fullHeightFlag) {
|
||||||
|
return {
|
||||||
|
'height': '100vh!important'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
'paddingTop': '56px'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
classObj() {
|
classObj() {
|
||||||
return {
|
return {
|
||||||
// hideSidebar: !this.sidebar.opened,
|
// hideSidebar: !this.sidebar.opened,
|
||||||
@ -63,6 +84,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
bus.$on('PanelSwitchComponent', (c) => {
|
||||||
|
this.componentName = c.name
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClickOutside() {
|
handleClickOutside() {
|
||||||
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
||||||
@ -127,4 +153,7 @@ export default {
|
|||||||
background-color: var(--SiderBG) !important;
|
background-color: var(--SiderBG) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.full-height {
|
||||||
|
height: 100vh !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -850,14 +850,14 @@ export default {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.ms-aside-container {
|
.ms-aside-container {
|
||||||
height: calc(100vh - 91px);
|
height: calc(100vh - 35px);
|
||||||
max-width: 60px;
|
max-width: 60px;
|
||||||
border: none;
|
border: none;
|
||||||
width: 60px;
|
width: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ms-main-container {
|
.ms-main-container {
|
||||||
height: calc(100vh - 91px);
|
height: calc(100vh - 35px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.de-header {
|
.de-header {
|
||||||
@ -891,7 +891,7 @@ export default {
|
|||||||
.leftPanel {
|
.leftPanel {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
height: calc(100vh - 91px);
|
height: calc(100vh - 35px);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 91px;
|
top: 91px;
|
||||||
left: 60px;
|
left: 60px;
|
||||||
@ -918,13 +918,13 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.this_canvas{
|
.this_canvas{
|
||||||
height: calc(100vh - 91px);
|
height: calc(100vh - 35px);
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
background-size:100% 100% !important;
|
background-size:100% 100% !important;
|
||||||
}
|
}
|
||||||
.el-main{
|
.el-main{
|
||||||
height: calc(100vh - 91px);
|
height: calc(100vh - 35px);
|
||||||
padding: 0!important;
|
padding: 0!important;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" style="background-color: #f7f8fa">
|
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" style="background-color: #f7f8fa">
|
||||||
<de-main-container>
|
<de-main-container :class="{'full-height':componentName==='PanelEdit'}">
|
||||||
<panel-main v-show="componentName==='PanelMain'" ref="panel_main" />
|
<panel-main v-show="componentName==='PanelMain'" ref="panel_main" />
|
||||||
<chart-edit v-if="componentName==='ChartEdit'" :param="param" />
|
<chart-edit v-if="componentName==='ChartEdit'" :param="param" />
|
||||||
<panel-edit v-if="componentName==='PanelEdit'" />
|
<panel-edit v-if="componentName==='PanelEdit'" />
|
||||||
@ -103,4 +103,7 @@ export default {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.full-height {
|
||||||
|
height: 100vh !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user