Browse Source

调整宽度

master
mk 2 years ago
parent
commit
a54d746f40
  1. 20
      src/api/hulianApi.js
  2. BIN
      src/assets/images/map/yellow.png
  3. 987
      src/views/screenCenter/maoCopy.vue
  4. 556
      src/views/screenCenter/screenCenter.vue
  5. 7
      src/views/screenHeader.vue
  6. 59
      src/views/screenLeft/left1.vue
  7. 25
      src/views/screenRight/right2.vue
  8. 60
      src/views/screenRight/right3.vue

20
src/api/hulianApi.js

@ -147,5 +147,21 @@ export function getScreenUserList(data) {
params: data
})
}
//地图-微网格列表 gridId=1224135071215190018
export function getSearchByGridId(data) {
return request({
baseURL,
url: '/gov/org/customerMicroGrid/screen/searchByGridId',
method: 'GET',
params: data
})
}
//地图-微网格详情 microGridId=1727515722002432002
export function getSearchByGridIdDetail(data) {
return request({
baseURL,
url: '/gov/org/customerMicroGrid/screen/detail',
method: 'GET',
params: data
})
}

BIN
src/assets/images/map/yellow.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

987
src/views/screenCenter/maoCopy.vue

@ -0,0 +1,987 @@
<template>
<div class="screen-center">
<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;">
<el-image style="width: 50px; height: 50px;" :src="require('../../assets/back.png')" fit="fill"></el-image>
</div>
<div
style="position: absolute;right:50px;bottom:50px;z-index: 100;border-radius: 16px;padding:20px; border: 1px solid #045775;font-size: 40px;color: #fff;height: 400px;display: flex;flex-direction: column;justify-content: space-around;">
<div v-for="item in buttonPiece" :key="item.value"
style="display: flex;align-items: center;cursor: pointer;padding: 8px 0;"
@click="selectType(item.value, item.label)"
:style="{ background: item.value == buttonIndex ? 'linear-gradient(to top, rgba(16, 98, 130,1), rgba(16, 98, 130,0))' : '' }">
<el-image style="width: 40px; height: 40px;margin-right: 12px;" :src="require('../../assets/ling.png')"
fit="fill"></el-image>
{{ item.label }}
</div>
</div>
<div v-if="showFirst"
style="position: absolute;right:1200px;bottom:200px;z-index: 100;padding:20px;font-size: 40px;color: #fff;height: 500px;display: flex;flex-direction: column;justify-content:space-around;border-radius: 16px;padding:20px; border: 1px solid #045775;align-items: center;background-color: rgba(5, 36, 49,0.5);">
<div
style="margin-bottom: 24px;display: flex;justify-content: space-between;align-items: center;width: 100%;">
<div>
</div>
<div>
微网格信息
</div>
<div style="color: #fff;cursor: pointer;" @click="close">
x
</div>
</div>
<div v-for="item in microgridArr" :key="item.value"
style="display: flex;flex-direction: row;align-items: center;cursor: pointer;padding: 4px;"
@click="microgridDetails(item)"
:style="{ background: item.value == microgridIndex ? 'linear-gradient(to right, rgba(16, 98, 130,1), rgba(16, 98, 130,0))' : '' }">
<div style="margin-right:80px">
<el-image style="width: 40px; height: 40px;margin-right: 12px;vertical-align: text-top;"
:src="require('../../assets/ling.png')" fit="fill"></el-image>
{{ item.label }}
</div>
<div>
>
</div>
</div>
</div>
<div v-if="showMicrogridDetails"
style="position: absolute;right:400px;bottom:100px;z-index: 100;padding:20px;font-size: 40px;color: #fff;height: auto;display: flex;flex-direction: column;border-radius: 16px;padding:20px; border: 1px solid #045775;background-color: rgba(7, 100, 133,0.5);">
<div style="margin-bottom: 38px;">
<div
style="background: linear-gradient(to right, rgba(6, 227, 218,1), rgba(6, 227, 218,0));display: flex;justify-content: space-between;flex-direction: row;padding: 12px;margin-bottom: 38px;">
<div>
{{ microgridObj.firstTitle || "--" }}
</div>
<div style="color: #fff;cursor: pointer;" @click="showMicrogridDetails = false">
x
</div>
</div>
<div>
<div style="margin-bottom: 38px;">
微网格长{{ microgridObj.leader }}
</div>
<div style="margin-bottom: 38px;">
性别{{ microgridObj.gender }}
</div>
<div style="margin-bottom: 38px;">
电话{{ microgridObj.phone }}
</div>
<div style="margin-bottom: 38px;">
住址{{ microgridObj.address }}
</div>
</div>
</div>
<div>
<div
style="background: linear-gradient(to right, rgba(6, 227, 218,1), rgba(6, 227, 218,0));display: flex;justify-content: space-between;flex-direction: row;padding: 12px;margin-bottom: 38px;">
<div>
{{ microgridObj.secondTitle || "--" }}
</div>
<div>
总数{{ microgridObj.total || "--" }}
</div>
</div>
<div
style="max-width: 700px;min-width: 700px;overflow-x: clip; text-overflow:ellipsis;white-space: nowrap;">
<div v-for="item in microgridObj.list" :key="item.value"
style="margin-bottom: 30px;cursor: pointer;" :title="item.label">
<span style="margin-right: 12px;">
{{ item.value }}
</span>
<span>
{{ item.label }}
</span>
</div>
</div>
</div>
<div style="display: flex;justify-content: flex-end;">
<el-pagination background layout="prev, pager, next" :total="microgridObj.total"
@current-change="handleCurrentChange">
</el-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
import markIcon from "@/assets/position.png";
import markIcons from "@/assets/positions.png";
import * as turf from '@turf/turf';
import axios from 'axios';
import mapboxgl from 'mapbox-gl';
import 'mapbox-gl/dist/mapbox-gl.css';
import { mapGetters } from "vuex";
const md5 = require('blueimp-md5');
export default {
name: "screen-center",
data() {
return {
map: null,
colorList: ["#F84E2D", "#1372EC", "#44DEA3", "#FFC544", "#6C44FF"],
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,
topNum: [
{
label: "用户总数",
value: 330195
},
{
label: "党员总数",
value: 74830
},
{
label: "党群总数",
value: 9501
},
{
label: "话题总数",
value: 286508
},
{
label: "议题总数",
value: 223829
},
{
label: "诉求总数",
value: 215450
}
],
buttonPiece: [
{
value: 1,
label: "居民"
},
{
value: 2,
label: "房屋"
},
{
value: 3,
label: "党支部"
},
// {
// value: 4,
// label: ""
// },
// {
// value: 5,
// label: ""
// },
// {
// value: 6,
// label: ""
// }
],
buttonIndex: 0,
markerJson: null,
layersIndex: 1,
features: {},
showFirst: false,
showMicrogridDetails: false,
microgridArr: [
{
value: 1,
label: "第一微网格"
},
{
value: 2,
label: "第二微网格"
},
{
value: 3,
label: "第三微网格"
},
{
value: 4,
label: "第四微网格"
},
{
value: 5,
label: "第五微网格"
},
{
value: 6,
label: "第六微网格"
},
],
microgridIndex: 0,
microgridObj: {
firstTitle: "",
leader: "张俊凯",
gender: "男",
phone: "15623523200",
address: "市北区",
secondTitle: "包干房屋",
total: 37,
list: [
{
value: 1,
label: "市北区台柳路12号4单元101"
},
{
value: 2,
label: "市北区敦化路53号4号楼2单元202"
},
{
value: 3,
label: "市北区山东路168号时代国际广场1402号"
},
{
value: 4,
label: "市北区山东路120号玫瑰花园6号楼3单元506"
},
{
value: 5,
label: "市北区南宁路32号2单元501"
},
{
value: 6,
label: "市北区台柳路12号4单元101"
},
{
value: 7,
label: "市北区台柳路12号4单元101"
},
{
value: 8,
label: "市北区台柳路12号4单元101"
},
{
value: 9,
label: "市北区台柳路12号4单元101"
},
{
value: 10,
label: "市北区台柳路12号4单元101"
},
{
value: 11,
label: "市北区台柳路12号4单元101"
},
{
value: 12,
label: "市北区台柳路12号4单元101"
},
{
value: 13,
label: "市北区台柳路12号4单元101"
},
{
value: 14,
label: "市北区台柳路12号4单元101"
},
{
value: 15,
label: "市北区台柳路12号4单元101"
},
{
value: 16,
label: "市北区台柳路12号4单元101"
},
{
value: 17,
label: "市北区台柳路12号4单元101"
},
{
value: 18,
label: "市北区台柳路12号4单元101"
},
{
value: 19,
label: "市北区台柳路12号4单元101"
},
{
value: 20,
label: "市北区台柳路12号4单元101"
},
]
},
microgridObjCopy: {
firstTitle: "",
leader: "张俊凯",
gender: "男",
phone: "15623523200",
address: "市北区",
secondTitle: "包干房屋",
total: 37,
list: [
{
value: 1,
label: "市北区台柳路12号4单元101"
},
{
value: 2,
label: "市北区敦化路53号4号楼2单元202"
},
{
value: 3,
label: "市北区山东路168号时代国际广场1402号"
},
{
value: 4,
label: "市北区山东路120号玫瑰花园6号楼3单元506"
},
{
value: 5,
label: "市北区南宁路32号2单元501"
},
{
value: 6,
label: "市北区台柳路12号4单元101"
},
{
value: 7,
label: "市北区台柳路12号4单元101"
},
{
value: 8,
label: "市北区台柳路12号4单元101"
},
{
value: 9,
label: "市北区台柳路12号4单元101"
},
{
value: 10,
label: "市北区台柳路12号4单元101"
},
{
value: 11,
label: "市北区台柳路12号4单元101"
},
{
value: 12,
label: "市北区台柳路12号4单元101"
},
{
value: 13,
label: "市北区台柳路12号4单元101"
},
{
value: 14,
label: "市北区台柳路12号4单元101"
},
{
value: 15,
label: "市北区台柳路12号4单元101"
},
{
value: 16,
label: "市北区台柳路12号4单元101"
},
{
value: 17,
label: "市北区台柳路12号4单元101"
},
{
value: 18,
label: "市北区台柳路12号4单元101"
},
{
value: 19,
label: "市北区台柳路12号4单元101"
},
{
value: 20,
label: "市北区台柳路12号4单元101"
},
]
},
}
},
mounted() {
this.shibeiJson = require('./shibei.json');
console.log(this.shibeiJson);
for (let i in this.shibeiJson.features) {
this.shibeiJson.features[i].properties.resiNum = '88',
this.shibeiJson.features[i].properties.houseNum = '66'
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: {
...mapGetters(['shibeiAId', 'shibeiName', 'shibeiAgencyType']),
getThousandth() {
return function (val) {
if (!val) {
return "--"
}
return val.toLocaleString()
}
}
},
watch: {
shibeiAId(value) {
this.topNum.forEach((f, i, arr) => {
arr[i]["value"] = f.value - 1000
})
}
},
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) {
console.log(e);
const features = _this.map.queryRenderedFeatures(e.point);
console.log(features);
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': 310,
'fill-extrusion-opacity': 0.3 //
}
});
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) {
// if (value === this.buttonIndex) {
// this.buttonIndex = 0
// this.makeMarkers(this.markerJson)
// return
// }
this.buttonIndex = value
if (this.map.getLayer('text_JSON_layer-num')) {
this.map.removeLayer('text_JSON_layer-num');
}
let json = {
"type": "FeatureCollection",
"features": JSON.parse(JSON.stringify(this.markerJson.features)).filter(f => {
return f.properties.name == label
})
}
if (value == 1) {
this.map.addLayer({
id: "text_JSON_layer-num",
type: "symbol",
source: "shibeiPolygonSource",
// minzoom: 5,
// maxzoom: 22,
interactive: true,
paint: {
'text-color': '#fff',
},
"layout": {
"text-field": "{resiNum}",
'text-size': 25,
'text-offset': [0, -1.5]
}
});
} else if (value == 2) {
this.map.addLayer({
id: "text_JSON_layer-num",
type: "symbol",
source: "shibeiPolygonSource",
// minzoom: 5,
// maxzoom: 22,
interactive: true,
paint: {
'text-color': '#fff',
},
"layout": {
"text-field": "{houseNum}",
'text-size': 25,
'text-offset': [0, -1.5]
}
});
} else if (value == 3) {
this.map.addLayer({
id: "text_JSON_layer-num",
type: "symbol",
source: "shibeiPolygonSource",
// minzoom: 5,
// maxzoom: 22,
interactive: true,
paint: {
'text-color': '#fff',
},
"layout": {
"text-field": "{partNum}",
'text-size': 25,
'text-offset': [0, -1.5]
}
});
}
this.makeMarkers(json)
},
getBoundary(id) {
const ts = Date.now();
let signConfig = {
key: '612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970',
dataType: 'real',
appId: 'acc4ad66c82a7b46e741364b4c62dce2',
customerId: 'b09527201c4409e19d1dbc5e3c3429a1',
authType: 'md5',
}
const token = md5(`${signConfig.key}:${ts}`);
axios({
method: "post",
url: "https://epmet-open.elinkservice.cn/api/data/report/screen/agency/compartment",
data: {
agencyId: id
},
headers: {
AccessToken: token,
AppId: signConfig.appId,
CustomerId: signConfig.customerId,
AuthType: signConfig.authType,
ts
}
}).then(e => {
if (e.data.code == 0 && e.data.data) {
if (e.data.data.agencyDistribution && e.data.data.agencyDistribution.length == 0) {
return
}
console.log(e.data);
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
}
}
}).catch(f => {
console.log(f);
})
},
makeMarkers(json) {
const _this = this;
if (_this.map.getLayer("pointDimension")) {
_this.map.removeLayer("pointDimension")
_this.map.removeSource("pointDimension")
_this.map.removeImage("markIcon")
}
_this.map.loadImage(markIcon, function (error, image) {
_this.map.addImage("markIcon", image);
_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>
<style lang="scss" scoped>
.screen-center {
flex: 1;
min-width: 1000px;
background: url('../../assets/images/mapBg.png') no-repeat;
background-size: 100% 100%;
}
::v-deep .mapboxgl-ctrl {
display: none !important;
}
::v-deep .el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: #0aabca;
}
</style>

556
src/views/screenCenter/screenCenter.vue

@ -16,27 +16,24 @@
</div>
</div>
<div v-if="showFirst"
style="position: absolute;right:1200px;bottom:200px;z-index: 100;padding:20px;font-size: 21px;color: #fff;height: 310px;display: flex;flex-direction: column;justify-content:space-around;border-radius: 16px;padding:20px; border: 1px solid #045775;align-items: center;background-color: rgba(5, 36, 49,0.5);">
<div
style="margin-bottom: 24px;display: flex;justify-content: space-between;align-items: center;width: 100%;">
<div>
</div>
<div>
微网格信息
style="position: absolute;right:1200px;bottom:394px;z-index: 100;padding:6px 20px 20px 0;font-size: 21px;color: #fff;height: 310px;display: flex;flex-direction: column;justify-content:space-around; align-items: center;background: rgba(0, 27, 37, 0.83);overflow: hidden;">
<div style="display: flex;justify-content: space-between;align-items: center;width: 100%; padding-left: 22px;box-sizing: border-box;"
class="after">
<div style="display:flex;align-items:center;">
<img src="../../assets/images/map/yellow.png" alt="" style="margin-right:5px;"> 微网格信息
</div>
<div style="color: #fff;cursor: pointer;" @click="close">
x
</div>
</div>
<div v-for="item in microgridArr" :key="item.value"
style="display: flex;flex-direction: row;align-items: center;cursor: pointer;padding: 4px;"
style="display: flex;flex-direction: row;align-items: center;cursor: pointer;padding-left: 20px;"
@click="microgridDetails(item)"
:style="{ background: item.value == microgridIndex ? 'linear-gradient(to right, rgba(16, 98, 130,1), rgba(16, 98, 130,0))' : '' }">
<div style="margin-right:80px">
<el-image style="width: 40px; height: 40px;margin-right: 12px;vertical-align: text-top;"
:style="{ background: item.id == microgridIndex ? 'linear-gradient(to right, rgba(16, 98, 130,1), rgba(16, 98, 130,0))' : '' }">
<div style="margin-right:80px ;display:flex;align-items:center;">
<el-image style="width: 15px; height: 15px;margin-right: 12px;vertical-align: text-top;"
:src="require('../../assets/ling.png')" fit="fill"></el-image>
{{ item.label }}
{{ item.microgridName }}
</div>
<div style="height: 100%;">
>
@ -44,67 +41,79 @@
</div>
</div>
<div v-if="showMicrogridDetails"
style="position: absolute;right:400px;bottom:199px;z-index: 100;padding:20px;font-size: 20px;color: #fff;height: 500px;display: flex;flex-direction: column;border-radius: 16px;padding:20px; border: 1px solid #045775;background-color: rgba(7, 100, 133,0.5);">
style="position: absolute;right: 609px;bottom: 250px;z-index: 100;padding:20px;font-size: 20px;color: #fff;height: 500px;width: 550px;display: flex;flex-direction: column; box-sizing:border-box"
class="imageBg">
<div style="margin-bottom: 15px;">
<div
style="background: linear-gradient(to right, rgba(6, 227, 218,1), rgba(6, 227, 218,0));display: flex;justify-content: space-between;flex-direction: row;padding: 12px;margin-bottom: 38px;">
<div>
{{ microgridObj.firstTitle || "--" }}
<div style="display: flex;justify-content: space-between;flex-direction: row;padding: 12px;margin-bottom: 38px;"
class="titleBg">
<div style="margin-left: 38px;font-family: Alibaba PuHuiTi;font-weight: 400;">
{{ microgridObj.microgridName || "--" }}
</div>
<div style="color: #fff;cursor: pointer;" @click="showMicrogridDetails = false">
x
</div>
</div>
<div>
<section style="box-sizing:border-box;padding:0 20px;">
<div style="margin-bottom: 15px;">
微网格长{{ microgridObj.leader }}
<span class="label">描述范围</span> {{ microgridObj.address }}
</div>
<div style="margin-bottom: 15px;">
性别{{ microgridObj.gender }}
<div style="display: flex;flex-flow: wrap;">
<div style="margin-bottom: 15px;width: 50%;">
<span class="label">楼座数层数</span>{{ microgridObj.buildingNum || 0 }}
</div>
<div style="margin-bottom: 15px;width: 50%;">
<span class="label">居民户数</span>{{ microgridObj.houseNum || 0 }}
</div>
<div style="margin-bottom: 15px;width: 50%;">
<span class="label">居民人数</span>{{ microgridObj.resiNum || 0 }}
</div>
<div style="margin-bottom: 15px;width: 50%;">
<span class="label">党员人数</span>{{ microgridObj.dangyuanNum || 0 }}
</div>
</div>
<div style="margin-bottom: 15px;">
电话{{ microgridObj.phone }}
</div>
<div style="margin-bottom: 15px;">
住址{{ microgridObj.address }}
</div>
</div>
</section>
</div>
<div>
<div
style="background: linear-gradient(to right, rgba(6, 227, 218,1), rgba(6, 227, 218,0));display: flex;justify-content: space-between;flex-direction: row;padding: 12px;margin-bottom: 15px;">
<div>
{{ microgridObj.secondTitle || "--" }}
<div style="display: flex;justify-content: space-between;flex-direction: row;padding: 12px;margin-bottom: 15px;"
class="titleBg">
<div style="margin-left:38px">
微网格力量
</div>
<div>
总数{{ microgridObj.total || "--" }}
</div>
</div>
<div
style="width: 484px;;overflow-x: clip; text-overflow:ellipsis;white-space: nowrap;padding: 0 20px;box-sizing: border-box;">
<div v-for="item in microgridObj.list" :key="item.value"
style="margin-bottom: 15px;cursor: pointer;" :title="item.label">
<span style="margin-right: 12px;">
{{ item.value }}
</span>
<span>
{{ item.label }}
</span>
style="width: 484px;overflow-x: clip; text-overflow:ellipsis;white-space: nowrap;padding: 0 20px;box-sizing: border-box;">
<div>
<div><span class="label">党小组组长</span> -- </div>
<div><span class="label">楼组长</span> --</div>
<div><span class="label">公益岗</span> --</div>
<div><span class="label">街道包联干部</span> --</div>
<div><span class="label">社区包联干部</span> --</div>
</div>
</div>
</div>
<div style="display: flex;justify-content: flex-end;">
<el-pagination background layout="prev, pager, next" :total="microgridObj.total"
@current-change="handleCurrentChange">
</el-pagination>
</div>
</div>
<div v-if="showResiTable" class="resiTable">
<div>
<div class="resiTitle">人员信息 <span @click=" showResiTable = false">x</span></div>
<div class="tabs">
<div :class="['item', { 'item-active': active === 'all' }]" @click="handleClickTabs('all')">全部</div>
<!-- -->
<div :class="['item', { 'item-active': active === 'dy' }]" @click="handleClickTabs('dy')" >
党员{{ dyTotal ||0 }}</div>
<div :class="['item', { 'item-active': active === 'gyg' }]" @click="handleClickTabs('gyg')" >公益岗0
</div>
<div :class="['item', { 'item-active': active === 'xfdw' }]" @click="handleClickTabs('xfdw')" >先锋队伍0
</div>
<div :class="['item', { 'item-active': active === 'hshhr' }]" @click="handleClickTabs('hshhr')" >红色合伙人0
</div>
</div>
<div style="width: 531px;padding: 0 20px;box-sizing: border-box;overflow-x: clip; text-overflow:ellipsis;white-space: nowrap;"
v-if="resiList.length > 0">
<div v-for="(item, index) in resiList" :key="item.mobile"
@ -122,7 +131,7 @@
</div>
</div>
<div v-else
style="width: 531px;display: flex;align-items: center;justify-content:center;height: 382px;">
style="width: 531px;display: flex;align-items: center;justify-content:center;height: 350px;">
暂无数据~
</div>
</div>
@ -176,7 +185,7 @@ import shibeiJson from './shibei.json';
import shibeiJson1 from './shibei1.json';
import maskJson from './markerJson.json';
import { getScreenHouseStatistics, getScreenUserStatistics, getScreenHouseList, getScreenUserList } from "../../api/hulianApi"
import { getScreenHouseStatistics, getScreenUserStatistics, getScreenHouseList, getScreenUserList, getSearchByGridId, getSearchByGridIdDetail } from "../../api/hulianApi"
const md5 = require('blueimp-md5');
let myMap;
@ -200,7 +209,6 @@ export default {
name: "screen-center",
data() {
return {
colorList: ["#F84E2D", "#1372EC", "#44DEA3", "#FFC544", "#6C44FF"],
attrAndColor: [],
hoveredStateId: null,
@ -224,214 +232,10 @@ export default {
layersIndex: 1,
showFirst: false,
showMicrogridDetails: false,
microgridArr: [
{
value: 1,
label: "第一微网格"
},
{
value: 2,
label: "第二微网格"
},
{
value: 3,
label: "第三微网格"
},
{
value: 4,
label: "第四微网格"
},
{
value: 5,
label: "第五微网格"
},
{
value: 6,
label: "第六微网格"
},
],
microgridArr: [],
microgridIndex: 0,
microgridObj: {
firstTitle: "",
leader: "张俊凯",
gender: "男",
phone: "15623523200",
address: "市北区",
secondTitle: "包干房屋",
total: 37,
list: [
{
value: 1,
label: "市北区台柳路12号4单元101"
},
{
value: 2,
label: "市北区敦化路53号4号楼2单元202"
},
{
value: 3,
label: "市北区山东路168号时代国际广场1402号"
},
{
value: 4,
label: "市北区山东路120号玫瑰花园6号楼3单元506"
},
{
value: 5,
label: "市北区南宁路32号2单元501"
},
{
value: 6,
label: "市北区台柳路12号4单元101"
},
{
value: 7,
label: "市北区台柳路12号4单元101"
},
{
value: 8,
label: "市北区台柳路12号4单元101"
},
{
value: 9,
label: "市北区台柳路12号4单元101"
},
{
value: 10,
label: "市北区台柳路12号4单元101"
},
{
value: 11,
label: "市北区台柳路12号4单元101"
},
{
value: 12,
label: "市北区台柳路12号4单元101"
},
{
value: 13,
label: "市北区台柳路12号4单元101"
},
{
value: 14,
label: "市北区台柳路12号4单元101"
},
{
value: 15,
label: "市北区台柳路12号4单元101"
},
{
value: 16,
label: "市北区台柳路12号4单元101"
},
{
value: 17,
label: "市北区台柳路12号4单元101"
},
{
value: 18,
label: "市北区台柳路12号4单元101"
},
{
value: 19,
label: "市北区台柳路12号4单元101"
},
{
value: 20,
label: "市北区台柳路12号4单元101"
},
]
},
microgridObjCopy: {
firstTitle: "",
leader: "张俊凯",
gender: "男",
phone: "15623523200",
address: "市北区",
secondTitle: "包干房屋",
total: 37,
list: [
{
value: 1,
label: "市北区台柳路12号4单元101"
},
{
value: 2,
label: "市北区敦化路53号4号楼2单元202"
},
{
value: 3,
label: "市北区山东路168号时代国际广场1402号"
},
{
value: 4,
label: "市北区山东路120号玫瑰花园6号楼3单元506"
},
{
value: 5,
label: "市北区南宁路32号2单元501"
},
{
value: 6,
label: "市北区台柳路12号4单元101"
},
{
value: 7,
label: "市北区台柳路12号4单元101"
},
{
value: 8,
label: "市北区台柳路12号4单元101"
},
{
value: 9,
label: "市北区台柳路12号4单元101"
},
{
value: 10,
label: "市北区台柳路12号4单元101"
},
{
value: 11,
label: "市北区台柳路12号4单元101"
},
{
value: 12,
label: "市北区台柳路12号4单元101"
},
{
value: 13,
label: "市北区台柳路12号4单元101"
},
{
value: 14,
label: "市北区台柳路12号4单元101"
},
{
value: 15,
label: "市北区台柳路12号4单元101"
},
{
value: 16,
label: "市北区台柳路12号4单元101"
},
{
value: 17,
label: "市北区台柳路12号4单元101"
},
{
value: 18,
label: "市北区台柳路12号4单元101"
},
{
value: 19,
label: "市北区台柳路12号4单元101"
},
{
value: 20,
label: "市北区台柳路12号4单元101"
},
]
},
lightStyle: {
style: "amap://styles/whitesmoke",
@ -487,14 +291,16 @@ export default {
},
total: 0,
pageNo: 1,
pageSize: 10,
pageSize: 9,
agencyId: "",
level: "",
selAgency: [],
showResiTable: false,
resiList: [],
showHouseTable: false,
houseList: []
houseList: [],
active: 'all',
dyTotal:0
}
},
mounted() {
@ -546,6 +352,16 @@ export default {
}
},
methods: {
handleClickTabs(val){
this.active = val
if(val == 'all' || val == 'dy'){
this.getScreenUserList()
}else{
this.resiList = []
}
},
selectType(value, label) {
// if (value === this.buttonIndex) {
// this.buttonIndex = 0
@ -566,29 +382,30 @@ export default {
} else if (value == 2) {
this.getScreenHouseStatistics()
} else if (value == 3) {
} else if (value == 3 && this.level == 'community') {
this.getDangzhibuDot()
}
},
initDot(data) {
console.log(data, '点位数据');
scene.addImage("dotBto", require("../../assets/images/map/dotBg.png"));
//textOffset this.buttonIndex == 3 [10,60] [-30 60]
dotBgLayer = new PointLayer({
zIndex: 21,
})
.source(data)
.shape('count', 'text')
.color("#fff")
.size(16)
.size(14)
.style({
strokeWidth: 3,
strokeOpacity: 0.1,
fontWeight: '500',
stroke: "#000",
textOffset: [0, 45],
raisingHeight: 300,
textOffset: this.buttonIndex === 3 ? [10, 60] : [-30, 60],
raisingHeight: 700,
heightfixed: true,
textAnchor: "center"
textAnchor: "center-left",
});
scene.addLayer(dotBgLayer);
@ -597,11 +414,10 @@ export default {
})
.source(data)
.shape("dotBto")
.size(80)
.size(100)
.style({
// offsets: [15, 260],
layerType: "fillImage",
raisingHeight: 300,
raisingHeight: 700,
heightfixed: true
});
scene.addLayer(dotLayer);
@ -625,11 +441,16 @@ export default {
this.selAgencyId = e.feature.properties.subId
if (e.feature.properties.type == 'resi') {
this.getScreenUserList()
this.getDyTotal()
this.showResiTable = true
} else if (e.feature.properties.type == 'house') {
this.getScreenHouseList()
this.showHouseTable = true
} else if (e.feature.properties.type == 'dangzhibu') {
this.getSearchByGridId(e.feature.properties.subId)
this.showFirst = true
}
// const htmlString = `
// <div class="popup-container">
// <div class="popup-title">${e.feature.properties.type == 'resi' ? '' : ''}</div>
@ -667,13 +488,31 @@ export default {
dotBgLayer.on("unmousemove", (e) => { });
},
async getDyTotal() {
let params = {
agencyId: this.selAgencyId || '1175270520603930625',
level: this.level == 'street' ? 'community' : this.level == 'community' ? 'grid' : 'street',
pageSize: this.pageSize,
pageNo: this.pageNo,
dangyuan:'1'
}
console.log(params);
const { data, msg, code } = await getScreenUserList(params)
if (code == 0) {
this.dyTotal = data.total
} else {
console.log(msg);
}
},
async getScreenUserList() {
let params = {
agencyId: this.selAgencyId,
agencyId: this.selAgencyId || '1175270520603930625',
level: this.level == 'street' ? 'community' : this.level == 'community' ? 'grid' : 'street',
pageSize: this.pageSize,
pageNo: this.pageNo
pageNo: this.pageNo,
dangyuan:this.active == 'dy'?'1':''
}
console.log(params);
const { data, msg, code } = await getScreenUserList(params)
if (code == 0) {
this.resiList = data.list
@ -697,6 +536,8 @@ export default {
console.log(msg);
}
},
async getScreenHouseStatistics() {
let params = {
agencyId: this.agencyId || '1175270520603930625',
@ -707,7 +548,6 @@ export default {
let obj = {
type: 'FeatureCollection',
features: data,
name: 'ccc'
}
if (this.level) {
obj.features.forEach(f => {
@ -814,6 +654,30 @@ export default {
console.log(msg);
}
},
getDangzhibuDot() {
console.log(this.selAgency);
let obj = {
type: 'FeatureCollection',
features: this.selAgency,
}
obj.features.forEach(f => {
f.type = 'Feature';
f.properties = {};
f.geometry = {};
f.properties.name = '党支部';
f.properties.type = 'dangzhibu';
f.properties.subId = f.subId;
f.properties.count = `${f.subName}党支部`;
f.geometry.type = "Point";
f.geometry.coordinates = [...JSON.parse(f.subCenterMark)[0]];
delete f.agencyName;
delete f.agencyId;
delete f.count;
});
this.initDot(obj)
},
initialization() {
this.agencyId = '';
this.level = '';
@ -879,22 +743,22 @@ export default {
styleConfig = lightStyle;
}
lineLayerBig = new LineLayer({
zIndex: 6,
name: "line2",
})
.source(shibeiJson1)
.shape("wall")
.size(50)
.color('rgb(163, 255, 245)')
.style({
opacity: 1,
raisingHeight: 600,
sourceColor:'rgb(0, 153, 188,0.5)',
targetColor:'rgb(0, 153, 188)',
linearDir:'algin',
})
// lineLayerBig = new LineLayer({
// zIndex: 6,
// name: "line2",
// })
// .source(shibeiJson1)
// .shape("wall")
// .size(50)
// .color('rgb(163, 255, 245)')
// .style({
// opacity: 1,
// raisingHeight: 600,
// sourceColor: 'rgb(0, 153, 188,0.5)',
// targetColor: 'rgb(0, 153, 188)',
// linearDir: 'algin',
// })
// scene.addLayer(lineLayerBig);
//
polygonLayer = new PolygonLayer({
@ -913,8 +777,8 @@ export default {
opacity: 0.8,
heightfixed: true,
raisingHeight: 300,
sourceColor:'#4ee8fc',
targetColor:'#00284e',
sourceColor: '#4ee8fc',
targetColor: '#00284e',
});
scene.addLayer(polygonLayer);
@ -1077,10 +941,32 @@ export default {
this.showFirst = false
this.showMicrogridDetails = false
},
microgridDetails(item) {
async microgridDetails(item) {
await this.getSearchByGridIdDetail(item.id)
this.showMicrogridDetails = true
this.microgridIndex = item.value
this.microgridObj.firstTitle = item.label
this.microgridIndex = item.id
},
async getSearchByGridId(id) {
let params = {
gridId:id// "1224135071215190018",
}
const { data, msg, code } = await getSearchByGridId(params)
if (code == 0) {
this.microgridArr = data
} else {
console.log(msg);
}
},
async getSearchByGridIdDetail(id) {
let params = {
microGridId: id,
}
const { data, msg, code } = await getSearchByGridIdDetail(params)
if (code == 0) {
this.microgridObj = { ...data }
} else {
console.log(msg);
}
},
handleCurrentChange(val) {
@ -1146,6 +1032,25 @@ export default {
background-repeat: no-repeat;
}
.imageBg {
background-image: url('@/assets/images/map/popupBg.png');
background-size: 100% 100%;
background-repeat: no-repeat;
}
.titleBg {
background: url('@/assets/icon/title-content-half.png');
background-size: 67% 100%;
background-repeat: no-repeat;
}
.label {
font-size: 22px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #BDE8FF;
}
.resiTitle {
background: url('@/assets/icon/title-content-half.png');
background-size: 67% 100%;
@ -1202,11 +1107,74 @@ export default {
.el-pagination.is-background .el-pager li {
background-color: #1e7b9d;
}
::v-deep .l7-popup .l7-popup-content .l7-popup-content__panel{
::v-deep .l7-popup .l7-popup-content .l7-popup-content__panel {
white-space: initial;
}
::v-deep .el-pagination.is-background .btn-prev {
background-color: #1e7b9d;
}
.after {
position: relative;
}
.after::after {
content: "";
height: 2px;
width: 100%;
position: absolute;
top: -14px;
left: 0;
height: 4px;
background: linear-gradient(90deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);
}
.tabs {
margin-bottom: 10px;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
width: 539px;
height: 49px;
&::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px; /*高宽分别对应横竖滚动条的尺寸*/
height: 2px;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
background: linear-gradient(-90deg, #09b8e5 0%, #09f0e3 99%);
border-radius: 3px;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #428ba2;
border-radius: 3px;
}
.item {
display: inline-block;
color: #fff;
width: fit-content;
font-size: 16px;
height: 30px;
padding: 0 10px;
box-sizing: border-box;
line-height: 30px;
text-align: center;
margin-top: 10px;
cursor: pointer;
color: #FFFFFF;
}
.item-active {
background: linear-gradient(to top, #0d82b0, #035f83);
font-weight: 400;
}
}
</style>

7
src/views/screenHeader.vue

@ -65,7 +65,7 @@ img {
display: flex;
}
.main-title {
margin-left: 15vw;
margin-left: 16vw;
position: relative;
.title-img {
@ -112,8 +112,11 @@ img {
}
.subtitle-right1 {
margin-left: 111px;
width: 788px;
}
.subtitle-right2 {
margin-left: 176px;
margin-left: 221px;
margin-right: 182px;
width: 756px;
}
</style>

59
src/views/screenLeft/left1.vue

@ -45,17 +45,19 @@
<div class='b-zdxx'>
<screen-title :titleName="'阵地信息'"></screen-title>
<div class="flex">
<div :class="['item', { 'item-active': active === 1 }]" @click="active = 1">地物</div>
<div :class="['item', { 'item-active': active === 2 }]" @click="active = 2">房子</div>
<div :class="['item', { 'item-active': active === 3 }]" @click="active = 3">居民</div>
<div :class="['item', { 'item-active': active === '1' }]" @click="active = '1'">地物</div>
<div :class="['item', { 'item-active': active === 'house' }]" @click="active = 'house'">房子{{ houseTotal }}
</div>
<div :class="['item', { 'item-active': active === 'resi' }]" @click="active = 'resi'">居民{{ resiTotal }}
</div>
</div>
<div class="pei-Box" v-show="showCharts">
<div class="title"><span @click="showCharts = false">X</span></div>
<div class="title"><span @click="showCharts = false">x</span></div>
<div id="chartsM" style="width: 290px;height: 290px;"></div>
</div>
</div>
<div class="table" v-if="active == 2">
<div class="table" v-if="active == 'house'">
<screen-custom-table :headerColor="'#BDE8FF'" :headerHeight="'36px'" :bodyTdColor="'#FFFFFF'"
:bodyTdFontSize="'18px'" :tableHeight="80" :showTableLine="true" :dataList="dataListResult"
:isChangeColor=false :rowColor="'rgba(11,68,135,0.16)'" :noData="noDataH" :pageSize="pageSize"
@ -119,7 +121,7 @@
<script>
// import { getOrgTree } from "api/index"
import { mapGetters } from 'vuex'
import { getStreetUserStatistics, getStreeHouseStatistics, getStreeHouseTypeStatistics, getStreetUserTypeStatistics,getStructTree } from "../../api/hulianApi"
import { getStreetUserStatistics, getStreeHouseStatistics, getStreeHouseTypeStatistics, getStreetUserTypeStatistics, getStructTree } from "../../api/hulianApi"
import * as echarts from 'echarts';
import screenOrgTree from '../../components/screen-org-tree'
export default {
@ -157,7 +159,9 @@ export default {
charsData: [],
showCharts: false,
charts: null,
treeList: []
treeList: [],
houseTotal: '',
resiTotal: ''
}
},
computed: {
@ -199,7 +203,7 @@ export default {
let params = {
agencyId: this.shibeiAId
}
const { data, code, msg } = await getStructTree( params)
const { data, code, msg } = await getStructTree(params)
if (code === 0) {
this.treeList = data
// if (data.length > 0) {
@ -211,7 +215,7 @@ export default {
}
},
onClickNode(){
onClickNode() {
},
goShowDlzz() {
@ -225,6 +229,7 @@ export default {
const { data, msg, code } = await getStreetUserStatistics(params)
if (code == 0) {
this.dataListResi = data.map(item => [item.streetName, item.count, '查看'])
this.resiTotal = data.reduce((sum, item) => sum + item.count, 0);
if (this.dataListResi.length === 0) {
this.noData = true
}
@ -237,6 +242,7 @@ export default {
const { data, msg, code } = await getStreeHouseStatistics(params)
if (code == 0) {
this.dataListResult = data.map(item => [item.name, item.count, '查看'])
this.houseTotal = data.reduce((sum, item) => sum + item.count, 0);
this.houseList = data
if (this.dataListResult.length === 0) {
this.noDataH = true
@ -262,10 +268,10 @@ export default {
handleLook(item) {
let str = item[0]
let id = this.houseList.filter(item => item.name == str)[0].streeId
if (id && this.active == 2) {
if (id && this.active == 'house') {
this.getStreeHouseTypeStatistics(id)
} else if (id && this.active == 3) { } {
this.getStreetUserTypeStatistics(id)
} else if (id && this.active == 'resi') {
this.getStreetUserTypeStatistics(id)
}
},
async getStreeHouseTypeStatistics(id) {
@ -346,18 +352,28 @@ export default {
fontFamily: "微软雅黑"
}
},
// labellabelLine线
series: [
{
type: "pie",
radius: ["30%", "50%"],
radius: ["20%", "40%"],
center: ["50%", "30%"],//
label: {
show: false,
position: 'center'
show: true,
position: 'outside',
formatter(param) {
return param.name + param.value;
},
fontSize: 12,
fontWeight: 'bold',
color: '#fff'
},
label: {
show: false,
position: 'center'
labelLine: {
show: true,
length: 10, // 线
lineStyle: {
color: '#fff'
}
},
emphasis: {
label: {
@ -366,9 +382,6 @@ export default {
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.charsData
}
]
@ -516,14 +529,13 @@ export default {
.item {
color: #fff;
width: 100px;
width: 140px;
height: 30px;
line-height: 30px;
text-align: center;
background: linear-gradient(to top, #0174a2, #025b7d);
margin-left: 10px;
margin-top: 10px;
font-size: 300;
cursor: pointer;
}
@ -540,6 +552,7 @@ export default {
color: #A3B9DA;
font-size: 16px;
height: 192px;
margin-top: 38px;
.item {
display: flex;

25
src/views/screenRight/right2.vue

@ -43,7 +43,7 @@
</div>
</div>
<div v-else>
<screen-loading style="width: 620px;height: 290px;" >加载中...</screen-loading>
<screen-loading style="width: 620px;height: 290px;">加载中...</screen-loading>
</div>
</div>
<div class="b-dyqz">
@ -136,13 +136,20 @@ export default {
}
},
computed: {
...mapGetters(["shibeiAId"]),
...mapGetters(["shibeiAId","shibeiAgencyType"]),
},
watch: {
shibeiAId: {
handler() {
if (this.shibeiAgencyType == 'street') {
this.headerList[1].title = '社区'
} else if (this.shibeiAgencyType == 'community') {
this.headerList[1].title = '网格'
} else if (this.shibeiAgencyType == 'district') {
this.headerList[1].title = '街道'
}
// if (this.shibeiAId !== "") {
this.getData();
this.getData();
// }
},
immediate: true,
@ -154,7 +161,7 @@ export default {
methods: {
getLineChart() {
const params = {};
params.deptId = this.shibeiAId || '1175270520603930625' ;
params.deptId = this.shibeiAId || '1175270520603930625';
const currentDate = new Date();
params.yearMonth = currentDate.getFullYear()
this.lineChartFlag = false;
@ -213,7 +220,7 @@ export default {
if (res.code == 0) {
this.dataListResult = []
this.dataListResult = res.data.map((item, index) => [index + 1, item.deptName, item.closedRatio, item.responseRatio, item.satisfiedRatio])
console.log(this.dataListResult );
console.log(this.dataListResult);
if (this.dataListResult.length === 0) {
this.noData = true
}
@ -246,11 +253,11 @@ export default {
this.xylTotal = xylTotal.data.find(item => item.name === '按期响应').value;
const xylValue = xylTotal.data.find(item => item.name === '按期响应').total;
this.xylProportion = this.calculateProportion(this.xylTotal,xylValue );
this.xylProportion = this.calculateProportion(this.xylTotal, xylValue);
this.hflTotal = hflTotal.data.find(item => item.name === '按时回复').value;
const hflValue = hflTotal.data.find(item => item.name === '按时回复').total;
this.hflProportion = this.calculateProportion(this.hflTotal,hflValue );
this.hflProportion = this.calculateProportion(this.hflTotal, hflValue);
const hflProportion = parseFloat(this.hflProportion) || 0;
const xylProportion = parseFloat(this.xylProportion) || 0;
@ -284,7 +291,7 @@ export default {
lineInitOk() {
this.lineInitState = true;
},
//
async getPieChart() {
this.$refs.pieChart.clear();
@ -292,7 +299,7 @@ export default {
this.pieOption = pieOption();
this.pieOption.title.text = this.proportion + '%'
this.pieOption.series[1].data[0].value = this.proportion;
this.pieOption.series[1].data[1].value = 100 - this.proportion ;
this.pieOption.series[1].data[1].value = 100 - this.proportion;
this.$refs.pieChart.setOption(this.pieOption);
},
getLine() {

60
src/views/screenRight/right3.vue

@ -195,6 +195,13 @@ export default {
},
shibeiAId: {
handler() {
if(this.shibeiAgencyType == 'street'){
this.headerList[0].title = '社区'
}else if (this.shibeiAgencyType == 'community'){
this.headerList[0].title = '网格'
}else if(this.shibeiAgencyType == 'district'){
this.headerList[0].title = '街道'
}
// if (this.shibeiAId != '') {
this.getItemdailystatis()
this.getCategoryAnalysis()
@ -208,7 +215,7 @@ export default {
}
},
computed: {
...mapGetters(['shibeiAId'])
...mapGetters(['shibeiAId','shibeiAgencyType'])
},
methods: {
@ -357,16 +364,33 @@ export default {
type: "pie",
center: ["50%", "30%"],//
radius: ["20%", "40%"],
// label: {
// show: true,
// },
// labelLine: {
// normal: {
// lineStyle: {
// color: 'rgba(255, 255, 255, 0.3)'
// },
// smooth: 0.2,
// length: "10"
// }
// },
label: {
show: true,
position: 'outside',
formatter(param) {
return param.name + param.value;
},
fontSize: 14,
fontWeight: 'bold',
color: '#fff'
},
labelLine: {
normal: {
lineStyle: {
color: 'rgba(255, 255, 255, 0.3)'
},
smooth: 0.2,
length: "10"
show: true,
length: 10, // 线
lineStyle: {
color: '#fff'
}
},
data: this.charData
@ -437,15 +461,28 @@ export default {
series: [
{
type: "pie",
radius: ["30%", "50%"],
radius: ["20%", "40%"],
center: ["50%", "30%"],//
label: {
show: false,
position: 'center'
},
label: {
show: false,
position: 'center'
show: true,
position: 'outside',
formatter(param) {
return param.name + param.value;
},
fontSize: 10,
// fontWeight: 'bold',
color: '#fff'
},
labelLine: {
show: true,
length: 10, // 线
lineStyle: {
color: '#fff'
}
},
emphasis: {
label: {
@ -454,9 +491,6 @@ export default {
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.charsData
}
]

Loading…
Cancel
Save