dataease-dm/frontend/src/views/panel/index.vue

63 lines
1.3 KiB
Vue
Raw Normal View History

2021-03-08 14:31:09 +08:00
<template>
2021-04-01 17:40:12 +08:00
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<de-main-container>
2021-03-22 19:05:35 +08:00
<component :is="component" :param="param" />
</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'
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,
param: {}
2021-03-08 21:10:16 +08:00
}
},
2021-04-01 17:40:12 +08:00
mounted() {
bus.$on('PanelSwitchComponent', (c) => {
console.log(c)
this.param = c.param
switch (c.name) {
case 'PanelEdit':
this.component = PanelEdit
break
case 'ChartEdit':
this.component = ChartEdit
break
default:
this.component = PanelMain
break
}
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);
padding: 15px;
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>