Browse Source

地图

shibei_prod
jiangyy 4 years ago
parent
commit
6f554a260a
  1. 4
      .env.development
  2. 4
      .env.production.sit
  3. 6
      public/index.html
  4. BIN
      src/assets/img/shuju/weiwanjie.png
  5. BIN
      src/assets/img/shuju/yiwanjie.png
  6. 67
      src/assets/scss/modules/visual/processAnalyze.scss
  7. 135
      src/assets/scss/modules/visual/typeAnalyze.scss
  8. 182
      src/views/modules/visual/communityGovern/processAnalyze.vue
  9. 646
      src/views/modules/visual/communityGovern/typeAnalyze.vue
  10. 179
      src/views/modules/visual/communityGovern/typePieOption.js
  11. 107
      src/views/modules/visual/components/screen-map/index.vue

4
.env.development

@ -1,6 +1,6 @@
NODE_ENV=development NODE_ENV=development
# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
VUE_APP_API_SERVER = http://192.168.1.140/api # VUE_APP_API_SERVER = http://192.168.1.140/api
# VUE_APP_API_SERVER = http://192.168.51.36:8080/api # VUE_APP_API_SERVER = http://192.168.51.36:8080/api
# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api # VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api
VUE_APP_NODE_ENV=dev VUE_APP_NODE_ENV=dev

4
.env.production.sit

@ -1,5 +1,5 @@
NODE_ENV=production NODE_ENV=production
# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api
VUE_APP_API_SERVER = http://192.168.1.140/api # VUE_APP_API_SERVER = http://192.168.1.140/api
VUE_APP_NODE_ENV=prod:sit VUE_APP_NODE_ENV=prod:sit
VUE_APP_PUBLIC_PATH=epmet-oper VUE_APP_PUBLIC_PATH=epmet-oper

6
public/index.html

@ -36,9 +36,9 @@
<!-- 开发环境 --> <!-- 开发环境 -->
<% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %> <% if (process.env.VUE_APP_NODE_ENV==='dev' ) { %>
<script> <script>
window.SITE_CONFIG['apiURL'] = 'http://192.168.1.140/api' // window.SITE_CONFIG['apiURL'] = 'http://192.168.1.140/api'
// window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api' window.SITE_CONFIG['apiURL'] = 'https://epmet-test.elinkservice.cn/api'
// window.SITE_CONFIG['apiURL'] = 'http://118.190.150.119:41080/api' // window.SITE_CONFIG['apiURL'] = 'http://118.190.150.119:41080/api'
// window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api' // window.SITE_CONFIG['apiURL'] = 'https://epmet-dev.elinkservice.cn/api'
</script> </script>
<% } %> <% } %>

BIN
src/assets/img/shuju/weiwanjie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
src/assets/img/shuju/yiwanjie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

67
src/assets/scss/modules/visual/processAnalyze.scss

@ -63,7 +63,7 @@
.g-cpt-resi { .g-cpt-resi {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
height: calc(100vh - 170px); height: calc(100vh - 180px);
.g-l { .g-l {
flex-shrink: 0; flex-shrink: 0;
@ -87,8 +87,8 @@
.g-r { .g-r {
text-align: center; text-align: center;
margin: 20px 19px 20px; margin: 20px 10px 20px;
width: calc(100vw - 40px - 800px); width: calc(100vw - 700px);
height: calc(100vh - 180px - 20px); height: calc(100vh - 180px - 20px);
} }
} }
@ -172,10 +172,67 @@
} }
.g-r { .g-r {
.m-map { .r-map {
position: relative; position: relative;
height: 100%; height: calc(100vh - 180px - 20px - 70px);
width: 100%; width: 100%;
.map {
height: 100%;
width: 100%;
}
.r-status {
position: absolute;
bottom: 0;
right: 0;
display: flex;
.status {
height: 30px;
width: 70px;
line-height: 30px;
font-size: 12px;
font-family: PingFang SC;
font-weight: 400;
color: #d2e7ff;
background-color: #1146c2;
}
.status-closed {
border-radius: 5px 0 0 0;
}
.status-pending {
}
.sel-status {
background-color: #082586;
}
}
}
.r-legend {
display: flex;
justify-content: center;
margin-top: 14px;
align-items: center;
> img {
margin-left: 58px;
height: 35px;
width: 40px;
}
> span {
margin-left: 3px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 400;
color: #d2e7ff;
}
}
.r-legend:hover {
cursor: pointer;
} }
} }

135
src/assets/scss/modules/visual/typeAnalyze.scss

@ -0,0 +1,135 @@
@import '../../c/config';
@import '../../c/function';
@import './c/common';
.title {
padding: 10px;
font-size: 22px;
font-family: PingFang SC;
font-weight: 800;
color: #ffffff;
display: flex;
align-items: center;
position: relative;
img {
display: block;
margin-right: 5px;
}
span {
display: block;
}
.second-select {
margin: 0 10px 0 40px;
::v-deep .el-input {
width: 140px;
height: 36px;
.el-input__inner {
height: 100%;
padding: 0 10px;
color: #fff;
line-height: 36px;
background: #06186d;
border: 1px solid #1a64cc;
}
.el-icon-arrow-up:before {
content: '\e78f';
}
}
::v-deep .el-date-editor {
.el-input__prefix {
left: unset;
right: 5px;
}
}
}
.cascader {
::v-deep .el-input {
width: 220px;
}
}
.status-select {
position: absolute;
top: 20px;
right: 10px;
}
.second-select:last-child {
margin-left: 0;
}
}
.g-cpt-resi {
display: flex;
flex-direction: row;
// flex-wrap: wrap;
// justify-content: center;
height: calc(100vh - 130px);
.g-l {
flex-shrink: 0;
width: 600px;
height: calc(100vh - 190px);
}
.g-r {
text-align: center;
margin: 40px 19px 20px;
width: calc(100vw - 60px - 600px);
height: calc(100vh - 140px - 20px);
}
}
.g-r {
.tb {
position: relative;
height: calc(100vh - 220px);
overflow-y: auto;
@include scrollBar;
.m-pagination {
position: absolute;
box-sizing: border-box;
right: 0;
bottom: 0;
width: 100%;
height: 40px;
display: flex;
justify-content: flex-end;
/deep/ .el-pagination.is-background .el-pager li:not(.disabled).active {
background: #0266d1;
color: #000d3f;
}
/deep/ .el-pagination .el-pager li {
background: #002e74;
}
/deep/ .el-pagination .btn-prev {
background: #002e74;
}
/deep/ .el-pagination .btn-next {
background: #002e74;
}
}
}
}
.echart-wr {
margin-left: 30px;
// margin-top: 100px;
text-align: center;
position: relative;
width: 500px;
height: 100%;
box-sizing: border-box;
.echart-org {
width: 100%;
height: 90%;
}
}

182
src/views/modules/visual/communityGovern/processAnalyze.vue

@ -54,11 +54,29 @@
</div> </div>
</div> </div>
<div class="g-r"> <div class="g-r">
<div class="r-map">
<screen-map class="map"
ref="map"
@clickFeature="clickProject"
:showIconLayer="true"></screen-map>
<div class="r-status">
<div :class="['status', 'status-closed', {'sel-status':status==='closed'}]"
@click="handleChangeStatus('closed')">已完结</div>
<div :class="['status', 'status-pending', {'sel-status':status==='pending'}]"
@click="handleChangeStatus('pending')">未完结</div>
</div>
<div class="r-legend">
<img style=""
src="@/assets/img/shuju/yiwanjie.png"
mode="aspectFill" />
<span>已完结</span>
<img src="@/assets/img/shuju/weiwanjie.png"
mode="aspectFill" />
<span>未完结</span>
</div>
<screen-map class="m-map" </div>
ref="map"
:showIconLayer="true"></screen-map>
</div> </div>
</div> </div>
</cpt-card> </cpt-card>
@ -66,6 +84,7 @@
<script> <script>
import { Loading } from "element-ui"; //Loading import { Loading } from "element-ui"; //Loading
import { Circle as CircleStyle, Icon, Fill, Stroke, Style, Text } from 'ol/style.js';
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import cptCard from "@/views/modules/visual/cpts/card"; import cptCard from "@/views/modules/visual/cpts/card";
import cptTb from "@/views/modules/visual/cpts/tb"; import cptTb from "@/views/modules/visual/cpts/tb";
@ -82,6 +101,7 @@ export default {
return { return {
showNoData: false, showNoData: false,
timer: null, timer: null,
isfirstInit: true,
projectTotal: 0, projectTotal: 0,
dateIncr: 0, dateIncr: 0,
@ -107,9 +127,51 @@ export default {
dateId: '', dateId: '',
agencyId: '', agencyId: '',
status: 'pending',//: pendingclosed status: 'closed',//: pendingclosed
agencyInfo: {}, agencyInfo: {},
projectList: [], projectList: [],
projectList1: [
{
agencyId: '',
projectId: '',
origin: '',
status: 'pending',
title: '南宁第二网格南宁第二网格',
latitude: 36.062227,
longitude: 120.389455,
},
{
agencyId: '',
projectId: '',
origin: '',
status: 'closed',
latitude: 36.082227,
longitude: 120.389455,
title: "南宁第二网格",
}
],
projectList2: [
{
agencyId: '',
projectId: '',
origin: '',
status: 'pending',
title: '山东路山东路',
latitude: 36.062227,
longitude: 120.379455,
},
{
agencyId: '',
projectId: '',
origin: '',
status: 'closed',
latitude: 36.082227,
longitude: 120.379455,
title: "山东路",
}
],
iconUrlArray: [],
iconTextStyle: {},
casOptions: [], casOptions: [],
agencyIdArray: [], agencyIdArray: [],
@ -149,7 +211,7 @@ export default {
await this.getProjectTotal() await this.getProjectTotal()
await this.loadProjectlist() await this.loadProjectlist()
await this.getLine() await this.getLine()
// await this.getTable();
}, },
// //
@ -247,60 +309,85 @@ export default {
if (code === 0) { if (code === 0) {
// this.projectList = [...data] // this.projectList = [...data]
if (this.status === 'closed') {
this.projectList = this.projectList1
} else {
this.projectList = this.projectList2
this.projectList = [ }
{ this.projectList.forEach(item => {
agencyId: '', item.values_ = {
projectId: '', name: item.title
origin: '',
status: '',
title: '南宁第二网格南宁第二网格',
latitude: 36.072227,
longitude: 120.389455,
},
{
agencyId: '',
projectId: '',
origin: '',
status: '',
latitude: 36.072227,
longitude: 120.389455,
title: "南宁第二网格",
},
{
agencyId: '',
projectId: '',
origin: '',
status: '',
id: "2a278c0ceb863359d263fda7aabf6742",
latitude: 36.072227,
longitude: 120.389455,
title: "南宁第一网格",
} }
if (item.title.length > 10) {
item.values_.name = item.title.substring(0, 9) + '...'
}
if (item.status === 'pending') {
item.urlIndex = 0
} else {
item.urlIndex = 1
}
});
this.iconUrlArray = [
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211209/0994757e8962405ca1cdf9792bf325e4.png',//
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211209/2a80f800b04442448c41a6ed4592cd95.png'//
] ]
let iconUrlArray = [
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a219130b6bc74b0b80b5ddb0fce0892a.png', this.iconTextStyle = {
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/a775d15e62374350b80e5cdf1912a4eb.png', textAlign: undefined,
'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20211116/884efcf6d6b44224a7fda599dd1b14cb.png' font: "15px Arial",
] //fontFamily: "Courier New, monospace",
//mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray // fontWeight: "bold",
this.$refs.map.loadMap(this.agencyInfo, null, null, this.projectList, iconUrlArray) text: '',
backgroundFill: new Fill({
color: "#194160",
}),
backgroundStroke: new Stroke({ color: "#2865FA", width: 2 }),
padding: [5, 10, 4, 10],
fill: new Fill({ color: "#ffffff" }),
// stroke: new Stroke({ color: "#2865FA", width: 3 }),
offsetY: -30,
offsetX: 50,
overflow: true,
}
//false
this.loadMap()
this.isfirstInit = false
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
loadMap () {
if (this.isfirstInit) {
//mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray
this.$refs.map.loadMap(this.agencyInfo, null, null, this.projectList, this.iconUrlArray, this.iconTextStyle)
} else {
this.$refs.map.refreshMap(null, this.projectList)
}
},
//
clickProject (feature) {
console.log('项目信息', feature.values_.properties)
},
pieInitOk (dom) { pieInitOk (dom) {
console.log('pie准备好了')
this.pieChartS = dom this.pieChartS = dom
this.pieInitState = true this.pieInitState = true
}, },
lineInitOk () { lineInitOk () {
console.log('pie准备好了')
this.lineInitState = true this.lineInitState = true
}, },
@ -431,12 +518,13 @@ export default {
this.$refs.pieChart.setOption(this.pieOption) this.$refs.pieChart.setOption(this.pieOption)
}, },
handleChangeState (index) { handleChangeStatus (status) {
// this.getTable() this.status = status
this.loadProjectlist()
}, },
handleChangeAgency (value) { handleChangeAgency (value) {
console.log(value)
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label
this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''
console.log(this.agencyIdArray) console.log(this.agencyIdArray)

646
src/views/modules/visual/communityGovern/typeAnalyze.vue

@ -1,241 +1,43 @@
<template> <template>
<div class="g-cpt"> <cpt-card>
<div class="g-l"> <div class="title">
<div class="m-people"> <img src="@/assets/img/shuju/title-tip.png" />
<cpt-card> <span>居民热议</span>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" /> <div class="second-select cascader">
<span>人员情况</span>
</div> <el-cascader class="customer_cascader"
<div class="more" ref="myCascader"
@click="showedMoreInfo = true">查看更多</div> v-model="agencyIdArray"
<div class="ren"> :key="iscascaderShow"
<img class="pic-ren" :options="casOptions"
src="@/assets/img/shuju/people/ren.png" /> :props="optionProps"
<div class="ren-name"> @change="handleChangeAgency"
<span>{{ info.name }}</span> clearable></el-cascader>
<img src="@/assets/img/shuju/people/arrow.png" />
</div>
<div class="ren-prop z-1">
<img src="@/assets/img/shuju/people/ren-prop-1.png" />
<span>所属网格</span>
<div class="ren-cnt">
<h5>所属网格</h5>
<p>
{{ info.gridName }}
</p>
</div>
</div>
<div class="ren-prop z-2">
<img src="@/assets/img/shuju/people/ren-prop-2.png" />
<span>人员类别</span>
<div class="ren-cnt">
<h5>人员类别</h5>
<p>
{{
info.personCategory.length == 0
? "--"
: info.personCategory.join("、")
}}
</p>
</div>
</div>
<div class="ren-prop z-3">
<img src="@/assets/img/shuju/people/ren-prop-3.png" />
<span>工作单位</span>
<div class="ren-cnt">
<h5>工作单位</h5>
<p>
{{ info.workUnit || "--" }}
</p>
</div>
</div>
<div class="ren-prop z-4">
<img src="@/assets/img/shuju/people/ren-prop-4.png" />
<span>志愿者类别</span>
<div class="ren-cnt">
<h5>志愿者类别</h5>
<p>
{{
info.volunteerCategory.length == 0
? "--"
: info.volunteerCategory.join("、")
}}
</p>
</div>
</div>
<div class="ren-prop z-5">
<img src="@/assets/img/shuju/people/ren-prop-5.png" />
<span>房屋信息</span>
<div class="ren-cnt">
<h5>房屋信息</h5>
<p>
{{
info.houseInfo.length == 0
? "--"
: info.houseInfo.join("、")
}}
</p>
</div>
</div>
<div class="ren-prop z-6">
<img src="@/assets/img/shuju/people/ren-prop-6.png" />
<span>经济状况</span>
<div class="ren-cnt">
<h5>经济状况</h5>
<p>
月薪:
{{
info.financialSituation.monthlyIncome || "--"
}}退休金{{
info.financialSituation.retirementAmount || "--"
}}
</p>
</div>
</div>
</div>
</cpt-card>
</div> </div>
<div class="second-select status-select">
<el-select v-model="status"
:popper-append-to-body="false"
placeholder="请选择">
<el-option v-for="(item,index) in stateArray"
:key="item.value"
:label="item.label"
:value="item.value"
@click.native="handleChangeState(index)">
</el-option>
</el-select>
</div>
</div>
<people-more v-show="showedMoreInfo" <div class="g-cpt-resi">
v-if="userId" <div class="g-l">
:userId="userId" <screen-echarts-frame class="echart-wr"
:gridName="info.gridName" @myChartMethod="pieInitOk"
@close="showedMoreInfo = false" /> ref="pieChart"></screen-echarts-frame>
<div class="m-relation">
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<span>家庭关系</span>
</div>
<div class="info">
<div class="huzhu">
<img class="huzhu-bg"
src="@/assets/img/shuju/people/huzhu.png" />
<img class="huzhu-ico"
src="@/assets/img/shuju/people/huzhu-home.png" />
<div class="huzhu-name">{{ houseInfo.ownerName }}</div>
<p>户主</p>
</div>
<div class="rel z-zuo-2"
@click="toUserInfo(houseInfo.userList[0].userId)"
v-if="houseInfo.userList[0]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo2.png" />
<div class="rel-text"
:class="houseInfo.userList[0].isSelf == '1' ? 'z-on' : ''">
<span class="rel-call">{{
houseInfo.userList[0].relation
}}</span>
<span class="rel-name">{{ houseInfo.userList[0].userName }}</span>
</div>
</div>
<div class="rel z-you-2"
@click="toUserInfo(houseInfo.userList[1].userId)"
v-if="houseInfo.userList[1]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you2.png" />
<div class="rel-text"
:class="houseInfo.userList[1].isSelf == '1' ? 'z-on' : ''">
<span class="rel-call">{{
houseInfo.userList[1].relation
}}</span>
<span class="rel-name">{{ houseInfo.userList[1].userName }}</span>
</div>
</div>
<div class="rel z-zuo-1"
@click="toUserInfo(houseInfo.userList[2].userId)"
v-if="houseInfo.userList[2]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo1.png" />
<div class="rel-text"
:class="houseInfo.userList[2].isSelf == '1' ? 'z-on' : ''">
<span class="rel-call">{{
houseInfo.userList[2].relation
}}</span>
<span class="rel-name">{{ houseInfo.userList[2].userName }}</span>
</div>
</div>
<div class="rel z-you-1"
@click="toUserInfo(houseInfo.userList[3].userId)"
v-if="houseInfo.userList[3]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you1.png" />
<div class="rel-text"
:class="houseInfo.userList[3].isSelf == '1' ? 'z-on' : ''">
<span class="rel-call">{{
houseInfo.userList[3].relation
}}</span>
<span class="rel-name">{{ houseInfo.userList[3].userName }}</span>
</div>
</div>
<div class="rel z-zuo-3"
@click="toUserInfo(houseInfo.userList[4].userId)"
v-if="houseInfo.userList[4]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-zuo.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/zuo3.png" />
<div class="rel-text"
:class="houseInfo.userList[4].isSelf == '1' ? 'z-on' : ''">
<span class="rel-call">{{
houseInfo.userList[4].relation
}}</span>
<span class="rel-name">{{ houseInfo.userList[4].userName }}</span>
</div>
</div>
<div class="rel z-you-3"
@click="toUserInfo(houseInfo.userList[5].userId)"
v-if="houseInfo.userList[5]">
<img class="rel-bg"
src="@/assets/img/shuju/people/huzhu-kuang-you.png" />
<img class="rel-line"
src="@/assets/img/shuju/people/huzhu-line/you3.png" />
<div class="rel-text"
:class="houseInfo.userList[5].isSelf == '1' ? 'z-on' : ''">
<span class="rel-call">{{
houseInfo.userList[5].relation
}}</span>
<span class="rel-name">{{ houseInfo.userList[5].userName }}</span>
</div>
</div>
</div>
</cpt-card>
</div> </div>
</div> <div class="g-r">
<div class="g-r"> <div class="m-tb">
<div class="m-tb">
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<span>居民需求</span>
</div>
<div class="tb"> <div class="tb">
<cpt-tb :col-list="demand.colList" <cpt-tb :col-list="demand.colList"
@ -253,89 +55,94 @@
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</cpt-card>
</div>
<div class="m-row">
<div class="m-list">
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<span>上报事件</span>
</div>
<div class="list"></div>
</cpt-card>
</div> </div>
<div class="m-list">
<cpt-card>
<div class="title">
<img src="@/assets/img/shuju/title-tip.png" />
<span>积分记录</span>
</div>
<div class="list"></div>
</cpt-card>
</div>
</div> </div>
</div> </div>
</div> </cpt-card>
</template> </template>
<script> <script>
import { Loading } from "element-ui"; //Loading import { Loading } from "element-ui"; //Loading
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import cptCard from "@/views/modules/visual/cpts/card"; import cptCard from "@/views/modules/visual/cpts/card";
import peopleMore from "@/views/modules/visual/basicinfo/cpts/people-more";
import cptTb from "@/views/modules/visual/cpts/tb"; import cptTb from "@/views/modules/visual/cpts/tb";
import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame";
import { pieOption } from './resiPieOption.js'
export default { export default {
name: "HomeMap", name: "HomeMap",
data () { data () {
return { return {
showedMoreInfo: false, showNoData: false,
timer: null,
userId: "", pieChartS: null,
pieChart: '',
info: { pieOption: {},
financialSituation: { monthlyIncome: "", retirementAmount: "" }, pieInitState: false,
gridName: "", pieTotal: 0,
houseInfo: [], colorArray: [],
name: "", pieData: [
personCategory: [], { count: 1048, categoryName: '城市管理', color: '#1B51FF', selected: true },
volunteerCategory: [], { count: 735, categoryName: '为民服务', color: '#00E5ED' },
workUnit: "", { count: 580, categoryName: '安全监管', color: '#7800FF' },
}, { count: 484, categoryName: '民政', color: '#16D783' },
{ count: 300, categoryName: '环境保护', color: '#FF7800' },
houseInfo: { { count: 1048, categoryName: '建设管理', color: '#FFBA00' },
ownerName: "", { count: 735, categoryName: '街道吹哨部门报到', color: '#FFD685' },
userList: [ { count: 580, categoryName: '社会治安综合', color: '#2A00FF' },
// { { count: 484, categoryName: '公安交通管理', color: '#C600FF' },
// userId: "", { count: 300, categoryName: '卫生计生监管执法', color: '#FF2A00' },
// userName: "", { count: 484, categoryName: '民生', color: '#3DDA83' },
// isSelf: "", { count: 300, categoryName: '街道安全', color: '#FAC126' }
// relation: "", ],
// }, //voting shift_project closedall
], stateArray: [
}, {
label: '全部',
value: 'all'
},
{
label: '表决中',
value: 'voting'
},
{
label: '已转项目',
value: 'shift_project'
},
{
label: '已关闭',
value: 'closed'
},
],
status: 'all',
orgId: '',
demand: { demand: {
loading: true, loading: true,
colList: [ colList: [
{
align: "center",
width: "5%",
},
{ {
align: "center", align: "center",
width: "10%", width: "10%",
}, },
{ {
align: "center", align: "center",
width: "15%", width: "20%",
}, },
{ {
align: "center", align: "center",
width: "15%", width: "10%",
}, },
{ {
align: "center", align: "center",
width: "40%", width: "5%",
}, },
{ {
align: "center", align: "center",
@ -345,40 +152,49 @@ export default {
align: "center", align: "center",
width: "10%", width: "10%",
}, },
{
align: "center",
width: "15%",
},
{
align: "center",
width: "5%",
},
{
align: "center",
width: "5%",
},
{
align: "center",
width: "10%",
},
], ],
header: ["序号", "服务时间", "需求类型", "需求内容", "状态", "操作"], header: ["序号", "议题标题", "处理意见", "分类", "状态", "创建时间", "发起人", "已表态/应表态", "支持", "反对", "操作"],
list: [], list: [],
pageSize: 5, pageSize: 10,
pageNo: 1, pageNo: 1,
total: 0, total: 0,
},
};
},
props: { },
uid: {
type: String,
default: "",
// default: "8ada68cb6f1e4b9a8333348a39ef3aee",
},
},
computed: {}, casOptions: [],
agencyIdArray: [],
customerList: [],
iscascaderShow: 0,
optionProps: {
multiple: false,
value: 'agencyId',
label: 'agencyName',
children: 'subAgencyList',
checkStrictly: true
},
components: { };
cptCard,
peopleMore,
cptTb,
}, },
// mixins: [animate]
watch: { beforeDestroy () {
uid (id) { this.timer && clearInterval(this.timer)
this.userId = id;
},
userId () {
this.getApiData();
window.scrollTo(0, 0);
},
}, },
async mounted () { async mounted () {
@ -387,61 +203,162 @@ export default {
}, },
methods: { methods: {
handleSearch () { },
getApiData () { async getApiData () {
this.getInfo(); await this.getAgencylist()//
this.getHouseInfo(); await this.getPie()
this.getDemandData(); await this.getTable();
}, },
toUserInfo (uid) { async getAgencylist () {
this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); const url = '/gov/org/customeragency/agencylist'
}, // const url = 'http://yapi.elinkservice.cn/mock/102/gov/org/agency/agencylist'
// const params = {
async getInfo () { customerId: '613cc61a6b8ce4c70d21bd413dac72cc'
const url = "/epmetuser/icresiuser/persondata"; }
let params = { const { data, code, msg } = await requestPost(url, params)
userId: this.userId, if (code === 0) {
}; ++this.iscascaderShow
this.casOptions = []
this.agencyIdArray.length = []
const { data, code, msg } = await requestPost(url, params); if (data) {
this.casOptions.push(data)
}
if (code === 0) {
this.info = { ...this.info, ...data };
} else { } else {
this.$message.error(msg); this.$message.error(msg)
} }
}, },
//
async getHouseInfo () { pieInitOk (dom) {
const url = "/epmetuser/icresiuser/ownerrelation"; console.log('pie准备好了', dom)
this.pieChartS = dom
this.pieInitState = true
},
getPie () {
if (this.pieInitState) {
this.getPieChart()
} else {
setTimeout(() => {
this.getPie()
}, 500)
}
},
//
async getPieChart () {
this.$refs.pieChart.clear()
this.pieTotal = 0
const _that = this
// this.$refs.pieChart.showLoading()
// const url ="/gov/issue/issue/resibuzz-leftpiechart";
const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz-leftpiechart";
let params = { let params = {
userId: this.userId, orgId: this.orgId,
}; };
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
// pieChart
if (code === 0) { if (code === 0) {
this.houseInfo = { ...this.houseInfo, ...data }; // pieChart
this.pieOption = pieOption(this.pieChartS)
if (data && data.length > 0) {
// this.pieData = data
} else {
this.pieData = [{ count: 0, categoryName: '无分类', color: '#00E5ED' }]
}
this.pieData.forEach(item => {
item.name = item.categoryName
item.value = item.count
this.colorArray.push(item.color)
this.pieTotal = this.pieTotal + item.value
});
this.pieOption.title.text = this.pieTotal
this.pieOption.series[1].itemStyle = {
color: function (params) {
return _that.colorArray[params.dataIndex]
}
}
this.clickPie(0)
let fun = function (params) {
_that.clickPie(params.dataIndex)
}
this.$refs.pieChart.handleClick(fun)
} else { } else {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
handlePageNoChange_demand (val) { clickPie (seriesIndex) {
this.demand.pageNo = val; this.pieData.forEach((element, index) => {
this.getDemandData(); if (index === seriesIndex) {
element.label = {
show: true,
};
element.labelLine = {
show: true,
lineStyle: {
opacity: 1,
}
};
console.log('zhilma')
} else {
element.label = {
show: false,
};
element.labelLine = {
show: false,
lineStyle: {
opacity: 0,
color: 'rgba(255,255,255,0)'
}
};
}
});
this.pieOption.series[1].data = this.pieData
// this.$refs.pieChart.hideLoading()
this.$refs.pieChart.setOption(this.pieOption)
},
handleChangeState (index) {
this.getTable()
},
handleChangeAgency (value) {
console.log(value)
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label
this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''
console.log(this.agencyIdArray)
}, },
// //
async getDemandData () { async getTable () {
const url = // const url = "/gov/issue/issue/resibuzz";
"http://yapi.elinkservice.cn/mock/245/heart/userdemand/mydemand"; const url = "http://yapi.elinkservice.cn/mock/245/gov/issue/issue/resibuzz";
let params = { let params = {
userId: this.userId, status: this.status,
orgId: this.orgId,
pageNo: this.demand.pageNo, pageNo: this.demand.pageNo,
pageSize: this.demand.pageSize, pageSize: this.demand.pageSize,
}; };
@ -454,10 +371,15 @@ export default {
this.demand.list = data.list.map((item) => { this.demand.list = data.list.map((item) => {
return [ return [
{ type: "index" }, { type: "index" },
item.wantServiceTime, item.issueTitle,
item.content, item.suggestion,
item.categoryName, item.categoryName,
item.statusName, item.status,
item.createdTime,
item.issueOriginator,
item.voteAccount,
item.supportCount,
item.oppositionCount,
{ type: "operate", list: ["查看"] }, { type: "operate", list: ["查看"] },
]; ];
}); });
@ -465,12 +387,48 @@ export default {
this.$message.error(msg); this.$message.error(msg);
} }
}, },
handlePageNoChange_demand (val) {
this.demand.pageNo = val;
this.getTable();
},
toUserInfo (uid) {
this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` });
},
},
props: {
uid: {
type: String,
default: "",
// default: "8ada68cb6f1e4b9a8333348a39ef3aee",
},
},
computed: {},
components: {
cptCard,
cptTb,
screenEchartsFrame,
},
watch: {
uid (id) {
this.userId = id;
},
userId () {
this.getApiData();
window.scrollTo(0, 0);
},
}, },
}; };
</script> </script>
<style <style
lang="scss" lang="scss"
src="@/assets/scss/modules/visual/resibuzz.scss" src="@/assets/scss/modules/visual/typeAnalyze.scss"
scoped scoped
></style> ></style>
<style lang=scss scoped>
</style>

179
src/views/modules/visual/communityGovern/typePieOption.js

@ -0,0 +1,179 @@
export function pieOption (_charts) {
const center= ['50%', '250px']
return {
title: {
text: '0',
top: 220,
left: 'center',
textStyle: {
width: '100%',
fontSize: 32,
color: '#FFFFFF',
fontWeight: 400
},
itemGap: 5,
subtext: '总数',
subtextStyle: {
fontSize: 20,
color: '#fff',
fontWeight: 400
}
},
tooltip: {
show: false
},
legend: {
top: 500,
bottom: 0,
itemWidth: 20,
itemHeight: 10,
textStyle: {
color: '#D2E7FF',
fontSize: 16,
lineHeight: 20,
},
},
series: [
// 外侧圆环
{
type: 'pie',
// 起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。
startAngle: 0,
hoverAnimation: false,
// tooltip: {
// },
center: center,
radius: ['55%', '55.3%'],
label: {
show: false
},
labelLine: {
show: false
},
data: [{
value: 360,
itemStyle: {
color: 'rgba(40, 101, 250, 0)',
width:0,
borderColor: 'rgba(40, 101, 250, 0.5)',
borderWidth: 1,
borderType: 'dotted'
}
}
]
},
// 突出的
{
hoverAnimation: false,
// name: 'Access From',
type: 'pie',
center: center,
radius: ['40%', '60%'],
avoidLabelOverlap: false,
// top: top + '%',
// height: '80%',
selectedMode: 'single',
left: 'center',
width: 400,
label: {
// show: false,
position: 'outside',
alignTo: 'edge',
// formatter: '{a|{c}}\n\n{name|{b}}',
formatter: '{a|{c}}\n{r|}\n{name|{b}}',
minMargin: 5,
edgeDistance: 1,
lineHeight: 15,
color: '#fff',
fontSize: 12,
// distanceToLabelLine: -60,
rich: {
name: {
padding: [0, 6, 0, 6]
},
a: {
fontSize: 30,
color: '#fff',
padding: [0, 6, 6, 6]
},
r: {
backgroundColor: 'auto',
borderRadius: 6,
width: 6,
height: 6,
// padding: [3, 3, 0, -12]
}
}
},
labelLine: {
show: false,
smooth: 0.2,
length: 30,
length2: 0,
maxSurfaceAngle: 80
},
labelLayout: function (params) {
const isLeft = params.labelRect.x < _charts.getWidth() / 2;
const points = params.labelLinePoints;
// Update the end point.
if (points) {
points[2][0] = isLeft
? params.labelRect.x
: params.labelRect.x + params.labelRect.width;
}
return {
labelLinePoints: points
};
},
itemStyle: {
// color:function(params) {
// //自定义颜色
// var colorList = [
// '#00FFFF', '#00FF00', '#FFFF00', '#FF8C00', '#FF0000', '#FE8463',
// ];
// return colorList[params.dataIndex]
// }
},
data: [],
},
// 中间圆环
{
type: 'pie',
// 起始刻度的角度,默认为 90 度,即圆心的正上方。0 度为圆心的正右方。
startAngle: 0,
hoverAnimation: false,
center: center,
// tooltip: {
// },
radius: ['0%', '25%'],
label: {
show: false
},
labelLine: {
show: false
},
data: [{
value: 360,
itemStyle: {
normal: {
color: 'rgba(8, 37, 134, 1)',
}
}
}
]
},
]
}
}

107
src/views/modules/visual/components/screen-map/index.vue

@ -23,6 +23,7 @@ import Overlay from 'ol/Overlay';
import { defaults as defaultInteractions, Select, DoubleClickZoom } from 'ol/interaction.js'; import { defaults as defaultInteractions, Select, DoubleClickZoom } from 'ol/interaction.js';
import { getCenter, boundingExtent } from 'ol/extent.js'; import { getCenter, boundingExtent } from 'ol/extent.js';
import { Circle as CircleStyle, Icon, Fill, Stroke, Style, Text } from 'ol/style.js'; import { Circle as CircleStyle, Icon, Fill, Stroke, Style, Text } from 'ol/style.js';
import { altKeyOnly, click, pointerMove } from 'ol/events/condition';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import { Loading } from 'element-ui'; //Loading import { Loading } from 'element-ui'; //Loading
@ -50,37 +51,13 @@ let select;//选中标注
//url //url
let textColorArray = [
'rgba(236, 69, 4, 0.66)',
'rgba(0, 146, 238, 0.75)',
'rgba(238, 151, 0, 0.8)'
];
let polygonColorArray = [ let polygonColorArray = [
'rgba(210, 2, 2, 0.24)', 'rgba(210, 2, 2, 0.24)',
'rgba(43, 231, 253, 0.25)', 'rgba(43, 231, 253, 0.25)',
'rgba(183, 185, 0, 0.16)' 'rgba(183, 185, 0, 0.16)'
]; ];
//
var createTextStyle = function (feature) {
return new Text({
textAlign: undefined,
font: "18px Arial",
//fontFamily: "Courier New, monospace",
// fontWeight: "bold",
text: feature.values_.name,
backgroundFill: new Fill({
// color: 'rgba(0, 146, 238, 0.75)'
color: textColorArray[feature.values_.index - 1]
}),
padding: [4, 10, 4, 10],
//text: "",
fill: new Fill({ color: "#ffffff" }),
// stroke: new Stroke({ color: "#ffffff", width: 3 }),
offsetY: -30,
offsetX: -50,
overflow: true,
});
};
// //
@ -146,6 +123,7 @@ const vueGis = {
iconArrays: [ iconArrays: [
], ],
iconTextStyle: {},
//policon //policon
polIconUrlArray: [ polIconUrlArray: [
@ -155,6 +133,7 @@ const vueGis = {
], ],
//icon //icon
iconUrlArray: [], iconUrlArray: [],
iconTextColor: '#ffffff',
} }
}, },
@ -164,12 +143,13 @@ const vueGis = {
}, },
methods: { methods: {
// //
loadMap (mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray) { loadMap (mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray, iconTextStyle) {
this.mapInfo = mapInfo this.mapInfo = mapInfo
this.polygonArray = polygonArray this.polygonArray = polygonArray
this.polIconUrlArray = polIconUrlArray this.polIconUrlArray = polIconUrlArray
this.iconArrays = iconArrays this.iconArrays = iconArrays
this.iconUrlArray = iconUrlArray this.iconUrlArray = iconUrlArray
this.iconTextStyle = iconTextStyle
// //
this.initMap() this.initMap()
@ -185,31 +165,37 @@ const vueGis = {
// //
this.initPolygonLayer() this.initPolygonLayer()
// //
this.loadPolygon() this.loadPolIcon()
} }
if (this.showIconLayer) { if (this.showIconLayer) {
//icon //icon
this.initIconLayer() this.initIconLayer()
this.loadIcon()
} }
}, },
// //
async refreshMap (isRefreshView) { async refreshMap (polygonArray, iconArrays) {
this.polygonArray = polygonArray
this.iconArrays = iconArrays
// if (this.showPolygonLayer) {
await this.loadOrgData()
// //
await this.loadPolygon() this.loadPolygon()
}
if (this.showPolIconLayer) {
//
this.loadPolIcon()
}
if (this.showIconLayer) {
// this.loadIcon()
if (isRefreshView) {
this.setMapLocation()
mapView.setCenter(this.centerPoint);
mapView.setZoom(this.zoom);
} }
@ -323,15 +309,15 @@ const vueGis = {
if (this.iconArrays && this.iconArrays.length > 0) { if (this.iconArrays && this.iconArrays.length > 0) {
let iconFeatures = []; let iconFeatures = [];
this.iconArrays.forEach(oneIcon => { this.iconArrays.forEach((oneIcon, index) => {
let urlNum = this.getRndBetween(1, 3)
// //
let iconItem = new Feature({ let iconItem = new Feature({
geometry: new Point([oneIcon.longitude, oneIcon.latitude]), geometry: new Point([oneIcon.longitude, oneIcon.latitude]),
id: oneIcon.id, id: oneIcon.id,
properties: { properties: {
type: "icon", type: "icon",
info: { ...oneIcon.info } info: { ...oneIcon }
} }
}); });
@ -339,9 +325,10 @@ const vueGis = {
image: new Icon({ image: new Icon({
// anchor: [0.5, 0.5], // anchor: [0.5, 0.5],
// imgSize: [32, 32], // imgSize: [32, 32],
scale: 0.5, // scale: 0.5,
src: iconUrlArray[oneIcon.values_.index - 1] src: this.iconUrlArray[oneIcon.urlIndex]
}) }),
text: this.createTextStyle(oneIcon)
}); });
iconItem.setStyle(iconStyle); iconItem.setStyle(iconStyle);
@ -353,6 +340,15 @@ const vueGis = {
} }
}, },
//icon
createTextStyle (feature) {
let iconTextStyle = { ...this.iconTextStyle }
iconTextStyle.text = feature.values_.name
return new Text({ ...iconTextStyle })
},
// //
initMap () { initMap () {
this.setMapLocation() this.setMapLocation()
@ -385,9 +381,19 @@ const vueGis = {
//map //map
}) })
let that = this
map.on('singleclick', function (e) { map.on('singleclick', function (e) {
// console.log(e.coordinate) const feature = map.forEachFeatureAtPixel(e.pixel, function (feature) {
// console.log(transform(e.coordinate, 'EPSG:3857', 'EPSG:4326')); return feature;
});
if (feature) {
console.log(feature)
that.$emit('clickFeature', feature)
}
}) })
// //
@ -472,6 +478,7 @@ const vueGis = {
map.addLayer(polygonLayer) map.addLayer(polygonLayer)
map.addInteraction(select); map.addInteraction(select);
}, },
//icon //icon
@ -491,6 +498,7 @@ const vueGis = {
//icon //icon
initIconLayer () { initIconLayer () {
iconSource = new VectorSource({ iconSource = new VectorSource({
//features: (new GeoJSON()).readFeatures(geojsonObject) //features: (new GeoJSON()).readFeatures(geojsonObject)
}); });
@ -501,9 +509,16 @@ const vueGis = {
}); });
map.addLayer(iconLayer); map.addLayer(iconLayer);
// select = new Select({ condition: click, });
// map.addInteraction(select);
// select.on('select', e => {
// this.$emit('clickFeature', e)
// });
}, },
// //
getRndBetween (lowerLimit, upperLimit) { getRndBetween (lowerLimit, upperLimit) {
return Math.floor(Math.random() * (upperLimit - lowerLimit + 1)) + lowerLimit; return Math.floor(Math.random() * (upperLimit - lowerLimit + 1)) + lowerLimit;

Loading…
Cancel
Save