Browse Source

多元化地图

shibei_master
jiangyy 4 years ago
parent
commit
de0c892382
  1. 255
      src/views/modules/visual/measure/volunteer.vue

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

@ -2,7 +2,8 @@
<div class="warning-box"> <div class="warning-box">
<cpt-card class="card-wr"> <cpt-card class="card-wr">
<div class="card-title"> <div class="card-title">
<img class="title-icon" src="../../../../assets/img/shuju/title-tip.png" /> <img class="title-icon"
src="../../../../assets/img/shuju/title-tip.png" />
<div class="title-label"> <div class="title-label">
志愿者服务情况 志愿者服务情况
</div> </div>
@ -26,11 +27,12 @@
</div> </div>
<div class="echart-wr"> <div class="echart-wr">
<!-- <div class="echart-cicle"></div> --> <!-- <div class="echart-cicle"></div> -->
<div id="echartService" class="echart-org"></div> <div id="echartService"
class="echart-org"></div>
</div> </div>
</div> </div>
</div> </div>
<div class="card-echart"> <div class="card-echart">
@ -51,17 +53,19 @@
</div> </div>
<div class="echart-wr"> <div class="echart-wr">
<!-- <div class="echart-cicle"></div> --> <!-- <div class="echart-cicle"></div> -->
<div id="echartCount" class="echart-org"></div> <div id="echartCount"
class="echart-org"></div>
</div> </div>
</div> </div>
</div> </div>
</cpt-card> </cpt-card>
<cpt-card class="card-wr"> <cpt-card class="card-wr card-wr-map">
<div class="card-title"> <div class="card-title">
<img class="title-icon" src="../../../../assets/img/shuju/title-tip.png" /> <img class="title-icon"
src="../../../../assets/img/shuju/title-tip.png" />
<div class="title-label"> <div class="title-label">
多元化治理平面图 多元化治理平面图
</div> </div>
@ -91,7 +95,10 @@
</div> </div>
<div class="card-map"> <div class="card-map">
这里是地图容器 <screen-map class="map"
ref="map"
@clickFeature="clickProject"
:showIconLayer="true"></screen-map>
</div> </div>
</cpt-card> </cpt-card>
@ -103,6 +110,7 @@ import { requestPost } from "@/js/dai/request";
import screenTable from "../components/screen-table/index"; import screenTable from "../components/screen-table/index";
import cptCard from "@/views/modules/visual/cpts/card"; import cptCard from "@/views/modules/visual/cpts/card";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import screenMap from "@/views/modules/visual/components/screen-map";
import * as echarts from 'echarts'; import * as echarts from 'echarts';
export default { export default {
@ -110,8 +118,9 @@ export default {
components: { components: {
cptCard, cptCard,
screenTable, screenTable,
screenMap
}, },
data() { data () {
return { return {
warningList: [], warningList: [],
headerList: [ headerList: [
@ -135,16 +144,62 @@ export default {
total: 0, total: 0,
activeIndex: 0, activeIndex: 0,
activeLevel: "1", activeLevel: "1",
//
isfirstInit: true,//
agencyInfo: {},//level
unitMapList: [],
unitMapList1: [
{
type: '党建楼宇',
name: '建联单位1',
latitude: 36.062227,
longitude: 120.389455,
},
{
type: '党建楼宇',
name: '建联单位2',
latitude: 36.082227,
longitude: 120.389455,
},
{
type: '机关直属部门',
name: '建联单位3',
latitude: 36.062227,
longitude: 120.379455,
},
{
type: '两新党建',
name: '建联单位4',
latitude: 36.082227,
longitude: 120.379455,
},
{
type: '辖区单位',
name: '建联单位5',
latitude: 36.092227,
longitude: 120.379455,
},
{
type: '其他',
name: '建联单位6',
latitude: 36.102227,
longitude: 120.379455,
}
],
}; };
}, },
async mounted() { async mounted () {
await nextTick(100); await nextTick(100);
this.initCharts() this.initCharts()
this.initCount() this.initCount()
this.getBuildingwarnlist(); this.getBuildingwarnlist();
await this.getWorkUserInfo()
await this.getMapUnitList()
}, },
methods: { methods: {
initCharts() { initCharts () {
const eId = document.getElementById('echartService') const eId = document.getElementById('echartService')
let _charts = echarts.init(eId) let _charts = echarts.init(eId)
let option = { let option = {
@ -192,21 +247,21 @@ export default {
fontWeight: 'bold' fontWeight: 'bold'
} }
}, },
data: [ data: [
{ {
value: 104, value: 104,
name: '党员', name: '党员',
itemStyle: { itemStyle: {
color: 'rgba(26, 178, 255, 1)' color: 'rgba(26, 178, 255, 1)'
} }
}, },
{ {
value: 735, value: 735,
name: '居民', name: '居民',
itemStyle: { itemStyle: {
color: 'rgba(250, 193, 38, 1)' color: 'rgba(250, 193, 38, 1)'
} }
} }
] ]
} }
@ -215,7 +270,7 @@ export default {
option && _charts.setOption(option); option && _charts.setOption(option);
}, },
initCount() { initCount () {
const eId = document.getElementById('echartCount') const eId = document.getElementById('echartCount')
let _charts = echarts.init(eId) let _charts = echarts.init(eId)
let option = { let option = {
@ -266,21 +321,21 @@ export default {
fontWeight: 'bold' fontWeight: 'bold'
} }
}, },
data: [ data: [
{ {
value: 1048, value: 1048,
name: '党员', name: '党员',
itemStyle: { itemStyle: {
color: 'rgba(26, 178, 255, 1)' color: 'rgba(26, 178, 255, 1)'
} }
}, },
{ {
value: 735, value: 735,
name: '居民', name: '居民',
itemStyle: { itemStyle: {
color: 'rgba(250, 193, 38, 1)' color: 'rgba(250, 193, 38, 1)'
} }
} }
] ]
} }
@ -289,15 +344,15 @@ export default {
option && _charts.setOption(option); option && _charts.setOption(option);
}, },
onClickList(index, level) { onClickList (index, level) {
this.activeIndex = index; this.activeIndex = index;
this.activeLevel = level; this.activeLevel = level;
this.pageNo = 1; this.pageNo = 1;
this.getUserwarnlist(); this.getUserwarnlist();
}, },
// //
async getUserwarnlist() { async getUserwarnlist () {
const { activeIndex, activeLevel, warningList } = this; const { activeIndex, activeLevel, warningList } = this;
const reqItem = warningList[activeIndex]; const reqItem = warningList[activeIndex];
let tableData = []; let tableData = [];
@ -323,7 +378,7 @@ export default {
} }
}, },
// //
async getBuildingwarnlist() { async getBuildingwarnlist () {
const url = "/epmetuser/statsresiwarn/buildingwarnlist"; const url = "/epmetuser/statsresiwarn/buildingwarnlist";
let params = { let params = {
agencyId: this.$store.state.user.agencyId, agencyId: this.$store.state.user.agencyId,
@ -336,14 +391,109 @@ export default {
} else { } else {
} }
}, },
pageSizeChangeHandleNew(val) { pageSizeChangeHandleNew (val) {
this.pageNo = 1; this.pageNo = 1;
this.pageSize = val; this.pageSize = val;
}, },
pageCurrentChangeHandleNew(val) { pageCurrentChangeHandleNew (val) {
this.pageNo = val; this.pageNo = val;
this.getUserwarnlist(); this.getUserwarnlist();
}, },
//
getWorkUserInfo () {
const url = '/epmetuser/customerstaff/staffbasicinfo'
let params = {}
window.app.ajax.post(
url,
params,
(data, rspMsg) => {
this.agencyInfo = data
if (!data.latitude) {
this.agencyInfo.latitude = 36.072227
}
if (!data.longitude) {
this.agencyInfo.longitude = 120.389455
}
if (!data.level) {
this.agencyInfo.level = 'street'
}
},
(rspMsg, data) => {
this.$message.error(rspMsg)
}
)
},
//
async getMapUnitList () {
// const url = "/heart/icpartyunit/distribution"
const url = "http://yapi.elinkservice.cn/mock/245/heart/icpartyunit/distribution"
let params = {
agencyId: this.$store.state.user.agencyId
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
// this.unitMapList = data
this.unitMapList = this.unitMapList1
this.unitMapList.forEach(item => {
if (item.type === '党建楼宇') {
item.urlIndex = 0
} else if (item.type === '两新党建') {
item.urlIndex = 1
} else if (item.type === '辖区单位') {
item.urlIndex = 2
} else if (item.type === '机关直属部门') {
item.urlIndex = 3
} else if (item.type === '其他') {
item.urlIndex = 4
}
});
this.iconUrlArray = [
require('../../../../assets/img/shuju/measure/ly@2x.png'),//
require('../../../../assets/img/shuju/measure/jgzs@2x.png'),//
require('../../../../assets/img/shuju/measure/lxdj@2x.png'),//
require('../../../../assets/img/shuju/measure/xq@2x.png'),//
require('../../../../assets/img/shuju/measure/qita.png')//
]
//false
this.loadMap()
this.isfirstInit = false
} else {
this.$message.error(msg)
}
},
//
loadMap () {
if (this.isfirstInit) {
//mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray
this.$refs.map.loadMap(this.agencyInfo, null, null, this.unitMapList, this.iconUrlArray, null)
} else {
this.$refs.map.refreshMap(null, this.unitMapList)
}
},
//
clickProject (feature) {
console.log('标注信息', feature.values_.properties)
},
}, },
}; };
</script> </script>
@ -383,12 +533,11 @@ export default {
color: #fff; color: #fff;
font-weight: 800; font-weight: 800;
} }
} }
.card-echart { .card-echart {
display: flex; display: flex;
margin-top: 40px; margin-top: 40px;
.card-left { .card-left {
position: relative; position: relative;
flex: 1; flex: 1;
@ -432,7 +581,8 @@ export default {
box-sizing: border-box; box-sizing: border-box;
margin-top: 20px; margin-top: 20px;
// padding-left: 192px; // padding-left: 192px;
background: url('../../../../assets/img/shuju/measure/dangyuan.png') center no-repeat; background: url("../../../../assets/img/shuju/measure/dangyuan.png") center
no-repeat;
background-size: cover; background-size: cover;
.card-count-content { .card-count-content {
position: relative; position: relative;
@ -447,14 +597,14 @@ export default {
.card-count-label { .card-count-label {
margin-top: 6px; margin-top: 6px;
font-size: 16px; font-size: 16px;
color: rgba(255, 255, 255, .72); color: rgba(255, 255, 255, 0.72);
} }
} }
.card-count-content::after { .card-count-content::after {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 0; left: 0;
content: ''; content: "";
width: 1px; width: 1px;
height: 50px; height: 50px;
margin-top: -25px; margin-top: -25px;
@ -462,7 +612,8 @@ export default {
} }
} }
.card-count-item:last-child { .card-count-item:last-child {
background: url('../../../../assets/img/shuju/measure/jumin.png') center no-repeat; background: url("../../../../assets/img/shuju/measure/jumin.png") center
no-repeat;
} }
} }
@ -472,6 +623,7 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
padding-top: 10px; padding-top: 10px;
padding-bottom: 20px; padding-bottom: 20px;
.map-tips-item { .map-tips-item {
display: flex; display: flex;
align-items: center; align-items: center;
@ -482,7 +634,7 @@ export default {
height: 10px; height: 10px;
box-sizing: border-box; box-sizing: border-box;
margin-right: 10px; margin-right: 10px;
background: #DD2719; background: #dd2719;
border-radius: 2px; border-radius: 2px;
} }
.map-tips-label { .map-tips-label {
@ -492,4 +644,17 @@ export default {
} }
} }
.card-wr-map {
height: calc(100vh - 110px);
.card-map {
width: 100%;
height: calc(100vh - 255px);
.map {
width: 100%;
height: 100%;
}
}
}
</style> </style>

Loading…
Cancel
Save