大屏
This commit is contained in:
@@ -7,15 +7,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="DoughnutChart-explain">
|
||||
<div class="item">
|
||||
<div class="item" v-for="(item, index) in value" :key="index">
|
||||
<i></i>
|
||||
<span>已激活成员</span>
|
||||
<p>2142</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<i></i>
|
||||
<span>未激活成员</span>
|
||||
<p>2142</p>
|
||||
<span>{{ item.key }}</span>
|
||||
<p>{{ item.value }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,7 +18,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['ratio'],
|
||||
props: ['ratio', 'value'],
|
||||
|
||||
data () {
|
||||
return {
|
||||
@@ -34,6 +29,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
ratio () {
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
@@ -175,7 +176,7 @@
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
span {
|
||||
font-size: 18px;
|
||||
font-size: 17px;
|
||||
font-weight: bold;
|
||||
color: #02FEFF;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="AiDvMap" v-resize="onDomResize">
|
||||
<div class="AiDvMap">
|
||||
<div class="chart-map" :class="v" style="width: 100%; height: 100%"></div>
|
||||
<transition name="fade">
|
||||
<div class="info" v-if="isShowInfo">
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="info-wrapper">
|
||||
<div class="info-wrapper__item">
|
||||
<label>下属单位:</label>
|
||||
<span>{{ info['派出所数量'] }}</span>
|
||||
<span>{{ info['派出所数量'] }}个派出所</span>
|
||||
</div>
|
||||
<div class="info-wrapper__item">
|
||||
<label>居民群:</label>
|
||||
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
<div class="info-wrapper__item">
|
||||
<label>好友人数:</label>
|
||||
<span>{{ info['派出所数量'] }}</span>
|
||||
<span>{{ info['外部联系人数量'] }}</span>
|
||||
</div>
|
||||
<div class="info-wrapper__item">
|
||||
<label>群主人数:</label>
|
||||
@@ -46,256 +46,237 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
import * as echarts from 'echarts'
|
||||
|
||||
export default {
|
||||
name: 'AiDvMap',
|
||||
export default {
|
||||
name: 'AiDvMap',
|
||||
|
||||
props: {
|
||||
instance: Function
|
||||
},
|
||||
props: {
|
||||
instance: Function
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
timer: null,
|
||||
title: '',
|
||||
v: `AiDvMap-${new Date().getTime()}`,
|
||||
chart: null,
|
||||
isShowInfo: false,
|
||||
geoJSON: require('./geoJSon/qxnGeoJSON.json')
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
rate () {
|
||||
if (!this.info['已激活']) {
|
||||
return '0%'
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
timer: null,
|
||||
title: '',
|
||||
v: `AiDvMap-${new Date().getTime()}`,
|
||||
chart: null,
|
||||
isShowInfo: false,
|
||||
geoJSON: require('./geoJSon/qxnGeoJSON.json')
|
||||
}
|
||||
},
|
||||
|
||||
return (this.info['已激活'] / this.info['成员总数']).toFixed(2) * 100 + '%'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
rate () {
|
||||
if (!this.info['已激活']) {
|
||||
return '0%'
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
return (this.info['已激活'] / this.info['成员总数']).toFixed(2) * 100 + '%'
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.querySelector(`.${this.v}`))
|
||||
echarts.registerMap('黔西南', this.geoJSON)
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
|
||||
let option = {
|
||||
geo: [
|
||||
{
|
||||
map: "黔西南",
|
||||
aspectScale: 1,
|
||||
zoom: 0.65,
|
||||
layoutCenter: ["50%", "50%"],
|
||||
layoutSize: "180%",
|
||||
show: true,
|
||||
roam: false,
|
||||
emphasis: {
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.querySelector(`.${this.v}`))
|
||||
echarts.registerMap('黔西南', this.geoJSON)
|
||||
|
||||
let option = {
|
||||
geo: [
|
||||
{
|
||||
map: "黔西南",
|
||||
aspectScale: 1,
|
||||
zoom: 0.65,
|
||||
layoutCenter: ["50%", "50%"],
|
||||
layoutSize: "180%",
|
||||
show: true,
|
||||
label: {
|
||||
textStyle: {
|
||||
color: "#FFFFFF"
|
||||
roam: false,
|
||||
emphasis: {
|
||||
show: true,
|
||||
label: {
|
||||
textStyle: {
|
||||
color: "#FFFFFF"
|
||||
},
|
||||
},
|
||||
itemStyle: {
|
||||
// areaColor: '#fff'
|
||||
}
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
color: '#fff',
|
||||
fontSize: '14'
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
// areaColor: '#fff'
|
||||
normal: {
|
||||
borderColor: "rgba(2, 254, 255, 0.7)",
|
||||
borderWidth: 2,
|
||||
shadowColor: "rgba(2, 254, 255, 0.1)",
|
||||
shadowOffsetY: 10,
|
||||
shadowBlur: 120,
|
||||
areaColor: "#0f7295",
|
||||
},
|
||||
}
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
color: '#fff',
|
||||
fontSize: '14'
|
||||
}
|
||||
// 重影
|
||||
{
|
||||
type: "map",
|
||||
map: "黔西南",
|
||||
zlevel: -1,
|
||||
aspectScale: 1,
|
||||
zoom: 0.65,
|
||||
layoutCenter: ["50%", "51%"],
|
||||
layoutSize: "180%",
|
||||
roam: false,
|
||||
silent: true,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderWidth: 1,
|
||||
// borderColor:"rgba(17, 149, 216,0.6)",
|
||||
borderColor: "rgba(2, 254, 255, 0.3)",
|
||||
shadowColor: "rgba(2, 254, 255, 0.3)",
|
||||
shadowOffsetY: 5,
|
||||
shadowBlur: 15,
|
||||
areaColor: "rgba(5,21,35,0.1)",
|
||||
},
|
||||
},
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderColor: "rgba(2, 254, 255, 0.7)",
|
||||
borderWidth: 2,
|
||||
shadowColor: "rgba(2, 254, 255, 0.1)",
|
||||
shadowOffsetY: 10,
|
||||
shadowBlur: 120,
|
||||
areaColor: "#0f7295",
|
||||
{
|
||||
type: "map",
|
||||
map: "黔西南",
|
||||
zlevel: -2,
|
||||
aspectScale: 1,
|
||||
zoom: 0.65,
|
||||
layoutCenter: ["50%", "52%"],
|
||||
layoutSize: "180%",
|
||||
roam: false,
|
||||
silent: true,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderWidth: 1,
|
||||
// borderColor: "rgba(57, 132, 188,0.4)",
|
||||
borderColor: "rgba(2, 254, 255, 0.2)",
|
||||
shadowColor: "rgba(2, 254, 255, 0.24)",
|
||||
shadowOffsetY: 5,
|
||||
shadowBlur: 15,
|
||||
areaColor: "transpercent",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "map",
|
||||
map: "黔西南",
|
||||
zlevel: -3,
|
||||
aspectScale: 1,
|
||||
zoom: 0.65,
|
||||
layoutCenter: ["50%", "53%"],
|
||||
layoutSize: "180%",
|
||||
roam: false,
|
||||
silent: true,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderWidth: 1,
|
||||
// borderColor: "rgba(11, 43, 97,0.8)",
|
||||
borderColor: "rgba(2, 254, 255, 0.1)",
|
||||
shadowColor: "rgba(2, 254, 255, 0.1)",
|
||||
shadowOffsetY: 15,
|
||||
shadowBlur: 10,
|
||||
areaColor: "transpercent",
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
// 重影
|
||||
{
|
||||
type: "map",
|
||||
map: "黔西南",
|
||||
zlevel: -1,
|
||||
aspectScale: 1,
|
||||
zoom: 0.65,
|
||||
layoutCenter: ["50%", "51%"],
|
||||
layoutSize: "180%",
|
||||
roam: false,
|
||||
silent: true,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderWidth: 1,
|
||||
// borderColor:"rgba(17, 149, 216,0.6)",
|
||||
borderColor: "rgba(2, 254, 255, 0.3)",
|
||||
shadowColor: "rgba(2, 254, 255, 0.3)",
|
||||
shadowOffsetY: 5,
|
||||
shadowBlur: 15,
|
||||
areaColor: "rgba(5,21,35,0.1)",
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: 'scatter',
|
||||
map: "黔西南",
|
||||
coordinateSystem: 'geo',
|
||||
z: 3,
|
||||
zlevel: 3,
|
||||
// symbol: 'none',
|
||||
symbolSize: 16,
|
||||
rippleEffect: {
|
||||
period: 2,
|
||||
scale: 4,
|
||||
brushType: 'fill'
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "map",
|
||||
map: "黔西南",
|
||||
zlevel: -2,
|
||||
aspectScale: 1,
|
||||
zoom: 0.65,
|
||||
layoutCenter: ["50%", "52%"],
|
||||
layoutSize: "180%",
|
||||
roam: false,
|
||||
silent: true,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderWidth: 1,
|
||||
// borderColor: "rgba(57, 132, 188,0.4)",
|
||||
borderColor: "rgba(2, 254, 255, 0.2)",
|
||||
shadowColor: "rgba(2, 254, 255, 0.24)",
|
||||
shadowOffsetY: 5,
|
||||
shadowBlur: 15,
|
||||
areaColor: "transpercent",
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "map",
|
||||
map: "黔西南",
|
||||
zlevel: -3,
|
||||
aspectScale: 1,
|
||||
zoom: 0.65,
|
||||
layoutCenter: ["50%", "53%"],
|
||||
layoutSize: "180%",
|
||||
roam: false,
|
||||
silent: true,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderWidth: 1,
|
||||
// borderColor: "rgba(11, 43, 97,0.8)",
|
||||
borderColor: "rgba(2, 254, 255, 0.1)",
|
||||
shadowColor: "rgba(2, 254, 255, 0.1)",
|
||||
shadowOffsetY: 15,
|
||||
shadowBlur: 10,
|
||||
areaColor: "transpercent",
|
||||
roam: false,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
areaColor: '#000',
|
||||
borderColor: '#a18a3a',
|
||||
borderWidth: 1
|
||||
},
|
||||
emphasis: {
|
||||
show: false,
|
||||
areaColor: null
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
type: 'scatter',
|
||||
map: "黔西南",
|
||||
coordinateSystem: 'geo',
|
||||
z: 3,
|
||||
zlevel: 3,
|
||||
// symbol: 'none',
|
||||
symbolSize: 16,
|
||||
rippleEffect: {
|
||||
period: 2,
|
||||
scale: 4,
|
||||
brushType: 'fill'
|
||||
},
|
||||
label: {
|
||||
show: false
|
||||
},
|
||||
roam: false,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
areaColor: '#000',
|
||||
borderColor: '#a18a3a',
|
||||
borderWidth: 1
|
||||
},
|
||||
emphasis: {
|
||||
show: false,
|
||||
areaColor: null
|
||||
}
|
||||
},
|
||||
// label: {
|
||||
// show: true,
|
||||
// formatter: e => {
|
||||
// const name = e.data[3]
|
||||
// const value = e.data[2]
|
||||
// return `{a|${name}}\n{b|${value}}`
|
||||
// },
|
||||
// fontSize: 16,
|
||||
// rich: {
|
||||
// a: {
|
||||
// width: '100%',
|
||||
// color: '#fff',
|
||||
// lineHeight: 20,
|
||||
// fontSize: 16
|
||||
// },
|
||||
// b: {
|
||||
// backgroundColor: {
|
||||
// // image: require('@/assets/images/point.png')
|
||||
// },
|
||||
// color: '#fff',
|
||||
// height: 56,
|
||||
// align: 'center',
|
||||
// width: 50,
|
||||
// fontSize: 16
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
data: []
|
||||
}
|
||||
]
|
||||
}
|
||||
this.chart.setOption(option)
|
||||
this.chart.on('click', e => {
|
||||
this.getInfo(e.name)
|
||||
})
|
||||
},
|
||||
|
||||
getInfo (name) {
|
||||
this.title = `${name}公安局`
|
||||
this.instance.post(`/wxgridinfo/comprehensiveOverviewMap`, null, {
|
||||
params: {
|
||||
gridName: `${name}公安局`,
|
||||
corpId: 'wpytYEDgAA5zwi8Ak2mwFh3PwBKwwlWA'
|
||||
// label: {
|
||||
// show: true,
|
||||
// formatter: e => {
|
||||
// const name = e.data[3]
|
||||
// const value = e.data[2]
|
||||
// return `{a|${name}}\n{b|${value}}`
|
||||
// },
|
||||
// fontSize: 16,
|
||||
// rich: {
|
||||
// a: {
|
||||
// width: '100%',
|
||||
// color: '#fff',
|
||||
// lineHeight: 20,
|
||||
// fontSize: 16
|
||||
// },
|
||||
// b: {
|
||||
// backgroundColor: {
|
||||
// // image: require('@/assets/images/point.png')
|
||||
// },
|
||||
// color: '#fff',
|
||||
// height: 56,
|
||||
// align: 'center',
|
||||
// width: 50,
|
||||
// fontSize: 16
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
data: []
|
||||
}
|
||||
]
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
this.isShowInfo = true
|
||||
}
|
||||
})
|
||||
},
|
||||
this.chart.setOption(option)
|
||||
this.chart.on('click', e => {
|
||||
this.getInfo(e.name)
|
||||
})
|
||||
},
|
||||
|
||||
convertData(data) {
|
||||
return data.map(v => {
|
||||
return [this.qqMapTransBMap(v.point[1], v.point[0]).lng, this.qqMapTransBMap(v.point[1], v.point[0]).lat, v.value, v.name]
|
||||
})
|
||||
},
|
||||
|
||||
qqMapTransBMap(lng, lat) {
|
||||
const x_pi = 3.14159265358979324 * 3000.0 / 180.0
|
||||
var x = lng
|
||||
var y = lat
|
||||
var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi)
|
||||
var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi)
|
||||
|
||||
return {
|
||||
lng: z * Math.cos(theta) + 0.0065,
|
||||
lat: z * Math.sin(theta) + 0.006
|
||||
getInfo (name) {
|
||||
this.title = `${name}公安局`
|
||||
this.instance.post(`/wxgridinfo/comprehensiveOverviewMap`, null, {
|
||||
params: {
|
||||
gridName: `${name}公安局`,
|
||||
corpId: 'wpytYEDgAA5zwi8Ak2mwFh3PwBKwwlWA'
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
this.isShowInfo = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -345,7 +326,9 @@ export default {
|
||||
|
||||
.info-wrapper__item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 50%;
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
|
||||
label {
|
||||
|
||||
Reference in New Issue
Block a user