Files
dvcp_v2_webapp/project/qujing/app/AppResidentCredits/AppResidentCredits.vue
2023-02-24 10:54:12 +08:00

89 lines
2.0 KiB
Vue

<template>
<ai-list>
<template slot="title">
<ai-title title="居民积分" :isShowArea="currIndex === '0'" :hideLevel="$store.state.user.info.areaList.length - 1" 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="component" :areaId="areaId" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" :permissions="permissions"/>
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
</template>
<script>
import List from './components/List'
import Rule from './components/Rule'
export default {
name: 'AppResidentCredits',
label: '居民积分',
props: {
instance: Function,
dict: Object,
permissions: Function
},
data () {
return {
component: 'List',
params: {},
currIndex: '0',
areaId: ''
}
},
components: {
List,
Rule
},
computed: {
tabs () {
return [
{label: '居民积分', name: 'List', comp: List, permission: ''},
{label: `积分规则`, name: 'Rule', comp: Rule, permission: ''}
].filter(() => {
return true
})
}
},
created () {
this.areaId = this.$store.state.user.info.areaId
},
methods: {
onChange (data) {
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
this.isShowDetail = false
}
if (data.type === 'Rule') {
this.component = 'Rule'
this.params = data.params
}
},
onAreaChange () {
this.$nextTick(() => {
this.$refs.List[0].refresh()
})
}
}
}
</script>
<style lang="scss">
.doc-circulation {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>