Browse Source

地图更换为L7

master
mk 2 years ago
parent
commit
01b2b4c0f7
  1. 2
      package.json
  2. 45
      src/api/hulianApi.js
  3. 44
      src/components/screen-popup-ydzl/index.vue
  4. 30
      src/style/left2.scss
  5. 12
      src/views/agencySelect.vue
  6. 878
      src/views/screenCenter/screenCenter.vue
  7. 519
      src/views/screenLeft/left2.vue
  8. 43
      src/views/screenLeft/left3.vue
  9. 2
      src/views/screenRight/right1.vue
  10. 1
      src/views/screenRight/right3.vue

2
package.json

@ -10,6 +10,8 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@antv/l7": "^2.20.5",
"@turf/turf": "^6.5.0", "@turf/turf": "^6.5.0",
"axios": "^1.4.0", "axios": "^1.4.0",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",

45
src/api/hulianApi.js

@ -20,4 +20,49 @@ export function getIcpartyactivity(data) {
data: data data: data
}) })
} }
// 社区治理人员 communityId: 1202772469238554625 type:1处级干部包联社区2:一线工作组3:党建指导员4:社区书记5:社区副书记6:党委委员
export function getListForCommnity(data) {
return request({
baseURL,
url: '/gov/org/customerCommunityManageUser/screen/listForCommnity',
method: 'GET',
params: data
})
}
// 网格治理人员 gridId: 1224237268259110914 type:1:处级干部包联社区2:一线工作组3:党建指导员4:社区书记5:社区副书记6:党委委员
export function getListForGrid(data) {
return request({
baseURL,
url: '/gov/org/customerGridManageUser/screen/listForGrid',
method: 'GET',
params: data
})
}
// 社区工作人员统计 communityId 1202807268116357122
export function getCommunityStatistics(data) {
return request({
baseURL,
url: '/gov/org/customerGridManageUser/screen/communityStatistics',
method: 'GET',
params: data
})
}
// 入参agencyId: ""
export function getTypestatistics(data) {
return request({
baseURL,
url: '/heart/icpartyunit/screen/typestatistics',
method: 'POST',
data: data
})
}
// 获取社区下网格 agencyId purpose:"addorupdate" || "query"
export function getGridoption(data) {
return request({
baseURL,
url: '/gov/org/customergrid/screen/gridoption',
method: 'POST',
data: data
})
}

44
src/components/screen-popup-ydzl/index.vue

@ -1,14 +1,24 @@
<template> <template>
<div class="screen-popup-ydzl" <div class="screen-popup-ydzl" :style="{
:style="{height: visible?'65px':'0px', opacity: popupVisible ? '1' : '0','--left': left,'--top': top,'--width':width,'--fontSize':fontSize }"> height: (!memberInfo && memberArr) ? '180px' : '65px',
<div class="screen-popup-ydzl-border" opacity: popupVisible ? '1' : '0',
:style="{overflowY: 'hidden' }"> '--left': left,
<div class="screen-popup-ydzl-content"> '--top': top,
<div>{{memberInfo.name}}</div> '--width': width,
<div>{{memberInfo.phone}}</div> '--fontSize': fontSize
}" v-show="popupVisible == '1'">
<div class="screen-popup-ydzl-border" :style="{ overflowX: 'hidden' }">
<div class="screen-popup-ydzl-content" v-if="memberInfo">
<div>{{ memberInfo.name }}</div>
<div>{{ memberInfo.phone }}</div>
</div>
<div v-if="!memberInfo && memberArr" >
<div v-for="item in memberArr">
<div>{{ item.name }}</div>
<div>{{ item.phone }}</div>
<div v-if="item.property">人员属性{{ item.property }}</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -17,7 +27,7 @@
<script> <script>
export default { export default {
name: 'screen-popup-ydzl', name: 'screen-popup-ydzl',
data () { data() {
return { return {
popupVisible: true popupVisible: true
@ -48,9 +58,11 @@ export default {
memberInfo: { memberInfo: {
type: Object, type: Object,
default: () => { } default: () => { }
},
memberArr: {
type: Array,
default: () => []
} }
}, },
watch: { watch: {
@ -96,27 +108,33 @@ export default {
border-radius: 4px; border-radius: 4px;
max-height: 260px; max-height: 260px;
transition: height 0.1s linear, opacity 0.1s linear; transition: height 0.1s linear, opacity 0.1s linear;
&-content { &-content {
padding: 5px; padding: 5px;
text-align: center; text-align: center;
} }
&-border { &-border {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
border-radius: 4px; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
// padding: 10px 0 0; // padding: 10px 0 0;
&::-webkit-scrollbar { &::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 6px; /*高宽分别对应横竖滚动条的尺寸*/ width: 6px;
/*高宽分别对应横竖滚动条的尺寸*/
height: 1px; height: 1px;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ /*滚动条里面小方块*/
background: linear-gradient(-90deg, #09b8e5 0%, #09f0e3 99%); background: linear-gradient(-90deg, #09b8e5 0%, #09f0e3 99%);
border-radius: 3px; border-radius: 3px;
} }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
/*滚动条里面轨道*/ /*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); // box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);

30
src/style/left2.scss

@ -20,7 +20,7 @@
} }
} }
.grid-title { .grid-title {
margin-top: 5px; margin-top: 10px;
height: 40px; height: 40px;
} }
@ -47,12 +47,12 @@
position: relative; position: relative;
margin-top: 5px; margin-top: 5px;
width: 578px; width: 578px;
height: 30px; height: 40px;
background: rgba(36, 190, 241, 0.7); background: rgba(36, 190, 241, 0.7);
border-radius: 2px; border-radius: 2px;
text-align: center; text-align: center;
line-height: 30px; line-height: 40px;
.rowitem { .rowitem {
font-size: 18px; font-size: 18px;
@ -110,39 +110,39 @@
.grid-item { .grid-item {
text-align: center; text-align: center;
position: relative;
.frame-arrow2 { .frame-arrow2 {
> img { > img {
height: 24px; height: 40px;
width: 24px; width: 24px;
} }
} }
.grid-member { .grid-member {
width: 285px; width: 130px;
height: 254px; height: 75px;
background: rgba(36, 190, 241, 0.3); background: rgba(36, 190, 241, 0.3);
border-radius: 4px; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
padding: 14px 0 14px 14px; padding: 14px 14px 14px 14px;
&-title { &-title {
width: 100px; width: 113px;
height: 26px;
background: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.8);
border-radius: 2px; border-radius: 2px;
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
font-family: Alibaba PuHuiTi; font-family: Alibaba PuHuiTi;
font-weight: 500; font-weight: 500;
color: #006fbd; color: #006fbd;
line-height: 26px; min-height:49px ;
display: grid;
place-items: center;
cursor: pointer;
// line-height: 49px;
} }
&-main { &-main {
@ -194,7 +194,7 @@
} }
.left2-static { .left2-static {
margin-top: 10px 23px; margin-top: 50px;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;

12
src/views/agencySelect.vue

@ -121,7 +121,7 @@ export default {
}, },
onChooseStreet(streetItem) { onChooseStreet(streetItem) {
console.log(streetItem); console.log(streetItem,'选中街道');
this.selectStreet = { this.selectStreet = {
label: streetItem.label, label: streetItem.label,
value: streetItem.value, value: streetItem.value,
@ -132,8 +132,8 @@ export default {
value: '', value: '',
// center: [] // center: []
} }
this.communityList = []
this.getOrgTree('community_party', streetItem.value) this.getOrgTree('community_party', streetItem.value)
// this.communityList = []
// this.communityList.push({ // this.communityList.push({
// label: "", // label: "",
// value: "", // value: "",
@ -143,9 +143,8 @@ export default {
// this.communityList = [...this.communityList, ...streetItem.children] // this.communityList = [...this.communityList, ...streetItem.children]
this.getCommunityList() this.getCommunityList()
if (this.selectStreet.value) { if (this.selectStreet.value) {
this.set_shibeiAgencyName(this.selectStreet.label) this.set_shibeiAgencyName(this.selectStreet.label)
this.set_shibeiAgencyType('community') this.set_shibeiAgencyType('street')
this.set_shibeiMapCenter(this.selectStreet.center) this.set_shibeiMapCenter(this.selectStreet.center)
this.set_shibeiAgencyId(this.selectStreet.value) this.set_shibeiAgencyId(this.selectStreet.value)
} else { } else {
@ -163,7 +162,6 @@ export default {
}, },
onChooseCommunity(communityItem) { onChooseCommunity(communityItem) {
this.selectCommunity = { this.selectCommunity = {
label: communityItem.label, label: communityItem.label,
value: communityItem.value, value: communityItem.value,
@ -173,13 +171,13 @@ export default {
if (this.selectCommunity.value) { if (this.selectCommunity.value) {
this.set_shibeiAgencyId(this.selectCommunity.value) this.set_shibeiAgencyId(this.selectCommunity.value)
this.set_shibeiAgencyName(this.selectCommunity.label) this.set_shibeiAgencyName(this.selectCommunity.label)
this.set_shibeiAgencyType('street') this.set_shibeiAgencyType('community')
this.set_shibeiMapCenter(this.selectCommunity.center) this.set_shibeiMapCenter(this.selectCommunity.center)
} else { } else {
////shibeiId=id ////shibeiId=id
this.set_shibeiAgencyId(this.selectStreet.value) this.set_shibeiAgencyId(this.selectStreet.value)
this.set_shibeiAgencyName(this.selectStreet.label) this.set_shibeiAgencyName(this.selectStreet.label)
this.set_shibeiAgencyType('community') this.set_shibeiAgencyType('street')
this.set_shibeiMapCenter(this.selectStreet.centerMark) this.set_shibeiMapCenter(this.selectStreet.centerMark)
} }
}, },

878
src/views/screenCenter/screenCenter.vue

@ -1,23 +1,6 @@
<template> <template>
<div class="screen-center"> <div class="screen-center">
<div id="map" style="height: 100%;width: 100%;position: relative;min-width:1000px"> <div id="map" style="height: 100%;width: 100%;position: relative;min-width:1000px">
<!-- <div style="position: absolute;left:16%;top: 10px;cursor: pointer;z-index: 100;color: #fff;font-size: 40px;">
<div style="display: flex;justify-content: space-around;flex-direction: row;width: 30vw;">
<div v-for="item in topNum"
:key="item.value"
style="background-color: rgba(8, 31, 45, 0.6);padding: 30px;display: flex;flex-direction: column;align-items: center;">
<div style="padding-bottom: 20px;">
{{item.value&&getThousandth(item.value)}}
</div>
<div style="border-top: 5px solid #36acd3;padding-top: 20px;display: flex;align-items: center;white-space: nowrap;">
<el-image style="height: 60px;"
:src="require('../../assets/shuline.png')"
fit="fill"></el-image>
{{item.label||"--" }}
</div>
</div>
</div>
</div> -->
<div @click="initialization" style="position: absolute;left: 100px;bottom: 100px;cursor: pointer;z-index: 100;"> <div @click="initialization" style="position: absolute;left: 100px;bottom: 100px;cursor: pointer;z-index: 100;">
<el-image style="width: 50px; height: 50px;" :src="require('../../assets/back.png')" fit="fill"></el-image> <el-image style="width: 50px; height: 50px;" :src="require('../../assets/back.png')" fit="fill"></el-image>
</div> </div>
@ -120,58 +103,65 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import markIcon from "@/assets/position.png"; // import markIcon from "@/assets/position.png";
import markIcons from "@/assets/positions.png"; // import markIcons from "@/assets/positions.png";
import { Scene, PolygonLayer, LineLayer, MarkerLayer, RasterLayer, PointLayer, Marker, Popup } from "@antv/l7";
import { GaodeMap, Map } from "@antv/l7-maps";
import * as turf from '@turf/turf'; import * as turf from '@turf/turf';
import axios from 'axios'; import axios from 'axios';
import mapboxgl from 'mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import shibeiJson from './shibei.json';
const md5 = require('blueimp-md5'); const md5 = require('blueimp-md5');
let myMap;
let scene;
let polygonLayer;
let lineLayer;
let textLayer;
let posLayer;
let circleLayer;
let dotLayer;
let dotBgLayer;
let dotLayer2;
let searchMarker;
let searchBgLayer;
let numMarker;
let pointMarker;
export default { export default {
name: "screen-center", name: "screen-center",
data() { data() {
return { return {
map: null,
colorList: ["#F84E2D", "#1372EC", "#44DEA3", "#FFC544", "#6C44FF"], colorList: ["#F84E2D", "#1372EC", "#44DEA3", "#FFC544", "#6C44FF"],
attrAndColor: [], attrAndColor: [],
shibeiJson: null,
resolutions: [
156543.03392800014, 78271.516963999937, 39135.758482000092, 19567.879240999919,
9783.9396204999593, 4891.9698102499797, 2445.9849051249898, 1222.9924525624949, 611.49622628137968,
305.74811314055756, 152.87405657041106, 76.437028285073239, 38.21851414253662, 19.10925707126831,
9.5546285356341549, 4.7773142679493699, 2.3886571339746849, 1.1943285668550503, 0.59716428355981721,
0.29858214164761665, 0.149291070823808325, 0.0746455354119041625
],
hoveredStateId: null, hoveredStateId: null,
topNum: [ // topNum: [
{ // {
label: "用户总数", // label: "",
value: 330195 // value: 330195
}, // },
{ // {
label: "党员总数", // label: "",
value: 74830 // value: 74830
}, // },
{ // {
label: "党群总数", // label: "",
value: 9501 // value: 9501
}, // },
{ // {
label: "话题总数", // label: "",
value: 286508 // value: 286508
}, // },
{ // {
label: "议题总数", // label: "",
value: 223829 // value: 223829
}, // },
{ // {
label: "诉求总数", // label: "",
value: 215450 // value: 215450
} // }
], // ],
buttonPiece: [ buttonPiece: [
{ {
value: 1, value: 1,
@ -185,23 +175,11 @@ export default {
value: 3, value: 3,
label: "党支部" label: "党支部"
}, },
// {
// value: 4,
// label: ""
// },
// {
// value: 5,
// label: ""
// },
// {
// value: 6,
// label: ""
// }
], ],
buttonIndex: 0, buttonIndex: 0,
markerJson: null, markerJson: null,
layersIndex: 1, layersIndex: 1,
features: {},
showFirst: false, showFirst: false,
showMicrogridDetails: false, showMicrogridDetails: false,
microgridArr: [ microgridArr: [
@ -413,20 +391,67 @@ export default {
}, },
] ]
}, },
lightStyle: {
style: "amap://styles/whitesmoke",
polygonColor: [
// "rgba(255, 100, 60, 0.3)",
"rgba(43, 231, 253, 0.3)",
// "rgba(255, 255, 50, 0.3)",
],
lineColor: [
// "rgba(220, 150, 120, 0.9)",
"rgba(33, 201, 223, 0.8)",
// "rgba(200, 200, 50, 0.9)",
],
circleColor: [
// "rgba(255, 180, 150, 0.99)",
"rgba(13, 181, 203, 0.8)",
// "rgba(255, 255, 50, 0.99)",
],
textColor: [
// "rgba(200, 50, 10, 0.99)",
"rgba(0, 130, 153, 0.99)",
// "rgba(120, 120, 0, 0.99)",
],
textStrokeColor: "#666",
},
darkStyle: {
style: "amap://styles/blue",
polygonColor: [
// "rgba(255, 100, 60, 0.5)",
// "rgba(43, 231, 253, 0.35)",
"rgba(0, 127, 241, .3)",
// "rgba(255, 255, 50, 0.35)",
],
lineColor: [
// "rgba(255, 180, 150, 0.9)",
// "rgba(43, 231, 253, 0.7)",
"rgba(0, 127, 241, .6)",
// "rgba(255, 255, 50, 0.7)",
],
circleColor: [
// "rgba(255, 180, 150, 0.99)",
// "rgba(43, 231, 253, 0.99)",
"rgba(0, 127, 241, 0.99)",
// "rgba(255, 255, 50, 0.99)",
],
textColor: [
// "rgba(255, 100, 60, 0.99)",
// "rgba(43, 231, 253, 0.99)",
"rgba(126, 187, 255, 1)",
// "rgba(255, 255, 50, 0.99)",
],
textStrokeColor: "#fff",
},
} }
}, },
mounted() { mounted() {
this.shibeiJson = require('./shibei.json'); window._AMapSecurityConfig = {
console.log(this.shibeiJson); securityJsCode: "92ea2c965c6cf1ba7ee3a8fe01449ef2",
for (let i in this.shibeiJson.features) { };
this.shibeiJson.features[i].properties.resiNum = '88', this.$nextTick(() => {
this.shibeiJson.features[i].properties.houseNum = '66' this.init()
this.shibeiJson.features[i].properties.partNum = '第一党支部' })
}
console.log(this.shibeiJson.features);
this.markerJson = require('./markerJson.json');
this.init()
this.microgridObj.list = JSON.parse(JSON.stringify(this.microgridObjCopy.list)).slice(0, 5)
}, },
computed: { computed: {
...mapGetters(['shibeiAId', 'shibeiName', 'shibeiAgencyType']), ...mapGetters(['shibeiAId', 'shibeiName', 'shibeiAgencyType']),
@ -447,285 +472,6 @@ export default {
} }
}, },
methods: { methods: {
init() {
// map
mapboxgl.accessToken = "pk.eyJ1IjoiZGp4YyIsImEiOiJjanlxdzNlbW0wNHNyM29yMzZibHczOHlpIn0.TOUXgB6IHHhnmA6RsL6pWw";
this.map = new mapboxgl.Map({
container: 'map', // container id
center: [120.38140448734, 36.11044959486], // starting position [lng, lat]
zoom: 12.5, // starting zoom
// maxZoom: 12.5, // 22
// minZoom: 9,
bearing: 0,
pitch: 40,
style: {
version: 8,
sources: {
},
glyphs: "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
layers: [
],
}
});
const _this = this;
this.map.on('load', function () {
_this.getPolygonJson(_this.shibeiJson)
_this.map.on('mousemove', 'shibeiPolygonLayer', function (e) {
_this.map.getCanvas().style.cursor = 'pointer'; //
});
_this.map.on("click", "shibeiPolygonLayer", function (e) {
const features = _this.map.queryRenderedFeatures(e.point);
if (_this.layersIndex === 3) {
_this.showFirst = true
}
if (features.length > 0) {
_this.features = features[0]
if (features[0]["properties"]["type"] && features[0]["properties"]["type"] == "marker") {
_this.makeMarker(features[0])
return
}
if (features[0]["properties"]["name"].indexOf("网格") != -1) {
return
}
_this.getBoundary(features[0]["properties"]["adcode"] || features[0]["properties"]["subId"])
_this.map.setZoom(13.5)
_this.map.setCenter(features[0]["geometry"]["coordinates"][0][0])
if (_this.map.getLayer("shibeiPolygonLayer")) {
_this.map.removeLayer("shibeiPolygonLayer")
_this.map.removeLayer("text_JSON_layer")
_this.map.removeSource("shibeiPolygonSource")
}
if (_this.map.getLayer("SinglePolygonLayer")) {
_this.map.removeLayer("SinglePolygonLayer")
_this.map.removeLayer("SingleTextLayer")
_this.map.removeSource("SinglePolygonSource")
}
if (_this.map.getLayer("text_JSON_layer-num")) {
_this.map.removeLayer("text_JSON_layer-num")
}
for (let i = 8; i <= 18; i++) {
if (_this.map.getLayer("lineBufferLayer-" + i)) {
_this.map.removeLayer("lineBufferLayer-" + i)
_this.map.removeSource("lineBufferSource-" + i)
}
}
}
// _this.addSinglePolygon(features[0])
});
//
// _this.map.on('mousemove', 'shibeiPolygonLayer', function (e) {
// _this.map.getCanvas().style.cursor = 'pointer'; //
// if (_this.map.getLayer("heightPolygonLayer")) {
// _this.map.removeLayer("heightPolygonLayer")
// _this.map.removeSource("heightPolygonSource")
// }
// let feature = e.features[0];
// _this.addHeightPolygon(feature)
// });
// _this.map.on('mouseleave', 'shibeiPolygonLayer', function (e) {
// if (_this.map.getLayer("heightPolygonLayer")) {
// _this.map.removeLayer("heightPolygonLayer")
// _this.map.removeSource("heightPolygonSource")
// }
// });
})
},
getPolygonJson(obj) {
let shibeiPolyline = JSON.parse(JSON.stringify(obj))
for (let i = 0; i < shibeiPolyline.features.length; i++) {
shibeiPolyline.features[i].geometry.type = 'MultiLineString' //线
shibeiPolyline.features[i].geometry.coordinates = this.convertPolygonToPolyline(shibeiPolyline.features[
i].geometry.coordinates)
}
this.addPolygon(obj)
this.addPolyline(shibeiPolyline)
},
convertPolygonToPolyline(MultiPolygon) {
let MultiLineString = []
MultiPolygon.forEach(Polygon => {
Polygon.forEach(LinearRing => {
let LineString = LinearRing
MultiLineString.push(LineString)
})
});
return MultiLineString
},
addPolygon(geojson) {
this.map.addSource('shibeiPolygonSource', {
'type': 'geojson',
'data': geojson
});
this.map.addLayer({
'id': 'shibeiPolygonLayer',
'type': 'fill-extrusion',
'source': 'shibeiPolygonSource',
'paint': {
'fill-extrusion-vertical-gradient': true,
'fill-extrusion-color': "#00466e",
'fill-extrusion-height': 300,
'fill-extrusion-base': 0,
'fill-extrusion-opacity': 0.2 //
}
});
this.map.addLayer({
id: "text_JSON_layer",
type: "symbol",
source: "shibeiPolygonSource",
// minzoom: 5,
// maxzoom: 22,
interactive: true,
paint: {
'text-color': '#fff',
},
"layout": {
"text-field": "{name}",
'text-size': 25
}
});
},
addSinglePolygon(geojson) {
this.map.addSource('SinglePolygonSource', {
'type': 'geojson',
'data': geojson
});
this.map.addLayer({
'id': 'SinglePolygonLayer',
'type': 'fill-extrusion',
'source': 'SinglePolygonSource',
'paint': {
'fill-extrusion-vertical-gradient': true,
'fill-extrusion-color': "#1d597b",
'fill-extrusion-height': 300,
'fill-extrusion-base': 0,
'fill-extrusion-opacity': 1
}
});
this.map.addLayer({
id: "SingleTextLayer",
type: "symbol",
source: "SinglePolygonSource",
// minzoom: 5,
// maxzoom: 22,
interactive: true,
paint: {
'text-color': '#fff',
},
"layout": {
"text-field": "{name}",
'text-size': 40
}
});
},
addHeightPolygon(geojson) {
this.map.addSource('heightPolygonSource', {
'type': 'geojson',
'data': geojson
});
this.map.addLayer({
'id': 'heightPolygonLayer',
'type': 'fill-extrusion',
'source': 'heightPolygonSource',
'paint': {
'fill-extrusion-vertical-gradient': true,
'fill-extrusion-color': "#b3b817",
'fill-extrusion-height': 300,
'fill-extrusion-base': 0,
'fill-extrusion-opacity': 1
},
});
},
addPolyline(geojson) {
// 8 ~ 18
for (let i = 8; i <= 18; i++) {
let radius = 1 * this.resolutions[i + 1] // 24
let lineBuffer = turf.buffer(geojson, radius, {
units: 'meters'
});
this.map.addSource('lineBufferSource-' + i, {
'type': 'geojson',
'data': lineBuffer
});
this.map.addLayer({
'id': 'lineBufferLayer-' + i,
'type': 'fill-extrusion',
'source': 'lineBufferSource-' + i,
"minzoom": (i - 1),
"maxzoom": (i + 1),
'paint': {
'fill-extrusion-vertical-gradient': true,
'fill-extrusion-color': '#00e4fa',
'fill-extrusion-height': 310, //
'fill-extrusion-base': 300,//
'fill-extrusion-opacity': 0.3
}
});
// this.map.addLayer({
// id: 'shibeiPolylineShadow-',
// type: 'fill-extrusion',
// source: 'lineBufferSource-' + i,
// paint: {
// 'fill-extrusion-color': [
// 'interpolate',
// ['linear'],
// ['get', 'height'],
// 0, '#05c3e3', //
// // 300, '#0089aa' //
// ],
// 'fill-extrusion-height': 310, //
// 'fill-extrusion-base': 300, //
// 'fill-extrusion-opacity': 0.3, //
// },
// light: null, // null
// },)
}
},
initialization() {
if (this.map.getLayer("text_JSON_layer-num")) {
//
this.map.removeLayer("text_JSON_layer-num");
}
if (this.map.getLayer("shibeiPolygonLayer")) {
this.map.removeLayer("shibeiPolygonLayer")
this.map.removeLayer("text_JSON_layer")
this.map.removeSource("shibeiPolygonSource")
}
if (this.map.getLayer("SinglePolygonLayer")) {
this.map.removeLayer("SinglePolygonLayer")
this.map.removeLayer("SingleTextLayer")
this.map.removeSource("SinglePolygonSource")
}
for (let i = 8; i <= 18; i++) {
if (this.map.getLayer("lineBufferLayer-" + i)) {
this.map.removeLayer("lineBufferLayer-" + i)
this.map.removeSource("lineBufferSource-" + i)
}
}
if (this.map.getLayer("pointDimensions")) {
this.map.removeLayer("pointDimensions")
this.map.removeSource("pointDimensions")
this.map.removeImage("markIcons")
}
if (this.map.getLayer("pointDimension")) {
this.map.removeLayer("pointDimension")
this.map.removeSource("pointDimension")
this.map.removeImage("markIcon")
}
this.layersIndex = 1;
this.buttonIndex = 0;
this.getPolygonJson(this.shibeiJson);
this.map.setZoom(12.5);
this.map.setCenter([120.38140448734, 36.11044959486]);
this.close();
},
selectType(value, label) { selectType(value, label) {
// if (value === this.buttonIndex) { // if (value === this.buttonIndex) {
// this.buttonIndex = 0 // this.buttonIndex = 0
@ -796,8 +542,255 @@ export default {
} }
this.makeMarkers(json) this.makeMarkers(json)
}, },
initialization() {
if (polygonLayer) {
scene.removeLayer(polygonLayer);
}
if (lineLayer) {
scene.removeLayer(lineLayer);
}
if (textLayer) {
scene.removeLayer(textLayer);
}
this.iniMapGrid(shibeiJson)
},
init() {
const { darkStyle, lightStyle, } = this;
if (!shibeiJson) return false;
let styleConfig = darkStyle;
// if (this.mapStyleType == "light") {
// styleConfig = lightStyle;
// }
const iniCenter = [116.39743841556731, 39.9088810666821];
myMap = new GaodeMap({
pitch: 47.24716321414439,
mapStyle: "amap://styles/darkblue",
// style: styleConfig.style,
showLabel: false,
center: [120.362190755209, 36.0997500271275],
token: "fc14b42e0ca18387866d68ebd4f150c1",
zoom: 20,
isHotspot: false,
showIndoorMap: false,
showBuildingBlock: false,
// resizeEnable: true,
doubleClickZoom: false,
showRoad: false,
viewMode: "3D",
styleJson: [
{
"featureType": "road",
"elementType": "all",
"stylers": {
"color": "#fff" //
}
}
]
});
scene = new Scene({
id: "map",
logoVisible: false,
map: myMap,
});
scene.on("loaded", async () => {
// this.iniMapBase(scene);
this.iniMapGrid(shibeiJson);
});
},
//
iniMapBase(scene) {
// console.log("-----------------iniMapBase");
//
const baseLayer = new RasterLayer({
zIndex: 0,
});
baseLayer
.source("http://t7.tianditu.com/DataServer?T=vec_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}", {
parser: {
type: "rasterTile",
tileSize: 1,
minZoom: 6,
maxZoom: 15,
zoomOffset: 0,
},
})
.style({
opacity: 0.7,
});
//
const annotionLayer = new RasterLayer({
zIndex: 2,
});
annotionLayer
.source("http://t7.tianditu.com/DataServer?T=cva_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}", {
parser: {
type: "rasterTile",
tileSize: 1,
minZoom: 6,
maxZoom: 15,
zoomOffset: 0,
},
})
.style({
opacity: 0.5,
});
scene.addLayer(baseLayer);
scene.addLayer(annotionLayer);
},
iniMapGrid(data) {
const { darkStyle, lightStyle, polygonData, polygonDotData, } = this;
console.log(data, '初始化网格');
let styleConfig = darkStyle;
if (this.mapStyleType == "light") {
styleConfig = lightStyle;
}
//
polygonLayer = new PolygonLayer({
autoFit: true,
})
// .size(0)
.source(data)
.color("name", styleConfig.polygonColor)
// .shape("extrude")
.shape("fill")
.style({
opacityLinear: {
enable: false, // true - false
dir: "in", // in - out
},
opacity: 1,
heightfixed: true,
pickLight: true,
raisingHeight: 300,
sourceColor: "#333",
targetColor: "rgba(255,255,255, 0.5)",
});
scene.addLayer(polygonLayer);
//
lineLayer = new LineLayer({
zIndex: 2,
name: "line2",
})
.source(data)
.shape("line")
.size(1)
.color("name", styleConfig.lineColor)
.style({
opacity: 1,
})
.animate({
interval: 1, //
duration: 2, //
trailLength: 2, // 线
});
scene.addLayer(lineLayer);
// posLayer = new PointLayer({
// zIndex: 4,
// name: "gridPoint",
// visible: false,
// })
// .source(polygonDotData)
// .shape("name", [
// // "pos-red",
// "pos-green",
// // "pos-yellow"
// ])
// .size(12)
// .style({
// options: this.level === "grid" ? 1 : 0,
// offsets: [0, 0],
// });
// // scene.addLayer(posLayer);
// /* if (this.level === 'grid') {
// posLayer.show()
// } else {
// posLayer.hide()
// }*/
textLayer = new PolygonLayer({
zIndex: 20,
})
.source(data)
.color("name", styleConfig.textColor)
.shape("name", "text")
.size(16)
.style({
textAnchor: "center", // center|left|right|top|bottom|top-left
textOffset: [0, 40], // [, ]
spacing: 2, //
padding: [2, 2], // padding []
stroke: styleConfig.textStrokeColor, //
strokeWidth: 0.1, //
strokeOpacity: 0.8,
textAllowOverlap: true,
})
.active(true);
scene.addLayer(textLayer);
let popup;
// polygonLayer.on("mousemove", (e) => {
// if (this.level === "grid") {
// return;
// }
// popup = new Popup({
// offsets: [60, 60],
// closeButton: false,
// maxWidth: 400,
// }).setLnglat(e.lngLat).setHTML(`
// <div class="jw-popup-container">
// <div class="jw-popup-bg"></div>
// <div class="jw-popup-con">
// <div class="jw-popup-title">
// ${e.feature.properties.name}
// </div>
// <div class="jw-popup-des">
// ${e.feature.properties.description ? e.feature.properties.description : ""}
// </div>
// </div>
// </div>
// `);
// scene.addPopup(popup);
// });
// polygonLayer.on("mouseout", (e) => {
// // popup
// if (popup) {
// popup.remove();
// }
// });
polygonLayer.on("click", (e) => {
console.log(e);
if (e.feature.properties.name.indexOf("网格") != -1) {
return
}
if (polygonLayer) {
scene.removeLayer(polygonLayer);
}
if (lineLayer) {
scene.removeLayer(lineLayer);
}
if (textLayer) {
scene.removeLayer(textLayer);
}
this.getBoundary(e.feature.properties.adcode || e.feature.properties.subId)
});
// posLayer.on("click", (e) => {
// console.log(e);
// });
},
getBoundary(id) { getBoundary(id) {
const ts = Date.now(); const ts = Date.now();
const { darkStyle, lightStyle, polygonData, polygonDotData, } = this;
console.log(shibeiJson, '初始化网格');
let styleConfig = darkStyle;
if (this.mapStyleType == "light") {
styleConfig = lightStyle;
}
let signConfig = { let signConfig = {
key: '612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970', key: '612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970',
dataType: 'real', dataType: 'real',
@ -820,147 +813,42 @@ export default {
ts ts
} }
}).then(e => { }).then(e => {
if (e.data.code == 0 && e.data.data) { let obj = {
if (e.data.data.agencyDistribution && e.data.data.agencyDistribution.length == 0) { type: "FeatureCollection",
return name: "index",
} features: e.data.data.agencyDistribution
if (this.map.getLayer("shibeiPolygonLayer")) {
this.map.removeLayer("shibeiPolygonLayer")
this.map.removeLayer("text_JSON_layer")
this.map.removeSource("shibeiPolygonSource")
}
if (this.map.getLayer("SinglePolygonLayer")) {
this.map.removeLayer("SinglePolygonLayer")
this.map.removeLayer("SingleTextLayer")
this.map.removeSource("SinglePolygonSource")
}
for (let i = 8; i <= 18; i++) {
if (this.map.getLayer("lineBufferLayer-" + i)) {
this.map.removeLayer("lineBufferLayer-" + i)
this.map.removeSource("lineBufferSource-" + i)
}
}
let obj = {
type: "FeatureCollection",
name: "index",
features: e.data.data.agencyDistribution
}
obj.features.forEach(f => {
f.type = "Feature"
f.properties = {}
f.geometry = {}
f.properties.subId = f.subId || ""
f.properties.name = f.subName || ""
f.geometry.type = "MultiPolygon"
f.geometry.coordinates = [[JSON.parse(f.subAreaMarks)]] || []
delete f.agencyLevel
delete f.subAreaMarks
delete f.subCenterMark
delete f.subId
delete f.subName
})
this.getPolygonJson(obj)
if (this.features["properties"]["name"].indexOf("社区") != -1) {
this.selectType(0, "")
this.layersIndex = 3
}
} }
obj.features.forEach(f => {
f.type = "Feature"
f.properties = {}
f.geometry = {}
f.properties.subId = f.subId || ""
f.properties.name = f.subName || ""
f.geometry.type = "MultiPolygon"
f.geometry.coordinates = [[JSON.parse(f.subAreaMarks)]] || []
delete f.agencyLevel
delete f.subAreaMarks
delete f.subCenterMark
delete f.subId
delete f.subName
})
this.iniMapGrid(obj)
}).catch(f => { }).catch(f => {
console.log(f); console.log(f);
}) })
}, },
makeMarkers(json) { // getPolygonJson(obj) {
const _this = this; // let shibeiPolyline = JSON.parse(JSON.stringify(obj))
if (_this.map.getLayer("pointDimension")) { // for (let i = 0; i < shibeiPolyline.features.length; i++) {
_this.map.removeLayer("pointDimension") // shibeiPolyline.features[i].geometry.type = 'MultiLineString' //线
_this.map.removeSource("pointDimension") // shibeiPolyline.features[i].geometry.coordinates = this.convertPolygonToPolyline(shibeiPolyline.features[
_this.map.removeImage("markIcon") // i].geometry.coordinates)
} // }
_this.map.loadImage(markIcon, function (error, image) { // this.addPolygon(obj)
_this.map.addImage("markIcon", image); // this.addPolyline(shibeiPolyline)
_this.map.addSource("pointDimension", {
type: "geojson" /* geojson类型资源 */,
data: json
});
_this.map.addLayer({
id: "pointDimension",
type: "symbol" /* symbol类型layer,一般用来绘制点*/,
source: "pointDimension",
layout: {
"icon-image": "markIcon",
"icon-size": 1,
},
// paint: {
// "circle-radius": 4,
// "circle-color": "#B42222"
// }
});
//
_this.map.addLayer({
id: "pointDimension-text",
type: "symbol",
source: "pointDimension",
layout: {
"text-field": "{resiNum}", //
"text-size": 15,
"text-offset": [0, -5], //
// "text-background-color": "#000", //
// "text-background-opacity": 0.7, //
},
paint: {
"text-color": "#fff", //
"text-halo-width": 10, //
"text-halo-color": "#000", //
},
});
})
_this.layersIndex = 3
},
makeMarker(json) {
const _this = this;
if (_this.map.getLayer("pointDimensions")) {
_this.map.removeLayer("pointDimensions")
_this.map.removeSource("pointDimensions")
_this.map.removeImage("markIcons")
}
_this.showFirst = true
_this.map.loadImage(markIcons, function (error, image) {
_this.map.addImage("markIcons", image);
_this.map.addSource("pointDimensions", {
type: "geojson" /* geojson类型资源 */,
data: json
});
_this.map.addLayer({ // },
id: "pointDimensions",
type: "symbol" /* symbol类型layer,一般用来绘制点*/,
source: "pointDimensions",
layout: {
"icon-image": "markIcons",
"icon-size": 2,
},
// paint: {
// "circle-radius": 4,
// "circle-color": "#B42222"
// }
});
});
},
microgridDetails(item) {
this.showMicrogridDetails = true
this.microgridIndex = item.value
this.microgridObj.firstTitle = item.label
},
close() {
this.showFirst = false
this.showMicrogridDetails = false
},
handleCurrentChange(e) {
let times = 5
this.microgridObj.list = JSON.parse(JSON.stringify(this.microgridObjCopy.list)).slice(e * times - times, e * times)
}
} }
} }
</script> </script>

519
src/views/screenLeft/left2.vue

@ -4,44 +4,29 @@
<div> <div>
<div class="d-title"> <div class="d-title">
<img src="./../../assets/icon/point.png" /> <img src="./../../assets/icon/point.png" />
<div>{{'社区人员架构'}}</div> <div>{{ '社区人员架构' }}</div>
</div> </div>
<div class="frame"> <div class="frame">
<div class="frame-row"> <div class="frame-row">
{{communityName}} {{ communityName || '所属社区' }}
</div> </div>
<div class="frame-arrow"> <div class="frame-arrow">
<img src="./../../assets/icon/arrow.png" /> <img src="./../../assets/icon/arrow.png" />
</div> </div>
<div class="frame-multirow"> <div class="frame-multirow">
<div class="multirowitem" <div class="multirowitem" ref="showClgb" @click="clickItem('showClgb')"> {{ '处理干部包联社区' }}
ref="showClgb" <screen-popup-ydzl :top="top" :left="left" :memberInfo="clgbMemberInfo" :visible.sync="showObj['showClgb']">
@click="clickItem('showClgb')"> {{'处理干部包联社区'}}
<screen-popup-ydzl :top="top"
:left="left"
:memberInfo="memberInfo"
:visible.sync="showObj['showClgb'] ">
</screen-popup-ydzl> </screen-popup-ydzl>
</div> </div>
<div class="multirowitem" <div class="multirowitem" ref="showYxgz" @click="clickItem('showYxgz')"> {{ '一线工作组' }}
ref="showYxgz" <screen-popup-ydzl :top="top" :left="left" :memberArr="memberInfoYxgz" :visible.sync="showObj['showYxgz']">
@click="clickItem('showYxgz')"> {{'一线工作组'}}
<screen-popup-ydzl :top="top"
:left="left"
:memberInfo="memberInfo"
:visible.sync="showObj['showYxgz']">
</screen-popup-ydzl> </screen-popup-ydzl>
</div> </div>
<div class="multirowitem" <div class="multirowitem" ref="showDjzd" @click="clickItem('showDjzd')"> {{ '党建指导员' }}
ref="showDjzd" <screen-popup-ydzl :top="top" :left="left" :memberInfo="memberInfoDjzd" :visible.sync="showObj['showDjzd']">
@click="clickItem('showDjzd')"> {{'党建指导员'}}
<screen-popup-ydzl :top="top"
:left="left"
:memberInfo="memberInfo"
:visible.sync="showObj['showDjzd']">
</screen-popup-ydzl> </screen-popup-ydzl>
</div> </div>
</div> </div>
@ -49,31 +34,16 @@
<img src="./../../assets/icon/arrow.png" /> <img src="./../../assets/icon/arrow.png" />
</div> </div>
<div class="frame-multirow"> <div class="frame-multirow">
<div class="multirowitem" <div class="multirowitem" ref="showSqsj" @click="clickItem('showSqsj')"> {{ '社区书记' }}
ref="showSqsj" <screen-popup-ydzl :top="top" :left="left" :memberInfo="memberInfoSqsj" :visible.sync="showObj['showSqsj']">
@click="clickItem('showSqsj')"> {{'社区书记'}}
<screen-popup-ydzl :top="top"
:left="left"
:memberInfo="memberInfo"
:visible.sync="showObj['showSqsj']">
</screen-popup-ydzl> </screen-popup-ydzl>
</div> </div>
<div class="multirowitem" <div class="multirowitem" ref="showSqfsj" @click="clickItem('showSqfsj')"> {{ '社区副书记' }}
ref="showSqfsj" <screen-popup-ydzl :top="top" :left="left" :memberInfo="memberInfoSqfs" :visible.sync="showObj['showSqfsj']">
@click="clickItem('showSqfsj')"> {{'社区副书记'}}
<screen-popup-ydzl :top="top"
:left="left"
:memberInfo="memberInfo"
:visible.sync="showObj['showSqfsj']">
</screen-popup-ydzl> </screen-popup-ydzl>
</div> </div>
<div class="multirowitem" <div class="multirowitem" ref="showDwwy" @click="clickItem('showDwwy')"> {{ '党委委员' }}
ref="showDwwy" <screen-popup-ydzl :top="top" :left="left" :memberInfo="memberInfoDwwy" :visible.sync="showObj['showDwwy']">
@click="clickItem('showDwwy')"> {{'党委委员'}}
<screen-popup-ydzl :top="top"
:left="left"
:memberInfo="memberInfo"
:visible.sync="showObj['showDwwy']">
</screen-popup-ydzl> </screen-popup-ydzl>
</div> </div>
</div> </div>
@ -82,42 +52,30 @@
<div> <div>
<div class="d-title grid-title"> <div class="d-title grid-title">
<img src="./../../assets/icon/point.png" /> <img src="./../../assets/icon/point.png" />
<div>{{'网格人员架构'}}</div> <div>{{ '网格人员架构' }}</div>
<div v-if="isStreet" <div v-if="isStreet && shibeiAgencyType == 'community'" class="agency-select">
class="agency-select"> <div class="item" ref="grid" @click="onChangeGrid">
<div class="item" <div>{{ selectGrid.label === '' ? '全部网格' : selectGrid.label }}</div>
ref="grid" <svg-icon icon-class="bottom-sword" fill="#8ec6d8">
@click="onChangeGrid">
<div>{{selectGrid.label === '' ? '全部网格' : selectGrid.label}}</div>
<svg-icon icon-class="bottom-sword"
fill="#8ec6d8">
</svg-icon> </svg-icon>
<screen-dropdown-menu top="45px" <screen-dropdown-menu top="45px" :menuList="gridList" :visible.sync="gridDropMenuVisible"
:menuList="gridList" :defaultSelected="selectGrid.value" @onChooseItem="onChooseGrid">
:visible.sync="gridDropMenuVisible"
:defaultSelected="selectGrid.value"
@onChooseItem="onChooseGrid">
</screen-dropdown-menu> </screen-dropdown-menu>
</div> </div>
</div> </div>
</div> </div>
<div class="frame"> <div class="frame">
<div class="frame-row"> <div class="frame-row">
{{gridName}} {{ gridName || '所属网格' }}
</div> </div>
<div class="frame-arrow"> <div class="frame-arrow">
<img src="./../../assets/icon/arrow.png" /> <img src="./../../assets/icon/arrow.png" />
</div> </div>
<div class="frame-onerow"> <div class="frame-onerow">
<div class="rowitem" <div class="rowitem" ref="showWgzb" @click="clickItem('showWgzb')"> {{ '网格支部书记' }}
ref="showWgzb" <screen-popup-ydzl :top="top" :left="left" :width="width" :memberInfo="memberInfo"
@click="clickItem('showWgzb')"> {{'网格支部书记'}} :visible.sync="showObj['showWgzb']">
<screen-popup-ydzl :top="top"
:left="left"
:width="width"
:memberInfo="memberInfo"
:visible.sync="showObj['showWgzb']">
</screen-popup-ydzl> </screen-popup-ydzl>
</div> </div>
@ -125,18 +83,12 @@
<div class="frame-arrow"> <div class="frame-arrow">
<img src="./../../assets/icon/arrow.png" /> <img src="./../../assets/icon/arrow.png" />
</div> </div>
<div class="frame-onerow" <div class="frame-onerow" ref="showWgz" @click="clickItem('showWgz')">
ref="showWgz" <div class="rowitem"> {{ '网格长' }}
@click="clickItem('showWgz')"> <screen-popup-ydzl :top="top" :left="left" :width="width" :memberInfo="memberInfo"
<div class="rowitem"> {{'网格长'}} :visible.sync="showObj['showWgz']">
<screen-popup-ydzl :top="top"
:left="left"
:width="width"
:memberInfo="memberInfo"
:visible.sync="showObj['showWgz']">
</screen-popup-ydzl> </screen-popup-ydzl>
</div> </div>
</div> </div>
<div class="grid"> <div class="grid">
@ -144,55 +96,43 @@
<div class="frame-arrow2"> <div class="frame-arrow2">
<img src="./../../assets/icon/arrow2.png" /> <img src="./../../assets/icon/arrow2.png" />
</div> </div>
<div class="grid-member"> <div class="grid-member">
<div class="grid-member-title">{{'专职网格员'}}</div> <div class="grid-member-title" @click="clickItem('showZzwgy')">{{ '专职网格员' }}</div>
<!-- v-if="isStreet" --> <screen-popup-ydzl :top="tops" :width="width" :left="left" :memberArr="memberInfoZzwgy"
<div :visible.sync="showObj['showZzwgy']">
class="grid-member-main"> </screen-popup-ydzl>
<div class="memberitem"
v-for="(item,index) in memberLeftList"
:key="index"
:ref="'leftMember'+index"
@click="clickLeftMemberItem(index)">
{{item.name}}
<screen-popup-ydzl :top="topMember"
:left="leftMember"
:width="widthMember"
:fontSize="fontSizeMember"
:memberInfo="memberInfo"
:visible.sync="showLeftMember[index]">
</screen-popup-ydzl>
</div>
</div>
</div> </div>
</div> </div>
<div class="grid-item"> <div class="grid-item">
<div class="frame-arrow2"> <div class="frame-arrow2">
<img src="./../../assets/icon/arrow2.png" /> <img src="./../../assets/icon/arrow2.png" />
</div> </div>
<!-- v-if="isStreet" -->
<div class="grid-member"> <div class="grid-member">
<div class="grid-member-title">{{'专职网格管理员'}}</div> <div class="grid-member-title" @click="clickItem('showBssb')">{{ '"北尚诉办"专职终端网格员' }}</div>
<div <screen-popup-ydzl :top="topss" :left="left" :memberInfo="memberInfoBssb"
class="grid-member-main"> :visible.sync="showObj['showBssb']">
<div class="memberitem" </screen-popup-ydzl>
v-for="(item,index) in memberRightList" </div>
:key="index" </div>
:ref="'rightMember'+index" <div class="grid-item">
@click="clickRightMemberItem(index)"> <div class="frame-arrow2">
{{item.name}} <img src="./../../assets/icon/arrow2.png" />
<screen-popup-ydzl :top="topMember" </div>
:left="leftMember" <div class="grid-member">
:width="widthMember" <div class="grid-member-title" @click="clickItem('showZywg')">{{ '专业网格管理员' }}</div>
:fontSize="fontSizeMember" <screen-popup-ydzl :top="tops" :left="left" :memberArr="memberInfoZywg" :visible.sync="showObj['showZywg']">
:memberInfo="memberInfo" </screen-popup-ydzl>
:visible.sync="showRightMember[index]"> </div>
</screen-popup-ydzl> </div>
</div> <div class="grid-item">
</div> <div class="frame-arrow2">
<img src="./../../assets/icon/arrow2.png" />
</div>
<div class="grid-member">
<div class="grid-member-title" @click="clickItem('showJzwg')">{{ '兼职网格管理员' }}</div>
<screen-popup-ydzl :top="tops" :left="left" :memberArr="memberInfoJzwg" :visible.sync="showObj['showJzwg']">
</screen-popup-ydzl>
</div> </div>
</div> </div>
</div> </div>
@ -202,23 +142,23 @@
<div class="left2-static"> <div class="left2-static">
<div class="static-item"> <div class="static-item">
<div class="static-item-title">网格支部</div> <div class="static-item-title">网格支部</div>
<div class="static-item-num">32</div> <div class="static-item-num">{{ wgzbTotal }}</div>
</div> </div>
<div class="static-item"> <div class="static-item">
<div class="static-item-title">网格支部书记</div> <div class="static-item-title">网格支部书记</div>
<div class="static-item-num">32</div> <div class="static-item-num">{{ wgzbsjTotal }}</div>
</div> </div>
<div class="static-item"> <div class="static-item">
<div class="static-item-title">网格长</div> <div class="static-item-title">网格长</div>
<div class="static-item-num">45</div> <div class="static-item-num">{{ wgzTotal }}</div>
</div> </div>
<div class="static-item"> <div class="static-item">
<div class="static-item-title">专职网格员</div> <div class="static-item-title">专职网格员</div>
<div class="static-item-num">121</div> <div class="static-item-num">{{ zzwgyTotal }}</div>
</div> </div>
<div class="static-item"> <div class="static-item">
<div class="static-item-title">专业网格管理员</div> <div class="static-item-title">专业网格管理员</div>
<div class="static-item-num">28</div> <div class="static-item-num">{{ zywgglyTotal }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -226,34 +166,22 @@
<script> <script>
import { mapGetters } from "vuex" import { mapGetters } from "vuex"
import { getListForCommnity, getListForGrid, getCommunityStatistics, getGridoption } from "../../api/hulianApi"
export default { export default {
name: "screen-left2", name: "screen-left2",
data () { data() {
return { return {
communityName: "即墨路街道-恩县路社区", communityName: "",
gridName: "恩县路社区-第一网格", gridName: "",
gridList: [ gridList: [],
{
name: '第一网格',
id: '1'
},
{
name: '第二网格',
id: '2'
},
{
name: '第三网格',
id: '3'
},
],
isStreet: false, isStreet: false,
top: '33px', top: '33px',
tops: '-143px',
topss: '-33px',
left: '0px', left: '0px',
width: '578px', width: '578px',
showObj: { showObj: {
showClgb: false, showClgb: false,
showYxgz: false, showYxgz: false,
@ -262,181 +190,84 @@ export default {
showSqfsj: false, showSqfsj: false,
showDwwy: false, showDwwy: false,
showZzwgy: false,
showBssb: false,
showZywg: false,
showJzwg: false,
showWgzb: false, showWgzb: false,
showWgz: false, showWgz: false,
}, },
gridDropMenuVisible: false, gridDropMenuVisible: false,
selectGrid: { selectGrid: {
value: '1',
label: '网格1'
}, },
gridList: [
{
value: '1',
label: '网格1'
},
{
value: '2',
label: '网格2'
},
{
value: '3',
label: '网格3'
},
],
memberInfo: { memberInfo: {
duty: '职务', duty: '职务',
name: '张三', name: '张三',
phone: '15999999999' phone: '15999999999'
}, },
clgbMemberInfo: {},
memberLeftList: [ memberInfoYxgz: [],
{ memberInfoDjzd: {},
duty: '职务', memberInfoDwwy: {},
name: '左1', memberInfoSqfs: {},
phone: '15111111111' memberInfoSqsj: {},
}, memberLeftList: [],
{
duty: '职务', memberInfoZzwgy: [],
name: '左2', memberInfoBssb: {},
phone: '15111111111' memberInfoZywg: [],
}, memberInfoJzwg: [],
{
duty: '职务', memberRightList: [],
name: '左3',
phone: '15111111111'
},
{
duty: '职务',
name: '左4',
phone: '15111111111'
},
{
duty: '职务',
name: '左5',
phone: '15111111111'
},
{
duty: '职务',
name: '左6',
phone: '15111111111'
},
{
duty: '职务',
name: '左7',
phone: '15111111111'
},
{
duty: '职务',
name: '左8',
phone: '15111111111'
},
{
duty: '职务',
name: '左9',
phone: '15111111111'
},
{
duty: '职务',
name: '左10',
phone: '15111111111'
},
{
duty: '职务',
name: '左11',
phone: '15111111111'
},
{
duty: '职务',
name: '左12',
phone: '15111111111'
},
{
duty: '职务',
name: '左13',
phone: '15111111111'
},
{
duty: '职务',
name: '左14',
phone: '15111111111'
},
{
duty: '职务',
name: '左15',
phone: '15111111111'
},
{
duty: '职务',
name: '左16',
phone: '15111111111'
}
],
memberRightList: [
{
duty: '职务',
name: '右1',
phone: '15111111111'
},
{
duty: '职务',
name: '右2',
phone: '15111111111'
},
{
duty: '职务',
name: '右3',
phone: '15111111111'
},
{
duty: '职务',
name: '右4',
phone: '15111111111'
},
{
duty: '职务',
name: '右5',
phone: '15111111111'
},
],
showLeftMember: [], showLeftMember: [],
showRightMember: [], showRightMember: [],
topMember: '26px', topMember: '26px',
leftMember: '0px', leftMember: '0px',
widthMember: '100px', widthMember: '100px',
fontSizeMember: '15px' fontSizeMember: '15px',
wgzbTotal: '',
wgzbsjTotal: '',
wgzTotal: '',
zzwgyTotal: '',
zywgglyTotal: ''
} }
}, },
created () { created() {
}, },
watch: { watch: {
shibeiAId (value) { shibeiAId(value) {
console.log('切换区域id:' + value) console.log('切换区域id:' + value)
console.log('切换区域Name:' + this.shibeiName) console.log('切换区域Name:' + this.shibeiName)
console.log('切换区域类型:' + this.shibeiAgencyType) console.log('切换区域类型:' + this.shibeiAgencyType)
this.communityName = this.shibeiName this.communityName = this.shibeiName
if (this.shibeiAgencyType === 'street') { if (this.shibeiAgencyType === 'community') {
this.isStreet = true this.getGridoption()
this.getCommunityStatistics()
if (value) {
this.isStreet = true
} else {
this.isStreet = false
}
} else { } else {
this.isStreet = false this.isStreet = false
} }
} }
}, },
computed: { computed: {
...mapGetters(['shibeiAId', 'shibeiName', 'shibeiAgencyType']) ...mapGetters(['shibeiAId', 'shibeiName', 'shibeiAgencyType'])
}, },
mounted () { mounted() {
if (this.shibeiAgencyType === 'street') { console.log(this.shibeiAgencyType);
if (this.shibeiAgencyType === 'community') {
console.log(this.selectGrid.label);
this.isStreet = true this.isStreet = true
this.gridName = this.selectGrid.label
} else { } else {
this.isStreet = false this.isStreet = false
} }
@ -492,7 +323,7 @@ export default {
}, },
methods: { methods: {
initShow (type) { initShow(type) {
for (let key in this.showObj) { for (let key in this.showObj) {
if (key !== type) { if (key !== type) {
@ -501,21 +332,129 @@ export default {
} }
}, },
clickItem (type) { async getCommunityStatistics() {
try {
let params = {
communityId: this.shibeiAId,//this.shibeiAId
}
const { data, code, msg } = await getListForGrid(params)
if (code == 0) {
this.wgzbTotal = data.girdNum || 0;
this.wgzbsjTotal = data.girdShujiNum || 0;
this.wgzTotal = data.girdHeadNum || 0;
this.zzwgyTotal = data.girdZhuanzhiNum || 0;
this.zywgglyTotal = data.girdZhuanyeNum || 0;
}
} catch (err) {
console.error(err)
}
},
async getListForCommnity(type) {
try {
let params = {
communityId: this.shibeiAId,//1202772469238554625
type
}
const { data, code, msg } = await getListForCommnity(params)
if (code == 0) {
const typeMap = {
'1': 'clgbMemberInfo',
'2': 'memberInfoYxgz',
'3': 'memberInfoDjzd',
'4': 'memberInfoSqsj',
'5': 'memberInfoSqfs',
'6': 'memberInfoDwwy',
};
const propertyName = typeMap[type];
if (propertyName) {
this[propertyName] = (type === '2') ? data.map(item => ({ name: item.name, phone: item.mobile })) : {
name: data[0].name,
phone: data[0].mobile
};
}
}
} catch (err) {
console.error(err)
}
},
async getListForGrid(type) {
try {
let params = {
gridId: this.shibeiAId,//'1224237268259110914'
type: type - 6
}
const { data, code, msg } = await getListForGrid(params)
if (code == 0) {
const typeMap = {
'1': 'memberInfoZzwgy',
'2': 'memberInfoBssb',
'3': 'memberInfoZywg',
'4': 'memberInfoJzwg'
};
const propertyName = typeMap[type - 6];
console.log(propertyName);
if (propertyName) {
this[propertyName] = (type === '8') ? { name: data[0].name, phone: data[0].mobile } : data.map(item => ({ name: item.name, phone: item.mobile, property: item.property }));
}
}
} catch (err) {
console.error(err)
}
},
async getGridoption() {
try {
let params = {
agencyId: this.shibeiAId,
purpose: 'addorupdate'
}
const { data, code, msg } = await getGridoption(params)
if (code == 0) {
if (data) {
this.gridList = data.map(item => ({ label: item.label, id: item.value }))
this.selectGrid = { label: this.gridList[0].label, id: this.gridList[0].value }
this.gridName = this.selectGrid.label
console.log(this.gridList);
}
}
} catch (err) {
console.error(err)
}
},
clickItem(type) {
const typeMap = {
'showClgb': '1',
'showYxgz': '2',
'showDjzd': '3',
'showSqsj': '4',
'showSqfsj': '5',
'showDwwy': '6',
'showZzwgy': '7',
'showBssb': '8',
'showZywg': '9',
'showJzwg': '10',
};
const selectedType = typeMap[type];
if (selectedType && Number(selectedType) < 7) {
this.getListForCommnity(selectedType);
} else {
this.getListForGrid(selectedType);
}
if (this.isStreet) { if (this.isStreet) {
this.initShow(type) this.initShow(type)
this.showObj[type] = !this.showObj[type] this.showObj[type] = !this.showObj[type]
} }
}, },
onChangeGrid () { onChangeGrid() {
this.gridDropMenuVisible = !this.gridDropMenuVisible this.gridDropMenuVisible = !this.gridDropMenuVisible
}, },
onChooseGrid (gridItem) { onChooseGrid(gridItem) {
console.log(gridItem, '选中id');
this.selectGrid = gridItem this.selectGrid = gridItem
this.gridName = this.selectGrid.label this.gridName = this.selectGrid.label
}, },
clickLeftMemberItem (index) { clickLeftMemberItem(index) {
const position = (index + 1) % 3//popup const position = (index + 1) % 3//popup
console.log(position) console.log(position)
@ -531,7 +470,7 @@ export default {
this.$set(this.showLeftMember, index, val) this.$set(this.showLeftMember, index, val)
}, },
clickRightMemberItem (index) { clickRightMemberItem(index) {
const position = (index + 1) % 3//popup const position = (index + 1) % 3//popup
console.log(position) console.log(position)
if (position === 1) {//1 if (position === 1) {//1
@ -541,11 +480,8 @@ export default {
} else if (position === 0) { } else if (position === 0) {
this.leftMember = '-24px' this.leftMember = '-24px'
} }
const val = !this.showRightMember[index] const val = !this.showRightMember[index]
this.$set(this.showRightMember, index, val) this.$set(this.showRightMember, index, val)
} }
} }
} }
@ -554,4 +490,9 @@ export default {
<style lang="scss" src="style/left2.scss" scoped></style> <style lang="scss" src="style/left2.scss" scoped></style>
<style lang="scss" src="style/agencySelect.scss" scoped></style> <style lang="scss" src="style/agencySelect.scss" scoped></style>
<style lang="scss" scoped> <style lang="scss" scoped>
.frame-arrow {
img {
height: 53px;
}
}
</style> </style>

43
src/views/screenLeft/left3.vue

@ -10,12 +10,12 @@
<div class="chartsGl" id="charts"></div> <div class="chartsGl" id="charts"></div>
<!-- 饼图下面的底座 --> <!-- 饼图下面的底座 -->
<div class="buttomCharts"></div> <div class="buttomCharts"></div>
<div class="legend"> <!-- <div class="legend">
<div class="legend-item" v-for="(item, index) in optionData" :key="index"> <div class="legend-item" v-for="(item, index) in optionData" :key="index">
<div class="item-icon" :style="{ background: item.itemStyle.color }"></div> <div class="item-icon" :style="{ background: item.itemStyle.color }"></div>
<div class="item-name">{{ item.name }}</div> <div class="item-name">{{ item.name }}</div>
</div> </div>
</div> </div> -->
</div> </div>
</div> </div>
<div class='b-ljhd'> <div class='b-ljhd'>
@ -35,7 +35,9 @@ import * as echarts from 'echarts'
import 'echarts-gl' import 'echarts-gl'
import { loadLjhdList } from './../../data/index' import { loadLjhdList } from './../../data/index'
import { getIcpartyactivity } from '../../api/hulianApi' import { getIcpartyactivity ,getTypestatistics} from '../../api/hulianApi'
import { mapGetters } from "vuex"
export default { export default {
name: "screen-left3", name: "screen-left3",
data() { data() {
@ -84,17 +86,37 @@ export default {
} }
}, },
mounted() { async mounted() {
this.getIcpartyactivity() await this.getIcpartyactivity()
// await this.getTypestatistics()
this.$nextTick(function () { this.$nextTick(function () {
this.initChart(); this.initChart();
}); });
}, },
computed: {
...mapGetters(['shibeiAId'])
},
methods: { methods: {
async getTypestatistics(){
try {
let params = {
agencyId:this.shibeiAId || '1175270520603930625',//this.shibeiAId
}
const { data, code, msg } = await getTypestatistics(params)
if(code == 0){
this.optionData.forEach((item,index)=>{
item.name = data[index].label,
item.value = data[index].value
})
console.log( this.optionData);
}
} catch (err) {
console.error(err)
}
},
async getIcpartyactivity() { async getIcpartyactivity() {
let params = { let params = {
agencyId: '1175270520603930625', agencyId: this.shibeiAId|| '1175270520603930625',
pageSize: 50, pageSize: 50,
pageNo: 1 pageNo: 1
} }
@ -248,6 +270,13 @@ export default {
min: -1, min: -1,
max: 1 max: 1
}, },
// legend:{
// bottom:20,
// // left: '-15%',
// textStyle: {
// color: '#fff !important'
// }
// },
// //
grid3D: { grid3D: {
show: false, show: false,

2
src/views/screenRight/right1.vue

@ -217,14 +217,12 @@ export default {
} }
}, },
onHover(e) { onHover(e) {
console.log(e.target.className)
if (e.target.className === 'dyfc-item-row3') { if (e.target.className === 'dyfc-item-row3') {
// console.log(e.target); // console.log(e.target);
let index = e.target.id; let index = e.target.id;
let item = JSON.parse(e.target.dataset.obj); let item = JSON.parse(e.target.dataset.obj);
this.showContent = this.dyfcList[index - 1].mainDeed this.showContent = this.dyfcList[index - 1].mainDeed
this.popupVisible = true this.popupVisible = true
console.log(this.popupVisible);
} else if (e.target.className === 'screen-popup-content') { } else if (e.target.className === 'screen-popup-content') {
this.popupVisible = true this.popupVisible = true
} else { } else {

1
src/views/screenRight/right3.vue

@ -522,7 +522,6 @@ export default {
element.developCount, element.developCount,
element.lawCount, element.lawCount,
]); ]);
console.log(this.eventStatList);
}, },
} }
} }

Loading…
Cancel
Save