Files
dvcp_v2_webapp/project/pingchang/apps/AppCommunityManagement/AppCommunityManagement.vue

101 lines
2.3 KiB
Vue
Raw Normal View History

2022-09-26 15:18:54 +08:00
<template>
2022-09-29 09:28:42 +08:00
<ai-list v-if="!isShowDetail">
<template slot="title">
2022-12-06 14:08:33 +08:00
<ai-title title="社区管理" :isShowArea="(currIndex == 0)" :isShowBottomBorder="false" v-model="areaId" :instance="instance" @change="onAreaChange"></ai-title>
2022-09-29 09:28:42 +08:00
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
2022-12-06 14:08:33 +08:00
<component :areaId="areaId" :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" />
2022-09-29 09:28:42 +08:00
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
<Detail v-else-if="component === 'Detail'" :params="params" :instance="instance" :dict="dict" @change="onChange"></Detail>
2022-09-26 15:18:54 +08:00
</template>
2022-09-29 09:28:42 +08:00
2022-09-26 15:18:54 +08:00
<script>
2022-09-29 09:28:42 +08:00
import List from './components/List.vue'
import Statistics from './components/Statistics'
2022-09-26 15:18:54 +08:00
import Detail from './components/Detail'
2022-12-06 14:08:33 +08:00
import { mapState } from 'vuex'
2022-09-26 15:18:54 +08:00
export default {
name: 'AppCommunityManagement',
label: '社区管理',
props: {
instance: Function,
dict: Object
},
data () {
return {
component: 'List',
params: {},
2022-09-29 09:28:42 +08:00
isShowDetail: false,
2022-12-06 14:08:33 +08:00
currIndex: 0,
areaId: ''
2022-09-26 15:18:54 +08:00
}
},
components: {
Detail,
2022-09-29 09:28:42 +08:00
List,
Statistics
},
computed: {
2022-12-06 14:08:33 +08:00
...mapState(['user']),
2022-09-29 09:28:42 +08:00
tabs () {
const tabList = [
{label: '社区管理', name: 'List', comp: List },
{label: '管理统计', name: 'Statistics', comp: Statistics }
]
return tabList
}
2022-09-26 15:18:54 +08:00
},
2022-12-06 14:08:33 +08:00
created () {
this.areaId = this.user.info.areaId
},
2022-09-26 15:18:54 +08:00
methods: {
onChange (data) {
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
2022-09-29 09:28:42 +08:00
this.isShowDetail = true
}
if (data.type === 'Statistics') {
this.component = 'Statistics'
this.params = data.params
this.isShowDetail = false
2022-09-26 15:18:54 +08:00
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
2022-09-29 09:28:42 +08:00
this.isShowDetail = false
2022-09-26 15:18:54 +08:00
}
2022-12-06 14:08:33 +08:00
},
onAreaChange () {
this.$refs[this.currIndex][0].changeArea()
2022-09-26 15:18:54 +08:00
}
}
}
</script>
<style lang="scss">
.doc-circulation {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>