|
@ -41,10 +41,23 @@ |
|
|
ref="lineChart"></screen-echarts-frame> |
|
|
ref="lineChart"></screen-echarts-frame> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="g-r">111 |
|
|
<div class="g-r"> |
|
|
<!-- <screen-echarts-frame class="echart-wr" |
|
|
<div class="r-map"> |
|
|
@myChartMethod="lineInitOk" |
|
|
<screen-map class="map" |
|
|
ref="lineChart"></screen-echarts-frame> --> |
|
|
ref="map" |
|
|
|
|
|
:showPolygonLayer="true"></screen-map> |
|
|
|
|
|
|
|
|
|
|
|
<div class="r-legend"> |
|
|
|
|
|
<div class="legend_item" |
|
|
|
|
|
v-for="(item,index) in legendArray" |
|
|
|
|
|
:key="index"> |
|
|
|
|
|
<div :class="['color','color'+index]"></div> |
|
|
|
|
|
<span>{{item.name}}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -57,7 +70,7 @@ import { requestPost } from "@/js/dai/request"; |
|
|
import cptCard from "@/views/modules/visual/cpts/card"; |
|
|
import cptCard from "@/views/modules/visual/cpts/card"; |
|
|
import cptTb from "@/views/modules/visual/cpts/tb"; |
|
|
import cptTb from "@/views/modules/visual/cpts/tb"; |
|
|
import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; |
|
|
import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; |
|
|
|
|
|
import screenMap from "@/views/modules/visual/components/screen-map"; |
|
|
import { lineOption } from './distributionLineOption.js' |
|
|
import { lineOption } from './distributionLineOption.js' |
|
|
import * as echarts from 'echarts' |
|
|
import * as echarts from 'echarts' |
|
|
|
|
|
|
|
@ -144,11 +157,31 @@ export default { |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timeRange: [], |
|
|
timeRange: [], |
|
|
orgId: '', |
|
|
orgId: '', |
|
|
|
|
|
|
|
|
|
|
|
isfirstInit: true, |
|
|
|
|
|
mapList: [ |
|
|
|
|
|
{ |
|
|
|
|
|
orgId: '3115fc83f1db431008a73c553eef1eb5', |
|
|
|
|
|
count: 169 |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
orgId: '7e57419e6afcdc910d08124c0a1b4eb9', |
|
|
|
|
|
count: 149 |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
orgId: 'e56ac695b01d9eed8723bde718071df5', |
|
|
|
|
|
count: 219 |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
agencyInfo: {}, |
|
|
|
|
|
subAgencyArray: [], |
|
|
|
|
|
colorArray: ['#DD2719', '#EDBE00', '#00E5ED'], |
|
|
|
|
|
colorFillArray: ['rgba(221, 39, 25, 0.24)', 'rgba(237, 190, 0, 0.25)', 'rgba(0, 229, 237, 0.16)'], |
|
|
|
|
|
legendArray: [], |
|
|
|
|
|
under: null, |
|
|
|
|
|
above: null |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
@ -161,6 +194,7 @@ export default { |
|
|
this.userId = this.uid; |
|
|
this.userId = this.uid; |
|
|
this.initData() |
|
|
this.initData() |
|
|
await this.getAgencylist()//获取组织级别 |
|
|
await this.getAgencylist()//获取组织级别 |
|
|
|
|
|
await this.loadOrgData() |
|
|
this.getApiData(); |
|
|
this.getApiData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -204,7 +238,7 @@ export default { |
|
|
async getApiData () { |
|
|
async getApiData () { |
|
|
|
|
|
|
|
|
await this.getLine() |
|
|
await this.getLine() |
|
|
// await this.getTable(); |
|
|
await this.loadMapData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getAgencylist () { |
|
|
async getAgencylist () { |
|
@ -236,9 +270,148 @@ export default { |
|
|
this.getApiData() |
|
|
this.getApiData() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//加载组织数据 |
|
|
|
|
|
async loadOrgData () { |
|
|
|
|
|
const url = "/gov/org/agency/maporg" |
|
|
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/maporg" |
|
|
|
|
|
let params = { |
|
|
|
|
|
orgId: this.orgId, |
|
|
|
|
|
level: 'agency' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
|
|
|
|
|
|
|
|
this.agencyInfo = data |
|
|
|
|
|
if (!data.latitude) { |
|
|
|
|
|
this.agencyInfo.latitude = 36.072227 |
|
|
|
|
|
} |
|
|
|
|
|
if (!data.longitude) { |
|
|
|
|
|
this.agencyInfo.longitude = 120.389455 |
|
|
|
|
|
} |
|
|
|
|
|
if (!data.level) { |
|
|
|
|
|
this.agencyInfo.level = 'street' |
|
|
|
|
|
} |
|
|
|
|
|
this.subAgencyArray = [] |
|
|
|
|
|
if (data.children && data.children.length > 0) { |
|
|
|
|
|
this.subAgencyArray = data.children |
|
|
|
|
|
} else { |
|
|
|
|
|
this.subAgencyArray = [] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(msg) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async loadMapData () { |
|
|
|
|
|
this.$refs.lineChart.clear() |
|
|
|
|
|
|
|
|
|
|
|
const _that = this |
|
|
|
|
|
// this.$refs.lineChart.showLoading() |
|
|
|
|
|
// const url ="/gov/project/project/projectdistributionanalysisright"; |
|
|
|
|
|
const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisright"; |
|
|
|
|
|
let params = { |
|
|
|
|
|
orgId: this.orgId, |
|
|
|
|
|
startDate: this.timeRange.length > 0 && this.timeRange[0] || '', |
|
|
|
|
|
endDate: this.timeRange.length > 0 && this.timeRange[1] || '' |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
|
|
this.legendArray = [] |
|
|
|
|
|
if (data.above) { |
|
|
|
|
|
this.under = data.under |
|
|
|
|
|
this.legendArray.push( |
|
|
|
|
|
{ |
|
|
|
|
|
color: this.colorArray[0], |
|
|
|
|
|
name: data.under + '以下' |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (data.above) { |
|
|
|
|
|
this.above = data.above |
|
|
|
|
|
this.legendArray.push( |
|
|
|
|
|
{ |
|
|
|
|
|
color: this.colorArray[1], |
|
|
|
|
|
name: data.under + '-' + data.above |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
this.legendArray.push( |
|
|
|
|
|
{ |
|
|
|
|
|
color: this.colorArray[2], |
|
|
|
|
|
name: data.above + '以上' |
|
|
|
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
if (data.list && data.list.length > 0) { |
|
|
|
|
|
// this.mapList = data.list |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.mapList = [] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.mapList.forEach(item => { |
|
|
|
|
|
// debugger |
|
|
|
|
|
for (let i = 0; i < this.subAgencyArray.length; i++) { |
|
|
|
|
|
let agencyItem = this.subAgencyArray[i] |
|
|
|
|
|
if (item.orgId === agencyItem.id) { |
|
|
|
|
|
item.longitude = agencyItem.longitude |
|
|
|
|
|
item.latitude = agencyItem.latitude |
|
|
|
|
|
item.coordinates = agencyItem.coordinates |
|
|
|
|
|
|
|
|
|
|
|
if (this.under) { |
|
|
|
|
|
if (item.count < this.under || item.count === this.under) { |
|
|
|
|
|
item.color = this.colorArray[0] |
|
|
|
|
|
item.fillColor = this.colorFillArray[0] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.above) { |
|
|
|
|
|
if (item.count > this.under && item.count < this.above) { |
|
|
|
|
|
item.color = this.colorArray[1] |
|
|
|
|
|
item.fillColor = this.colorFillArray[1] |
|
|
|
|
|
} else { |
|
|
|
|
|
item.color = this.colorArray[2] |
|
|
|
|
|
item.fillColor = this.colorFillArray[2] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
break |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.mapList) |
|
|
|
|
|
this.loadMap() |
|
|
|
|
|
this.isfirstInit = false |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(msg); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
loadMap () { |
|
|
|
|
|
|
|
|
|
|
|
if (this.isfirstInit) { |
|
|
|
|
|
//mapInfo, polygonArray, polIconUrlArray, iconArrays, iconUrlArray |
|
|
|
|
|
this.$refs.map.loadMap(this.agencyInfo, this.mapList, null, null, null, null,) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$refs.map.refreshMap(this.mapList, null) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lineInitOk (dom) { |
|
|
lineInitOk (dom) { |
|
|
console.log('line准备好了', dom) |
|
|
|
|
|
|
|
|
|
|
|
this.lineInitState = true |
|
|
this.lineInitState = true |
|
|
|
|
|
|
|
@ -291,10 +464,9 @@ export default { |
|
|
this.$message.error(msg); |
|
|
this.$message.error(msg); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//解析 |
|
|
//解析折线图数据 |
|
|
loadCategoryData () { |
|
|
loadCategoryData () { |
|
|
|
|
|
|
|
|
this.xaxis = [] |
|
|
this.xaxis = [] |
|
@ -345,15 +517,14 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
console.log(this.series) |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleChangeAgency (value) { |
|
|
handleChangeAgency (value) { |
|
|
|
|
|
|
|
|
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label |
|
|
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label |
|
|
this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' |
|
|
this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' |
|
|
this.getApiData() |
|
|
this.getApiData() |
|
|
console.log(this.agencyIdArray) |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -369,12 +540,15 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
computed: {}, |
|
|
computed: { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
components: { |
|
|
components: { |
|
|
cptCard, |
|
|
cptCard, |
|
|
cptTb, |
|
|
cptTb, |
|
|
screenEchartsFrame, |
|
|
screenEchartsFrame, |
|
|
|
|
|
screenMap |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
watch: { |
|
|
watch: { |
|
|