dataease/frontend/src/views/dataset/index.vue

71 lines
1.6 KiB
Vue
Raw Normal View History

2021-03-03 15:06:52 +08:00
<template>
<ms-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
2021-03-03 15:06:52 +08:00
<ms-aside-container>
2021-03-08 12:29:11 +08:00
<group @switchComponent="switchComponent" />
2021-03-03 15:06:52 +08:00
</ms-aside-container>
<ms-main-container>
<!--<router-view/>-->
2021-03-08 12:29:11 +08:00
<component :is="component" :param="param" @switchComponent="switchComponent" />
2021-03-03 15:06:52 +08:00
</ms-main-container>
</ms-container>
</template>
<script>
import MsMainContainer from '@/metersphere/common/components/MsMainContainer'
import MsContainer from '@/metersphere/common/components/MsContainer'
import MsAsideContainer from '@/metersphere/common/components/MsAsideContainer'
import Group from './group/Group'
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-03-03 15:06:52 +08:00
export default {
name: 'DataSet',
2021-03-08 11:35:28 +08:00
components: { MsMainContainer, MsContainer, MsAsideContainer, Group, DataHome, ViewTable, AddDB, AddSQL },
2021-03-03 15:06:52 +08:00
data() {
return {
component: DataHome,
param: {}
}
},
methods: {
switchComponent(c) {
console.log(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
default:
this.component = DataHome
break
}
}
2021-03-03 15:06:52 +08:00
}
}
</script>
<style scoped>
.ms-aside-container {
height: calc(100vh - 56px);
2021-03-03 15:06:52 +08:00
padding: 15px;
min-width: 260px;
max-width: 460px;
2021-03-03 15:06:52 +08:00
}
.ms-main-container {
height: calc(100vh - 56px);
2021-03-03 15:06:52 +08:00
}
</style>