Browse Source

Merge branch 'dev-shuju' into prod

shibei_master
13176889840 4 years ago
parent
commit
49022d7c85
  1. 115
      src/views/modules/visual/measure/volunteer.vue

115
src/views/modules/visual/measure/volunteer.vue

@ -1,5 +1,20 @@
<template> <template>
<div class="warning-box"> <div class="warning-box">
<cpt-card >
<div class="card-title">
<img class="title-icon" src="../../../../assets/img/shuju/title-tip.png" />
<div class="title-label">
<el-cascader
v-model="selectAgency"
:options="propTree"
:props="{ checkStrictly: true }"
:show-all-levels="false"
clearable
@change="handleCascader">
</el-cascader>
</div>
</div>
<div class="box-wr">
<cpt-card class="card-wr"> <cpt-card class="card-wr">
<div class="card-title"> <div class="card-title">
<img class="title-icon" <img class="title-icon"
@ -94,6 +109,8 @@
</cpt-card> </cpt-card>
</div> </div>
</cpt-card>
</div>
</template> </template>
<script> <script>
@ -129,6 +146,8 @@ export default {
// [1,'','','2',''], // [1,'','','2',''],
], ],
value2: '', value2: '',
selectAgency: '',
propTree: [],
visibleLoading: true, visibleLoading: true,
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -163,12 +182,13 @@ export default {
}, },
async mounted () { async mounted () {
await nextTick(100); await nextTick(100);
this.getPie() await this.getAgencyList()
this.getPie(this.$store.state.user.agencyId)
// this.initCharts() // this.initCharts()
// this.initCount() // this.initCount()
await this.getWorkUserInfo() await this.getWorkUserInfo()
await this.getMapUnitList() await this.getMapUnitList(this.$store.state.user.agencyId)
}, },
methods: { methods: {
initCharts (total, data) { initCharts (total, data) {
@ -286,12 +306,12 @@ export default {
option && _charts.setOption(option); option && _charts.setOption(option);
}, },
async getPie () { async getPie (agencyId) {
const url = "/data/report/heart/demand/volunteer/service"; const url = "/data/report/heart/demand/volunteer/service";
// let params = { let params = {
// agencyId: this.$store.state.user.agencyId, agencyId,
// }; };
const { data, code, msg } = await requestPost(url); const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
console.log('data-ddd', data) console.log('data-ddd', data)
this.vInfo = data this.vInfo = data
@ -317,7 +337,7 @@ export default {
}, { }, {
name: '居民数量', name: '居民数量',
value: data.resiServiceTotal, value: data.resiServiceTotal,
temStyle: { itemStyle: {
color: 'rgba(250, 193, 38, 1)' color: 'rgba(250, 193, 38, 1)'
} }
}] }]
@ -331,6 +351,52 @@ export default {
this.$message.error(msg) this.$message.error(msg)
} }
}, },
async getAgencyList() {
// const url = "/gov/org/customeragency/staffinagencylist";
const url = '/gov/org/customeragency/agencygridtree'
// let params = {
// agencyId: this.$store.state.user.agencyId,
// };
const { data, code, msg } = await requestPost(url);
if (code === 0) {
console.log('data-org----o', data)
this.selectAgency = [`${data.agencyId}-${data.level}`]
let arr = []
arr.push(data)
this.propTree = arr && this.getTreeData(arr)
} else {
this.$message.error(msg)
}
},
getTreeData(data){
if (!Array.isArray(data)) return []
let arr = data.map(item => {
let _item = {}
if (item.subAgencyList) {
if (item.subAgencyList.length === 0) {
_item = {
label: item.agencyName,
value: item.agencyId + '-' + item.level,
level: item.level,
children: undefined
}
} else _item = {
label: item.agencyName,
value: item.agencyId + '-' + item.level,
level: item.level,
children: this.getTreeData(item.subAgencyList)}
} else {
_item = {
label: item.agencyName,
value: item.agencyId + '-' + item.level,
level: item.level,
}
}
return _item
})
return arr
},
// //
pageSizeChangeHandleNew (val) { pageSizeChangeHandleNew (val) {
this.pageNo = 1; this.pageNo = 1;
@ -370,12 +436,13 @@ export default {
// //
async getMapUnitList () { async getMapUnitList (agencyId) {
const url = "/epmetuser/volunteer/distribution" const url = "/epmetuser/volunteer/distribution"
// const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution" // const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution"
let params = { let params = {
customerId: this.$store.state.user.customerId customerId: this.$store.state.user.customerId,
agencyId
} }
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)
@ -427,7 +494,17 @@ export default {
}, },
handleCascader(val) {
console.log('val-vvv', val)
if (val.length > 0) {
const _arr = val[val.length - 1].split('-')
const orgType = _arr[1] !== 'grid' ? 'agency': 'grid'
// this.getServicePie(_arr[0], orgType)
this.getPie(_arr[0])
this.getMapUnitList(_arr[0])
}
},
// //
loadMap () { loadMap () {
if (this.isfirstInit) { if (this.isfirstInit) {
@ -534,7 +611,10 @@ export default {
></style> ></style>
<style lang="scss" scoped> <style lang="scss" scoped>
.warning-box { .warning-box {
// display: flex;
.box-wr {
display: flex; display: flex;
}
.card-wr { .card-wr {
flex: 1; flex: 1;
} }
@ -547,6 +627,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
margin-bottom: 10px;
.title-icon { .title-icon {
display: block; display: block;
width: 36px; width: 36px;
@ -557,6 +638,20 @@ export default {
.title-label { .title-label {
font-size: 16px; font-size: 16px;
font-weight: 800; font-weight: 800;
::v-deep .el-input {
width: 180px;
.el-input__inner {
font-size: 20px;
font-weight: 800;
color: #fff;
background: transparent;
border: 0;
}
.el-icon-arrow-down::before {
content: "\e790";
}
}
} }
::v-deep .el-dropdown { ::v-deep .el-dropdown {
font-size: 16px; font-size: 16px;

Loading…
Cancel
Save