2021-03-03 15:06:52 +08:00
|
|
|
<template>
|
2021-03-16 17:53:43 +08:00
|
|
|
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
|
2021-03-03 15:06:52 +08:00
|
|
|
|
2021-03-16 17:53:43 +08:00
|
|
|
<de-aside-container>
|
2021-06-19 11:42:14 +08:00
|
|
|
<group :save-status="saveStatus" @switchComponent="switchComponent" />
|
2021-03-16 17:53:43 +08:00
|
|
|
</de-aside-container>
|
2021-03-03 15:06:52 +08:00
|
|
|
|
2021-03-16 17:53:43 +08:00
|
|
|
<de-main-container>
|
2021-03-03 18:35:51 +08:00
|
|
|
<!--<router-view/>-->
|
2021-07-03 18:01:30 +08:00
|
|
|
<component :is="component" ref="dynamic_component" :param="param" @switchComponent="switchComponent" @saveSuccess="saveSuccess" />
|
2021-03-16 17:53:43 +08:00
|
|
|
</de-main-container>
|
|
|
|
</de-container>
|
2021-03-03 15:06:52 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-03-16 17:53:43 +08:00
|
|
|
import DeMainContainer from '@/components/dataease/DeMainContainer'
|
|
|
|
import DeContainer from '@/components/dataease/DeContainer'
|
|
|
|
import DeAsideContainer from '@/components/dataease/DeAsideContainer'
|
2021-03-03 15:06:52 +08:00
|
|
|
import Group from './group/Group'
|
|
|
|
|
2021-03-03 18:35:51 +08:00
|
|
|
import DataHome from './data/DataHome'
|
|
|
|
import ViewTable from './data/ViewTable'
|
|
|
|
import AddDB from './add/AddDB'
|
2021-03-08 11:35:28 +08:00
|
|
|
import AddSQL from './add/AddSQL'
|
2021-04-07 18:49:01 +08:00
|
|
|
import AddExcel from './add/AddExcel'
|
|
|
|
import AddCustom from './add/AddCustom'
|
2021-04-29 15:43:15 +08:00
|
|
|
import FieldEdit from './data/FieldEdit'
|
2021-06-02 18:49:14 +08:00
|
|
|
import { removeClass } from '@/utils'
|
2021-07-22 16:59:34 +08:00
|
|
|
// import bus from '@/utils/bus'
|
2021-03-03 15:06:52 +08:00
|
|
|
export default {
|
|
|
|
name: 'DataSet',
|
2021-04-07 18:49:01 +08:00
|
|
|
components: { DeMainContainer, DeContainer, DeAsideContainer, Group, DataHome, ViewTable, AddDB, AddSQL, AddExcel, AddCustom },
|
2021-03-03 15:06:52 +08:00
|
|
|
data() {
|
2021-03-03 18:35:51 +08:00
|
|
|
return {
|
|
|
|
component: DataHome,
|
2021-06-19 11:42:14 +08:00
|
|
|
param: {},
|
|
|
|
saveStatus: null
|
2021-03-03 18:35:51 +08:00
|
|
|
}
|
|
|
|
},
|
2021-06-02 18:49:14 +08:00
|
|
|
mounted() {
|
|
|
|
removeClass(document.body, 'showRightPanel')
|
2021-07-22 16:59:34 +08:00
|
|
|
// bus.$on('to-msg-dataset', params => {
|
|
|
|
// this.toMsgShare(params)
|
|
|
|
// })
|
2021-06-02 18:49:14 +08:00
|
|
|
},
|
2021-07-03 18:01:30 +08:00
|
|
|
created() {
|
|
|
|
this.$store.dispatch('app/toggleSideBarHide', true)
|
2021-07-06 15:24:34 +08:00
|
|
|
const routerParam = this.$router.currentRoute.params
|
|
|
|
this.toMsgShare(routerParam)
|
|
|
|
// if ((routerParam = this.$router.currentRoute.params) !== null && routerParam.msgNotification) {
|
|
|
|
// // 说明是从消息通知跳转过来的
|
|
|
|
// if (routerParam.msgType === 1) { // 是数据集同步
|
|
|
|
// if (routerParam.sourceParam) {
|
|
|
|
// try {
|
|
|
|
// const msgParam = JSON.parse(routerParam.sourceParam)
|
|
|
|
// this.param = msgParam.tableId
|
|
|
|
// this.component = ViewTable
|
|
|
|
// this.$nextTick(() => {
|
|
|
|
// this.$refs.dynamic_component.msg2Current(routerParam.sourceParam)
|
|
|
|
// })
|
|
|
|
// } catch (error) {
|
|
|
|
// console.error(error)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
2021-07-03 18:01:30 +08:00
|
|
|
},
|
2021-03-03 18:35:51 +08:00
|
|
|
methods: {
|
|
|
|
switchComponent(c) {
|
|
|
|
this.param = c.param
|
|
|
|
switch (c.name) {
|
|
|
|
case 'ViewTable':
|
|
|
|
this.component = ViewTable
|
|
|
|
break
|
|
|
|
case 'AddDB':
|
|
|
|
this.component = AddDB
|
|
|
|
break
|
2021-03-08 11:35:28 +08:00
|
|
|
case 'AddSQL':
|
|
|
|
this.component = AddSQL
|
|
|
|
break
|
2021-04-07 18:49:01 +08:00
|
|
|
case 'AddExcel':
|
|
|
|
this.component = AddExcel
|
|
|
|
break
|
|
|
|
case 'AddCustom':
|
|
|
|
this.component = AddCustom
|
|
|
|
break
|
2021-04-29 15:43:15 +08:00
|
|
|
case 'FieldEdit':
|
|
|
|
this.component = FieldEdit
|
|
|
|
break
|
2021-03-03 18:35:51 +08:00
|
|
|
default:
|
|
|
|
this.component = DataHome
|
|
|
|
break
|
|
|
|
}
|
2021-06-19 11:42:14 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
saveSuccess(val) {
|
|
|
|
this.saveStatus = val
|
2021-07-06 15:24:34 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
toMsgShare(routerParam) {
|
|
|
|
if (routerParam !== null && routerParam.msgNotification) {
|
2021-07-12 11:30:57 +08:00
|
|
|
const panelShareTypeIds = [4, 5, 6]
|
|
|
|
// 说明是从消息通知跳转过来的
|
|
|
|
if (panelShareTypeIds.includes(routerParam.msgType)) { // 是数据集同步
|
2021-07-06 15:24:34 +08:00
|
|
|
if (routerParam.sourceParam) {
|
|
|
|
try {
|
|
|
|
const msgParam = JSON.parse(routerParam.sourceParam)
|
|
|
|
this.param = msgParam.tableId
|
|
|
|
this.component = ViewTable
|
|
|
|
this.$nextTick(() => {
|
2021-07-12 11:30:57 +08:00
|
|
|
this.$refs.dynamic_component && this.$refs.dynamic_component.msg2Current && this.$refs.dynamic_component.msg2Current(routerParam.sourceParam)
|
2021-07-06 15:24:34 +08:00
|
|
|
})
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-03-03 18:35:51 +08:00
|
|
|
}
|
2021-03-03 15:06:52 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.ms-aside-container {
|
2021-03-03 18:35:51 +08:00
|
|
|
height: calc(100vh - 56px);
|
2021-07-01 10:47:28 +08:00
|
|
|
padding: 0 0;
|
2021-03-03 18:35:51 +08:00
|
|
|
min-width: 260px;
|
|
|
|
max-width: 460px;
|
2021-03-03 15:06:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.ms-main-container {
|
2021-03-03 18:35:51 +08:00
|
|
|
height: calc(100vh - 56px);
|
2021-06-02 19:22:04 +08:00
|
|
|
padding: 10px 15px 0 15px;
|
2021-03-03 15:06:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|