This commit is contained in:
yanran200730
2021-12-22 19:04:41 +08:00
parent 87deb83ed5
commit 1553352c88
3 changed files with 29 additions and 31 deletions

View File

@@ -1,12 +1,12 @@
<template>
<ai-list v-if="!isShowDetail">
<template slot="title">
<ai-title title="居民活动" :isShowBottomBorder="false"></ai-title>
<ai-title title="居民活动" :isShowBottomBorder="false" :isShowArea="currIndex === '0'" v-model="areaId" :instance="instance" @change="onAreaChange"></ai-title>
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" :permissions="permissions"/>
<component :areaId="areaId" :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" :permissions="permissions"/>
</el-tab-pane>
</el-tabs>
</template>
@@ -60,11 +60,13 @@
currIndex: '0',
componentName: '',
params: {},
areaId: '',
isShowDetail: false
}
},
created () {
this.areaId = this.user.info.areaId
if (this.$route.query.id) {
this.componentName = this.$route.query?.type
this.params = {id: this.$route.query?.id}
@@ -73,6 +75,14 @@
},
methods: {
onAreaChange () {
if (this.currIndex === '0') {
this.$nextTick(() => {
this.$refs[this.currIndex][0].getList()
})
}
},
onChange (data) {
if (data.type === 'list') {
this.componentName = 'List'