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

@@ -23,7 +23,7 @@
node-key="id"
:data="areaTree"
highlight-current
:current-node-key="search.areaId"
:current-node-key="areaId"
:default-expanded-keys="defaultExpanded"
:default-checked-keys="defaultChecked"
@current-change="onTreeChange">
@@ -107,19 +107,9 @@
:total="total"
:tableData="list"
:col-configs="colConfigs"
:current.sync="search.current"
:size.sync="search.size"
:isShowPagination="false"
:stripe="false"
@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>
</template>
</ai-card>
@@ -154,24 +144,18 @@
total: 0,
colConfigs: [
{ prop: 'name', label: '姓名', align: 'left' },
{ prop: 'gender', label: '性别', align: 'center' },
{ prop: 'number1', label: '报名次数', align: 'center' },
{ prop: 'number2', label: '发布动态条数', align: 'center' }
{ prop: 'gender', label: '性别', align: 'center', formart: v => this.dict.getLabel('sex', v) },
{ prop: 'num1', label: '报名次数', align: 'center' },
{ prop: 'num2', label: '发布动态条数', align: 'center' }
],
time1: '',
time2: '',
chart2: '',
areaId: '',
currIndex: -1,
list: [],
areaList: [],
unitName: '',
search: {
current: 1,
areaId: '',
size: 10,
name: ''
}
areaId: ''
}
},
@@ -186,7 +170,7 @@
},
mounted () {
this.search.areaId = this.user.info.areaId
this.areaId = this.user.info.areaId
this.areaName = this.user.info.areaName
this.getTree()
this.getAreaList()
@@ -195,7 +179,10 @@
this.chart1 = echarts.init(document.querySelector('.chart1'))
this.chart2 = echarts.init(document.querySelector('.chart2'))
window.addEventListener('resize', this.onResize)
this.getInfo()
this.dict.load('sex').then(() => {
this.getInfo()
})
})
},
@@ -209,9 +196,8 @@
},
onTreeChange (e) {
this.search.areaId = e.id
this.areaId = e.id
this.areaName = e.name
this.search.current = 1
this.$nextTick(() => {
this.getInfo()
@@ -234,7 +220,7 @@
}).filter(e => !e.parentid)[0]
this.defaultExpanded = [parent.id]
this.defaultChecked = [parent.id]
this.search.areaId = parent.id
this.areaId = parent.id
this.addChild(parent, res.data)
this.areaTree = [parent]
@@ -267,7 +253,7 @@
getInfo () {
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) {
this.info = res.data.total
this.initChart1(res.data.twelve)