Files
dvcp_v2_webapp/packages/device/AppBroadcast/AppBroadcast.vue

69 lines
1.2 KiB
Vue
Raw Normal View History

2021-12-14 18:36:19 +08:00
<template>
<div class="AppBroadcast">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>
<script>
import List from './components/List'
import Add from './components/Add'
2022-06-08 17:57:19 +08:00
import Detail from './components/Detail'
2021-12-14 18:36:19 +08:00
export default {
2021-12-23 11:19:23 +08:00
label: '播发记录',
2021-12-14 18:36:19 +08:00
name: 'AppBroadcast',
props: {
instance: Function,
dict: Object,
},
data() {
return {
2022-06-10 09:37:47 +08:00
component: 'List',
2021-12-14 18:36:19 +08:00
params: {},
include: [],
}
},
components: {
Add,
2022-06-08 17:57:19 +08:00
List,
Detail
2021-12-14 18:36:19 +08:00
},
methods: {
onChange(data) {
if (data.type === 'add') {
this.component = 'Add'
this.params = data.params
}
2022-06-08 17:57:19 +08:00
if (data.type === 'detail') {
this.component = 'Detail'
this.params = data.params
}
2021-12-14 18:36:19 +08:00
if (data.type == 'list') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
},
},
}
</script>
<style lang="scss">
.AppBroadcast {
height: 100%;
background: #f3f6f9;
overflow: auto;
}
</style>