Files
dvcp_v2_webapp/packages/publicity/AppContentManage/AppContentManage.vue

73 lines
1.3 KiB
Vue
Raw Normal View History

2021-12-18 17:16:42 +08:00
<template>
<div class="doc-circulation ailist-wrapper">
<keep-alive :include="['List']">
2022-05-25 11:55:34 +08:00
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"/>
2021-12-18 17:16:42 +08:00
</keep-alive>
</div>
</template>
<script>
2022-05-25 11:55:34 +08:00
import List from './components/List'
import Add from './components/Add'
import Detail from './components/Detail'
2021-12-18 17:16:42 +08:00
2022-05-25 11:55:34 +08:00
export default {
name: 'AppContentManage',
label: '内容管理',
2021-12-18 17:16:42 +08:00
2022-05-25 11:55:34 +08:00
props: {
instance: Function,
dict: Object
},
2021-12-18 17:16:42 +08:00
2022-05-25 11:55:34 +08:00
data() {
return {
component: 'List',
params: {},
include: []
}
},
2021-12-18 17:16:42 +08:00
2022-05-25 11:55:34 +08:00
components: {
Add,
List,
Detail
},
created() {
this.dict.load("yesOrNo")
},
methods: {
onChange(data) {
if (data.type === 'Add') {
this.component = 'Add'
this.params = data.params
}
2021-12-18 17:16:42 +08:00
2022-05-25 11:55:34 +08:00
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
2021-12-18 17:16:42 +08:00
2022-05-25 11:55:34 +08:00
if (data.type === 'list') {
this.component = 'List'
this.params = data.params
2021-12-18 17:16:42 +08:00
2022-05-25 11:55:34 +08:00
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
2021-12-18 17:16:42 +08:00
}
}
}
2022-05-25 11:55:34 +08:00
}
2021-12-18 17:16:42 +08:00
</script>
<style lang="scss">
2022-05-25 11:55:34 +08:00
.doc-circulation {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
2021-12-18 17:16:42 +08:00
</style>