Files
dvcp_v2_webapp/packages/bigscreen/designer/AppDesigner.vue
2024-01-24 10:25:35 +08:00

84 lines
1.7 KiB
Vue

<template>
<section class="AppDesigner">
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
<script>
import List from './List.vue'
import Add from './Add.vue'
import SourceData from './SourceData.vue'
import Preview from "./preview.vue";
import DesignDashboard from "./viewport.vue";
export default {
name: 'AppDesigner',
label: '大屏设计',
components: {DesignDashboard, Preview, List, Add, SourceData},
props: {
instance: Function,
dict: Object,
permissions: Function,
urlPrefix: {
type: String,
default: '/app'
}
},
computed: {
currentPage() {
const {hash} = this.$route
return hash == "#sourceData" ? SourceData :
hash == "#add" ? Add :
hash == "#preview" ? Preview :
hash == "#design" ? DesignDashboard : List
},
tabs() {
return [
{label: '大屏列表', name: 'FormList', comp: List, permission: ''}
].filter(() => {
return true
})
}
},
data() {
return {
currIndex: '0',
componentName: '',
params: {},
areaId: '',
isShowDetail: false
}
},
methods: {
onChange(data) {
if (data.type === 'list') {
this.componentName = 'List'
this.isShowDetail = false
this.params = data.params
}
if (data.type === 'add') {
this.componentName = 'Add'
this.isShowDetail = true
this.params = data.params
}
if (data.type === 'SourceData') {
this.componentName = 'SourceData'
this.isShowDetail = true
this.params = data.params
}
}
},
}
</script>
<style lang="scss" scoped>
.AppDesigner {
height: 100%;
}
</style>