Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2021-12-22 19:31:55 +08:00
3 changed files with 43 additions and 43 deletions

View File

@@ -1,12 +1,12 @@
<template> <template>
<ai-list v-if="!isShowDetail"> <ai-list v-if="!isShowDetail">
<template slot="title"> <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>
<template slot="tabs"> <template slot="tabs">
<el-tabs v-model="currIndex"> <el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label"> <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-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
@@ -60,11 +60,13 @@
currIndex: '0', currIndex: '0',
componentName: '', componentName: '',
params: {}, params: {},
areaId: '',
isShowDetail: false isShowDetail: false
} }
}, },
created () { created () {
this.areaId = this.user.info.areaId
if (this.$route.query.id) { if (this.$route.query.id) {
this.componentName = this.$route.query?.type this.componentName = this.$route.query?.type
this.params = {id: this.$route.query?.id} this.params = {id: this.$route.query?.id}
@@ -73,6 +75,14 @@
}, },
methods: { methods: {
onAreaChange () {
if (this.currIndex === '0') {
this.$nextTick(() => {
this.$refs[this.currIndex][0].getList()
})
}
},
onChange (data) { onChange (data) {
if (data.type === 'list') { if (data.type === 'list') {
this.componentName = 'List' this.componentName = 'List'

View File

@@ -56,7 +56,8 @@
props: { props: {
instance: Function, instance: Function,
dict: Object dict: Object,
areaId: String
}, },
data () { data () {
@@ -115,7 +116,8 @@
getList() { getList() {
this.instance.post(`/app/appvillageactivityinfo/list`, null, { this.instance.post(`/app/appvillageactivityinfo/list`, null, {
params: { params: {
...this.search ...this.search,
areaId: this.areaId
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {

View File

@@ -23,7 +23,7 @@
node-key="id" node-key="id"
:data="areaTree" :data="areaTree"
highlight-current highlight-current
:current-node-key="search.areaId" :current-node-key="areaId"
:default-expanded-keys="defaultExpanded" :default-expanded-keys="defaultExpanded"
:default-checked-keys="defaultChecked" :default-checked-keys="defaultChecked"
@current-change="onTreeChange"> @current-change="onTreeChange">
@@ -44,6 +44,7 @@
v-model="time1" v-model="time1"
type="month" type="month"
size="small" size="small"
:clearable="false"
@change="getInfo" @change="getInfo"
value-format="yyyy-MM" value-format="yyyy-MM"
placeholder="请选择月份"> placeholder="请选择月份">
@@ -87,19 +88,18 @@
</template> </template>
</ai-card> </ai-card>
<ai-card title="村民参与活动记录"> <ai-card title="村民参与活动记录">
<template #right>
<el-date-picker
v-model="time2"
type="month"
size="small"
:clearable="false"
@change="getInfo"
value-format="yyyy-MM"
placeholder="请选择月份">
</el-date-picker>
</template>
<template #content> <template #content>
<ai-search-bar class="search-bar" bottomBorder>
<template slot="left">
<el-date-picker
v-model="time2"
type="month"
size="small"
@change="getInfo"
value-format="yyyy-MM"
placeholder="请选择月份">
</el-date-picker>
</template>
</ai-search-bar>
<ai-table <ai-table
style="margin-top: 12px;" style="margin-top: 12px;"
:border="true" :border="true"
@@ -107,19 +107,9 @@
:total="total" :total="total"
:tableData="list" :tableData="list"
:col-configs="colConfigs" :col-configs="colConfigs"
:current.sync="search.current"
:size.sync="search.size"
:isShowPagination="false" :isShowPagination="false"
:stripe="false" :stripe="false"
@getList="getInfo"> @getList="getInfo">
<el-table-column slot="options" width="220px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="id = row.id, form.categoryName = row.categoryName">编辑</el-button>
<el-button type="text" @click="removeCate(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table> </ai-table>
</template> </template>
</ai-card> </ai-card>
@@ -154,24 +144,18 @@
total: 0, total: 0,
colConfigs: [ colConfigs: [
{ prop: 'name', label: '姓名', align: 'left' }, { prop: 'name', label: '姓名', align: 'left' },
{ prop: 'gender', label: '性别', align: 'center' }, { prop: 'gender', label: '性别', align: 'center', formart: v => this.dict.getLabel('sex', v) },
{ prop: 'number1', label: '报名次数', align: 'center' }, { prop: 'num1', label: '报名次数', align: 'center' },
{ prop: 'number2', label: '发布动态条数', align: 'center' } { prop: 'num2', label: '发布动态条数', align: 'center' }
], ],
time1: '', time1: '',
time2: '', time2: '',
chart2: '', chart2: '',
areaId: '',
currIndex: -1, currIndex: -1,
list: [], list: [],
areaList: [], areaList: [],
unitName: '', unitName: '',
search: { areaId: ''
current: 1,
areaId: '',
size: 10,
name: ''
}
} }
}, },
@@ -186,7 +170,9 @@
}, },
mounted () { mounted () {
this.search.areaId = this.user.info.areaId this.time1 = this.$moment(new Date()).format('YYYY-MM')
this.time2 = this.$moment(new Date()).format('YYYY-MM')
this.areaId = this.user.info.areaId
this.areaName = this.user.info.areaName this.areaName = this.user.info.areaName
this.getTree() this.getTree()
this.getAreaList() this.getAreaList()
@@ -195,7 +181,10 @@
this.chart1 = echarts.init(document.querySelector('.chart1')) this.chart1 = echarts.init(document.querySelector('.chart1'))
this.chart2 = echarts.init(document.querySelector('.chart2')) this.chart2 = echarts.init(document.querySelector('.chart2'))
window.addEventListener('resize', this.onResize) window.addEventListener('resize', this.onResize)
this.getInfo()
this.dict.load('sex').then(() => {
this.getInfo()
})
}) })
}, },
@@ -209,9 +198,8 @@
}, },
onTreeChange (e) { onTreeChange (e) {
this.search.areaId = e.id this.areaId = e.id
this.areaName = e.name this.areaName = e.name
this.search.current = 1
this.$nextTick(() => { this.$nextTick(() => {
this.getInfo() this.getInfo()
@@ -234,7 +222,7 @@
}).filter(e => !e.parentid)[0] }).filter(e => !e.parentid)[0]
this.defaultExpanded = [parent.id] this.defaultExpanded = [parent.id]
this.defaultChecked = [parent.id] this.defaultChecked = [parent.id]
this.search.areaId = parent.id this.areaId = parent.id
this.addChild(parent, res.data) this.addChild(parent, res.data)
this.areaTree = [parent] this.areaTree = [parent]
@@ -267,7 +255,7 @@
getInfo () { getInfo () {
this.loading = true this.loading = true
this.instance.post(`/app/appvillageactivityinfo/statistic?time1=${this.time1}&time2=${this.time2}`).then(res => { this.instance.post(`/app/appvillageactivityinfo/statistic?areaId=${this.areaId}&time1=${this.time1 || ''}&time2=${this.time2 || '-'}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.info = res.data.total this.info = res.data.total
this.initChart1(res.data.twelve) this.initChart1(res.data.twelve)