|
|
@ -4,9 +4,9 @@ |
|
|
|
<div class="card-title"> |
|
|
|
<img src="@/assets/img/shuju/title-tip.png" /> |
|
|
|
<span>项目分布分析</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="second-title"> |
|
|
|
<div class="second-title-label">不同事件类别在不同时间段的变化和分布</div> |
|
|
|
|
|
|
|
<div class="second-select cascader"> |
|
|
|
|
|
|
|
<el-cascader class="customer_cascader" |
|
|
@ -31,24 +31,27 @@ |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="g-cpt-resi"> |
|
|
|
<div class="g-l"> |
|
|
|
<screen-echarts-frame class="echart-line" |
|
|
|
<screen-echarts-frame v-if="!showNoData" |
|
|
|
class="echart-line" |
|
|
|
@myChartMethod="lineInitOk" |
|
|
|
ref="lineChart"></screen-echarts-frame> |
|
|
|
<div v-else |
|
|
|
class="echart-line"> |
|
|
|
<img src="../../../../assets/img/modules/visual/noData.png" /> |
|
|
|
</div> |
|
|
|
<!-- <div class="table-status" |
|
|
|
v-if="loading"> |
|
|
|
<screen-loading>加载中</screen-loading> |
|
|
|
</div> |
|
|
|
<div class="table-status" |
|
|
|
v-if="lineList.length == 0 && !loading"> |
|
|
|
<div class="no-data"> |
|
|
|
<img src="../../../../assets/img/modules/visual/noData.png" |
|
|
|
class="no-data-img" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> --> |
|
|
|
|
|
|
|
</div> |
|
|
@ -208,6 +211,7 @@ export default { |
|
|
|
await this.getAgencylist()//获取组织级别 |
|
|
|
await nextTick(500) |
|
|
|
await this.loadOrgData() |
|
|
|
|
|
|
|
await this.getApiData(); |
|
|
|
|
|
|
|
}, |
|
|
@ -237,6 +241,15 @@ export default { |
|
|
|
if (month2 < 10) { |
|
|
|
month2 = '0' + month2; |
|
|
|
} |
|
|
|
if (month < 10) { |
|
|
|
month = '0' + month; |
|
|
|
} |
|
|
|
if (day < 10) { |
|
|
|
day = '0' + day; |
|
|
|
} |
|
|
|
if (day2 < 10) { |
|
|
|
day2 = '0' + day2; |
|
|
|
} |
|
|
|
var t2 = year2 + '-' + month2 + '-' + day2; |
|
|
|
var t1 = year + '-' + month + '-' + day; |
|
|
|
// let t3 = formate(t2, style); |
|
|
@ -250,9 +263,19 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
async getApiData () { |
|
|
|
|
|
|
|
await this.getLine() |
|
|
|
await this.getLineChart() |
|
|
|
await this.loadMapData(); |
|
|
|
|
|
|
|
this.assignData() |
|
|
|
}, |
|
|
|
|
|
|
|
assignData () { |
|
|
|
if (!this.showNoData) { |
|
|
|
this.getLine() |
|
|
|
} |
|
|
|
|
|
|
|
this.loadMap() |
|
|
|
this.isfirstInit = false |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取当前登录人员信息及组织信息 |
|
|
@ -351,17 +374,17 @@ export default { |
|
|
|
if (code === 0) { |
|
|
|
|
|
|
|
this.legendArray = [] |
|
|
|
if (data.under) { |
|
|
|
if (data.under === 0 || data.under) { |
|
|
|
this.under = data.under |
|
|
|
this.legendArray.push( |
|
|
|
{ |
|
|
|
color: this.colorArray[0], |
|
|
|
name: data.under + '以下' |
|
|
|
name: data.under + '及以下' |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
if (data.above) { |
|
|
|
if (data.above === 0 || data.above) { |
|
|
|
this.above = data.above |
|
|
|
this.legendArray.push( |
|
|
|
{ |
|
|
@ -372,7 +395,7 @@ export default { |
|
|
|
this.legendArray.push( |
|
|
|
{ |
|
|
|
color: this.colorArray[2], |
|
|
|
name: data.above + '以上' |
|
|
|
name: data.above + '及以上' |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
@ -393,12 +416,12 @@ export default { |
|
|
|
item.latitude = agencyItem.latitude |
|
|
|
item.coordinates = agencyItem.coordinates |
|
|
|
|
|
|
|
if (this.under) { |
|
|
|
if (this.under === 0 || this.under) { |
|
|
|
if (item.count < this.under || item.count === this.under) { |
|
|
|
item.color = this.colorArray[0] |
|
|
|
item.fillColor = this.colorFillArray[0] |
|
|
|
} else { |
|
|
|
if (this.above) { |
|
|
|
if (this.above === 0 || this.above) { |
|
|
|
if (item.count > this.under && item.count < this.above) { |
|
|
|
item.color = this.colorArray[1] |
|
|
|
item.fillColor = this.colorFillArray[1] |
|
|
@ -409,7 +432,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
break |
|
|
|
} |
|
|
@ -419,8 +441,7 @@ export default { |
|
|
|
}); |
|
|
|
|
|
|
|
console.log(this.mapList) |
|
|
|
this.loadMap() |
|
|
|
this.isfirstInit = false |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
@ -445,7 +466,7 @@ export default { |
|
|
|
}, |
|
|
|
getLine () { |
|
|
|
if (this.lineInitState) { |
|
|
|
this.getLineChart() |
|
|
|
this.assignLineChart() |
|
|
|
} else { |
|
|
|
setTimeout(() => { |
|
|
|
this.getLine() |
|
|
@ -454,9 +475,13 @@ export default { |
|
|
|
}, |
|
|
|
// 获取折线图 |
|
|
|
async getLineChart () { |
|
|
|
if (!this.showNoData) { |
|
|
|
this.$refs.lineChart.clear() |
|
|
|
const _that = this |
|
|
|
this.$refs.lineChart.showLoading() |
|
|
|
} |
|
|
|
|
|
|
|
const _that = this |
|
|
|
|
|
|
|
const url = "/gov/project/project/projectdistributionanalysisleft"; |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft"; |
|
|
|
let params = { |
|
|
@ -466,16 +491,30 @@ export default { |
|
|
|
}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
if (!this.showNoData) { |
|
|
|
this.$refs.lineChart.hideLoading() |
|
|
|
} |
|
|
|
if (code === 0) { |
|
|
|
// 获取pieChart配置 |
|
|
|
this.lineOption = lineOption() |
|
|
|
|
|
|
|
if (data && data.length > 0) { |
|
|
|
this.lineList = data |
|
|
|
this.showNoData = false |
|
|
|
} else { |
|
|
|
this.lineList = [] |
|
|
|
this.showNoData = true |
|
|
|
} |
|
|
|
|
|
|
|
this.loadCategoryData() |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
assignLineChart () { |
|
|
|
// 获取pieChart配置 |
|
|
|
this.lineOption = lineOption() |
|
|
|
|
|
|
|
this.$refs.lineChart.setOption(this.lineOption, true) |
|
|
|
this.$refs.lineChart.setOption({ |
|
|
@ -483,16 +522,6 @@ export default { |
|
|
|
legend: { data: this.legend }, |
|
|
|
series: this.series |
|
|
|
}, true) |
|
|
|
} else { |
|
|
|
this.lineList = [] |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//解析折线图数据 |
|
|
@ -501,6 +530,9 @@ export default { |
|
|
|
this.xaxis = [] |
|
|
|
this.series = [] |
|
|
|
this.legend = [] |
|
|
|
if (this.lineList.length > 0) { |
|
|
|
|
|
|
|
|
|
|
|
let num = this.lineList[0].categoryList.length |
|
|
|
|
|
|
|
let dataArray = new Array(num) |
|
|
@ -548,7 +580,7 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeAgency (value) { |
|
|
|