2021-03-03 15:06:52 +08:00
|
|
|
<template>
|
2022-09-19 17:51:06 +08:00
|
|
|
<de-container
|
|
|
|
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
|
|
|
|
>
|
2022-03-29 11:46:48 +08:00
|
|
|
<de-aside-container type="dataset">
|
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>
|
2022-09-21 11:55:39 +08:00
|
|
|
<de-main-container>
|
|
|
|
<component
|
|
|
|
:is="component"
|
|
|
|
ref="dynamic_component"
|
|
|
|
:param="param"
|
|
|
|
@switchComponent="switchComponent"
|
|
|
|
@saveSuccess="saveSuccess"
|
|
|
|
/>
|
|
|
|
</de-main-container>
|
2021-03-16 17:53:43 +08:00
|
|
|
</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'
|
|
|
|
|
2022-09-19 16:13:39 +08:00
|
|
|
import noSelect from './data/noSelect'
|
2021-03-03 18:35:51 +08:00
|
|
|
import ViewTable from './data/ViewTable'
|
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-12-22 11:42:44 +08:00
|
|
|
import { checkCustomDs } from '@/api/dataset/dataset'
|
2021-03-03 15:06:52 +08:00
|
|
|
export default {
|
|
|
|
name: 'DataSet',
|
2022-09-19 17:51:06 +08:00
|
|
|
components: {
|
|
|
|
DeMainContainer,
|
|
|
|
DeContainer,
|
|
|
|
DeAsideContainer,
|
|
|
|
Group,
|
|
|
|
noSelect,
|
|
|
|
ViewTable
|
|
|
|
},
|
2021-03-03 15:06:52 +08:00
|
|
|
data() {
|
2021-03-03 18:35:51 +08:00
|
|
|
return {
|
2022-09-19 16:13:39 +08:00
|
|
|
component: noSelect,
|
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-03 18:01:30 +08:00
|
|
|
created() {
|
2021-12-22 11:42:44 +08:00
|
|
|
this.initDs()
|
2021-07-03 18:01:30 +08:00
|
|
|
this.$store.dispatch('app/toggleSideBarHide', true)
|
2021-07-06 15:24:34 +08:00
|
|
|
const routerParam = this.$router.currentRoute.params
|
|
|
|
this.toMsgShare(routerParam)
|
2021-07-03 18:01:30 +08:00
|
|
|
},
|
2021-03-03 18:35:51 +08:00
|
|
|
methods: {
|
2021-12-22 11:42:44 +08:00
|
|
|
initDs() {
|
2022-06-23 10:05:58 +08:00
|
|
|
localStorage.setItem('reloadDsData', 'false')
|
2022-09-19 17:51:06 +08:00
|
|
|
checkCustomDs().then((res) => {
|
2021-12-22 11:42:44 +08:00
|
|
|
this.$store.dispatch('dataset/setHideCustomDs', res.data)
|
|
|
|
})
|
|
|
|
},
|
2021-03-03 18:35:51 +08:00
|
|
|
switchComponent(c) {
|
|
|
|
this.param = c.param
|
|
|
|
switch (c.name) {
|
|
|
|
case 'ViewTable':
|
|
|
|
this.component = ViewTable
|
|
|
|
break
|
2021-11-18 18:16:43 +08:00
|
|
|
break
|
2021-04-29 15:43:15 +08:00
|
|
|
case 'FieldEdit':
|
|
|
|
this.component = FieldEdit
|
|
|
|
break
|
2021-03-03 18:35:51 +08:00
|
|
|
default:
|
2022-09-19 16:13:39 +08:00
|
|
|
this.component = noSelect
|
2021-03-03 18:35:51 +08:00
|
|
|
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]
|
|
|
|
// 说明是从消息通知跳转过来的
|
2022-09-19 17:51:06 +08:00
|
|
|
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(() => {
|
2022-09-19 17:51:06 +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>
|
2022-09-19 17:51:06 +08:00
|
|
|
.ms-aside-container {
|
|
|
|
height: calc(100vh - 56px);
|
|
|
|
padding: 0 0;
|
|
|
|
min-width: 260px;
|
|
|
|
max-width: 460px;
|
|
|
|
}
|
2021-03-03 15:06:52 +08:00
|
|
|
|
2022-09-19 17:51:06 +08:00
|
|
|
.ms-main-container {
|
|
|
|
height: calc(100vh - 56px);
|
|
|
|
padding: 10px 15px 0 15px;
|
|
|
|
}
|
2021-03-03 15:06:52 +08:00
|
|
|
</style>
|