2021-03-08 14:31:09 +08:00
|
|
|
<template>
|
2021-05-05 23:48:05 +08:00
|
|
|
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]" style="background-color: #f7f8fa">
|
2021-03-16 17:53:43 +08:00
|
|
|
<de-main-container>
|
2021-07-02 19:19:38 +08:00
|
|
|
<panel-main v-show="componentName==='PanelMain'" ref="panel_main" />
|
2021-05-25 19:11:00 +08:00
|
|
|
<chart-edit v-if="componentName==='ChartEdit'" :param="param" />
|
2021-05-24 17:28:03 +08:00
|
|
|
<panel-edit v-if="componentName==='PanelEdit'" />
|
|
|
|
<!-- <component :is="component" :param="param" />-->
|
2021-03-16 17:53:43 +08:00
|
|
|
</de-main-container>
|
|
|
|
</de-container>
|
2021-03-08 14:31:09 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-04-01 17:40:12 +08:00
|
|
|
import bus from '@/utils/bus'
|
2021-03-16 17:53:43 +08:00
|
|
|
import DeMainContainer from '@/components/dataease/DeMainContainer'
|
|
|
|
import DeContainer from '@/components/dataease/DeContainer'
|
2021-04-01 17:40:12 +08:00
|
|
|
import PanelMain from '@/views/panel/list/PanelMain'
|
|
|
|
import ChartEdit from '@/views/chart/view/ChartEdit'
|
|
|
|
import PanelEdit from '@/views/panel/edit'
|
2021-03-08 14:31:09 +08:00
|
|
|
|
2021-03-08 21:10:16 +08:00
|
|
|
export default {
|
|
|
|
name: 'Panel',
|
2021-04-01 17:40:12 +08:00
|
|
|
components: { DeMainContainer, DeContainer, PanelMain, ChartEdit, PanelEdit },
|
2021-03-08 21:10:16 +08:00
|
|
|
data() {
|
|
|
|
return {
|
2021-04-01 17:40:12 +08:00
|
|
|
component: PanelMain,
|
2021-05-24 17:28:03 +08:00
|
|
|
componentName: 'PanelMain',
|
2021-04-01 17:40:12 +08:00
|
|
|
param: {}
|
2021-03-08 21:10:16 +08:00
|
|
|
}
|
|
|
|
},
|
2021-04-01 17:40:12 +08:00
|
|
|
mounted() {
|
|
|
|
bus.$on('PanelSwitchComponent', (c) => {
|
|
|
|
this.param = c.param
|
2021-05-24 17:28:03 +08:00
|
|
|
this.componentName = c.name
|
|
|
|
this.$store.dispatch('panel/setMainActiveName', c.name)
|
|
|
|
// switch (c.name) {
|
|
|
|
// case 'PanelEdit':
|
|
|
|
// this.component = PanelEdit
|
|
|
|
// this.componentName = 'PanelEdit'
|
|
|
|
// break
|
|
|
|
// case 'ChartEdit':
|
|
|
|
// this.component = ChartEdit
|
|
|
|
// this.componentName = 'ChartEdit'
|
|
|
|
// break
|
|
|
|
// default:
|
|
|
|
// this.component = PanelMain
|
|
|
|
// this.componentName = 'PanelMain'
|
|
|
|
// break
|
|
|
|
// }
|
2021-04-01 17:40:12 +08:00
|
|
|
})
|
|
|
|
},
|
2021-07-02 19:19:38 +08:00
|
|
|
created() {
|
|
|
|
this.$store.dispatch('app/toggleSideBarHide', true)
|
|
|
|
let routerParam
|
|
|
|
if ((routerParam = this.$router.currentRoute.params) !== null && routerParam.msgNotification) {
|
|
|
|
// 说明是从消息通知跳转过来的
|
|
|
|
if (routerParam.msgType === 0) { // 是仪表板分享
|
|
|
|
this.componentName = 'PanelMain'
|
|
|
|
this.$nextTick(() => {
|
2021-07-03 18:01:30 +08:00
|
|
|
this.$refs.panel_main.msg2Current(routerParam.sourceParam)
|
2021-07-02 19:19:38 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-04-01 17:40:12 +08:00
|
|
|
methods: {
|
|
|
|
|
2021-03-08 14:31:09 +08:00
|
|
|
}
|
2021-03-08 21:10:16 +08:00
|
|
|
}
|
2021-03-08 14:31:09 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.ms-aside-container {
|
|
|
|
height: calc(100vh - 56px);
|
2021-04-08 16:54:37 +08:00
|
|
|
padding: 0px;
|
2021-03-08 14:31:09 +08:00
|
|
|
min-width: 260px;
|
|
|
|
max-width: 460px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ms-main-container {
|
|
|
|
height: calc(100vh - 56px);
|
2021-04-01 17:40:12 +08:00
|
|
|
padding: 0;
|
2021-03-08 14:31:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|