|
|
@ -1,9 +1,12 @@ |
|
|
|
<template> |
|
|
|
<cpt-card> |
|
|
|
<div class="title"> |
|
|
|
<div class="card-title"> |
|
|
|
<img src="@/assets/img/shuju/title-tip.png" /> |
|
|
|
<span>事件分类分析</span> |
|
|
|
|
|
|
|
<span>项目分布分析</span> |
|
|
|
</div> |
|
|
|
<div class="second-title"> |
|
|
|
<div class="second-title-label">不同事件类别在不同时间段的变化和分布</div> |
|
|
|
<div class="second-select cascader"> |
|
|
|
|
|
|
|
<el-cascader class="customer_cascader" |
|
|
@ -15,45 +18,43 @@ |
|
|
|
@change="handleChangeAgency" |
|
|
|
clearable></el-cascader> |
|
|
|
</div> |
|
|
|
<div class="second-select "> |
|
|
|
|
|
|
|
<el-date-picker v-model="dateId" |
|
|
|
type="date" |
|
|
|
:clearable="false" |
|
|
|
@change="handleChangeDate" |
|
|
|
<div class="second-select"> |
|
|
|
<el-date-picker v-model="timeRange" |
|
|
|
type="daterange" |
|
|
|
range-separator="至" |
|
|
|
start-placeholder="开始日期" |
|
|
|
end-placeholder="结束日期" |
|
|
|
prefix-icon="el-icon-caret-bottom" |
|
|
|
placeholder="选择日期" |
|
|
|
value-format="yyyyMMdd"> |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
@change="handleSelectChange"> |
|
|
|
</el-date-picker> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="g-cpt-resi"> |
|
|
|
<div class="g-l"> |
|
|
|
<screen-echarts-frame class="echart-wr" |
|
|
|
@myChartMethod="pieInitOk" |
|
|
|
ref="pieChart"></screen-echarts-frame> |
|
|
|
<screen-echarts-frame class="echart-line" |
|
|
|
@myChartMethod="lineInitOk" |
|
|
|
ref="lineChart"></screen-echarts-frame> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="g-r"> |
|
|
|
<div class="m-tb"> |
|
|
|
|
|
|
|
<div class="tb"> |
|
|
|
<cpt-tb :col-list="demand.colList" |
|
|
|
:loading="demand.loading" |
|
|
|
:header="demand.header" |
|
|
|
:list="demand.list"></cpt-tb> |
|
|
|
|
|
|
|
<div class="m-pagination"> |
|
|
|
<el-pagination :current-page="demand.pageNo" |
|
|
|
:page-size="demand.pageSize" |
|
|
|
:total="demand.total" |
|
|
|
background |
|
|
|
layout="prev, pager, next" |
|
|
|
@current-change="handlePageNoChange_demand"> |
|
|
|
</el-pagination> |
|
|
|
<div class="r-map"> |
|
|
|
<screen-map class="map" |
|
|
|
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> |
|
|
@ -69,8 +70,9 @@ import { requestPost } from "@/js/dai/request"; |
|
|
|
import cptCard from "@/views/modules/visual/cpts/card"; |
|
|
|
import cptTb from "@/views/modules/visual/cpts/tb"; |
|
|
|
import screenEchartsFrame from "@/views/modules/visual/components/screen-echarts-frame"; |
|
|
|
|
|
|
|
import { pieOption } from './typePieOption.js' |
|
|
|
import screenMap from "@/views/modules/visual/components/screen-map"; |
|
|
|
import { lineOption } from './distributionLineOption.js' |
|
|
|
import * as echarts from 'echarts' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
@ -79,90 +81,107 @@ export default { |
|
|
|
return { |
|
|
|
showNoData: false, |
|
|
|
timer: null, |
|
|
|
pieChartS: null, |
|
|
|
pieChart: '', |
|
|
|
pieOption: {}, |
|
|
|
pieInitState: false, |
|
|
|
pieTotal: 0, |
|
|
|
colorArray: [], |
|
|
|
pieData: [ |
|
|
|
{ total: 1048, categoryName: '城市管理', color: '#1B51FF', selected: true }, |
|
|
|
{ total: 735, categoryName: '为民服务', color: '#00E5ED' }, |
|
|
|
{ total: 580, categoryName: '安全监管', color: '#7800FF' }, |
|
|
|
{ total: 484, categoryName: '民政', color: '#16D783' }, |
|
|
|
{ total: 300, categoryName: '环境保护', color: '#FF7800' }, |
|
|
|
{ total: 1049, categoryName: '建设管理', color: '#FFBA00' }, |
|
|
|
{ total: 735, categoryName: '街道吹哨部门报到', color: '#FFD685' }, |
|
|
|
{ total: 580, categoryName: '社会治安综合', color: '#2A00FF' }, |
|
|
|
{ total: 484, categoryName: '公安交通管理', color: '#C600FF' }, |
|
|
|
{ total: 300, categoryName: '卫生计生监管执法', color: '#FF2A00' }, |
|
|
|
{ total: 484, categoryName: '民生', color: '#3DDA83' }, |
|
|
|
{ total: 300, categoryName: '街道安全', color: '#FAC126' } |
|
|
|
], |
|
|
|
|
|
|
|
agencyId: '', |
|
|
|
dateId: '', |
|
|
|
categoryCode: '', |
|
|
|
demand: { |
|
|
|
loading: true, |
|
|
|
colList: [ |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "5%", |
|
|
|
casOptions: [], |
|
|
|
agencyIdArray: [], |
|
|
|
customerList: [], |
|
|
|
iscascaderShow: 0, |
|
|
|
|
|
|
|
optionProps: { |
|
|
|
multiple: false, |
|
|
|
value: 'agencyId', |
|
|
|
label: 'agencyName', |
|
|
|
children: 'subAgencyList', |
|
|
|
checkStrictly: true |
|
|
|
}, |
|
|
|
|
|
|
|
lineChart: '', |
|
|
|
lineOption: {}, |
|
|
|
lineInitState: false, |
|
|
|
lineColorArray: [], |
|
|
|
xaxis: [], |
|
|
|
series: [], |
|
|
|
legend: [], |
|
|
|
lineData: [820, 932, 901, 934, 1290, 1330, 1320], |
|
|
|
lineList: [ |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "10%", |
|
|
|
}, |
|
|
|
time: '4:00', |
|
|
|
categoryList: [ |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "10%", |
|
|
|
categoryCode: '001', |
|
|
|
count: 100, |
|
|
|
color: '#1B51FF', |
|
|
|
name: '分类1' |
|
|
|
}, |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "10%", |
|
|
|
categoryCode: '002', |
|
|
|
count: 200, |
|
|
|
color: '#00E5ED', |
|
|
|
name: '分类2' |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "10%", |
|
|
|
}, |
|
|
|
time: '5:00', |
|
|
|
categoryList: [ |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "5%", |
|
|
|
categoryCode: '001', |
|
|
|
count: 20, |
|
|
|
color: '#1B51FF', |
|
|
|
name: '分类1' |
|
|
|
}, |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "20%", |
|
|
|
categoryCode: '002', |
|
|
|
count: 400, |
|
|
|
color: '#00E5ED', |
|
|
|
name: '分类2' |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "10%", |
|
|
|
}, |
|
|
|
time: '6:00', |
|
|
|
categoryList: [ |
|
|
|
{ |
|
|
|
align: "center", |
|
|
|
width: "10%", |
|
|
|
categoryCode: '001', |
|
|
|
count: 50, |
|
|
|
color: '#1B51FF', |
|
|
|
name: '分类1' |
|
|
|
}, |
|
|
|
{ |
|
|
|
categoryCode: '002', |
|
|
|
count: 10, |
|
|
|
color: '#00E5ED', |
|
|
|
name: '分类2' |
|
|
|
} |
|
|
|
] |
|
|
|
} |
|
|
|
], |
|
|
|
header: ["序号", "项目编号", "类别", "反映渠道", "所属网格", "状态", "项目标题", "转成项目时间", "操作"], |
|
|
|
list: [], |
|
|
|
pageSize: 10, |
|
|
|
pageNo: 1, |
|
|
|
total: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
timeRange: [], |
|
|
|
orgId: '', |
|
|
|
|
|
|
|
casOptions: [], |
|
|
|
agencyIdArray: [], |
|
|
|
customerList: [], |
|
|
|
iscascaderShow: 0, |
|
|
|
|
|
|
|
optionProps: { |
|
|
|
multiple: false, |
|
|
|
value: 'agencyId', |
|
|
|
label: 'agencyName', |
|
|
|
children: 'subAgencyList', |
|
|
|
checkStrictly: true |
|
|
|
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 |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
@ -175,19 +194,51 @@ export default { |
|
|
|
this.userId = this.uid; |
|
|
|
this.initData() |
|
|
|
await this.getAgencylist()//获取组织级别 |
|
|
|
await this.loadOrgData() |
|
|
|
this.getApiData(); |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
initData () { |
|
|
|
var time = (new Date).getTime() - 24 * 60 * 60 * 1000; |
|
|
|
this.dateId = new Date(time); // 获取的是前一天日期 |
|
|
|
let yesterday = new Date((new Date).getTime() - 24 * 60 * 60 * 1000) |
|
|
|
|
|
|
|
let year = yesterday.getFullYear() |
|
|
|
let month = yesterday.getMonth() + 1 //月 |
|
|
|
let day = yesterday.getDate() //日 |
|
|
|
|
|
|
|
var days = new Date(year, month, 0); |
|
|
|
days = days.getDate(); //获取当前月的天数 |
|
|
|
var year2 = year; |
|
|
|
var month2 = parseInt(month) - 1; |
|
|
|
if (month2 == 0) { |
|
|
|
year2 = parseInt(year2) - 1; |
|
|
|
month2 = 12; |
|
|
|
} |
|
|
|
var day2 = day; |
|
|
|
var days2 = new Date(year2, month2, 0); |
|
|
|
days2 = days2.getDate(); |
|
|
|
if (day2 > days2) { |
|
|
|
day2 = days2; |
|
|
|
} |
|
|
|
if (month2 < 10) { |
|
|
|
month2 = '0' + month2; |
|
|
|
} |
|
|
|
var t2 = year2 + '-' + month2 + '-' + day2; |
|
|
|
var t1 = year + '-' + month + '-' + day; |
|
|
|
// let t3 = formate(t2, style); |
|
|
|
|
|
|
|
this.timeRange = [t2, t1] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleSelectChange () { |
|
|
|
this.getApiData(); |
|
|
|
}, |
|
|
|
|
|
|
|
async getApiData () { |
|
|
|
|
|
|
|
await this.getPie() |
|
|
|
await this.getTable(); |
|
|
|
await this.getLine() |
|
|
|
await this.loadMapData(); |
|
|
|
}, |
|
|
|
|
|
|
|
async getAgencylist () { |
|
|
@ -219,181 +270,264 @@ export default { |
|
|
|
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' |
|
|
|
} |
|
|
|
|
|
|
|
pieInitOk (dom) { |
|
|
|
console.log('pie准备好了', dom) |
|
|
|
this.pieChartS = dom |
|
|
|
this.pieInitState = true |
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
}, |
|
|
|
getPie () { |
|
|
|
if (this.pieInitState) { |
|
|
|
this.getPieChart() |
|
|
|
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 { |
|
|
|
setTimeout(() => { |
|
|
|
this.getPie() |
|
|
|
}, 500) |
|
|
|
this.subAgencyArray = [] |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 获取饼状图 |
|
|
|
async getPieChart () { |
|
|
|
this.$refs.pieChart.clear() |
|
|
|
this.pieTotal = 0 |
|
|
|
|
|
|
|
async loadMapData () { |
|
|
|
this.$refs.lineChart.clear() |
|
|
|
|
|
|
|
const _that = this |
|
|
|
// this.$refs.pieChart.showLoading() |
|
|
|
// const url ="/data/aggregator/project/projectcategorylist"; |
|
|
|
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/projectcategorylist"; |
|
|
|
// this.$refs.lineChart.showLoading() |
|
|
|
// const url ="/gov/project/project/projectdistributionanalysisright"; |
|
|
|
const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisright"; |
|
|
|
let params = { |
|
|
|
agencyId: this.agencyId, |
|
|
|
dateId: this.dateId, |
|
|
|
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); |
|
|
|
// 获取pieChart配置 |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
// 获取pieChart配置 |
|
|
|
this.pieOption = pieOption(this.pieChartS) |
|
|
|
if (data && data.length > 0) { |
|
|
|
// this.pieData = data |
|
|
|
|
|
|
|
} else { |
|
|
|
this.pieData = [{ total: 0, categoryName: '无分类', color: '#00E5ED' }] |
|
|
|
this.legendArray = [] |
|
|
|
if (data.above) { |
|
|
|
this.under = data.under |
|
|
|
this.legendArray.push( |
|
|
|
{ |
|
|
|
color: this.colorArray[0], |
|
|
|
name: data.under + '以下' |
|
|
|
} |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
let maxValue = this.pieData[0].total |
|
|
|
let maxIndex = 0 |
|
|
|
this.pieData[0].selected = true |
|
|
|
this.pieData.forEach((item, index) => { |
|
|
|
item.name = item.categoryName |
|
|
|
item.value = item.total |
|
|
|
this.colorArray.push(item.color) |
|
|
|
this.pieTotal = this.pieTotal + item.value |
|
|
|
|
|
|
|
if (item.value > maxValue) { |
|
|
|
maxValue = item.value |
|
|
|
maxIndex = index |
|
|
|
item.selected = true |
|
|
|
} else if (index !== 0) { |
|
|
|
item.selected = false |
|
|
|
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] |
|
|
|
} |
|
|
|
|
|
|
|
this.pieOption.title.text = this.pieTotal |
|
|
|
this.pieOption.series[1].itemStyle = { |
|
|
|
color: function (params) { |
|
|
|
return _that.colorArray[params.dataIndex] |
|
|
|
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 |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let fun = function (params) { |
|
|
|
_that.clickPie(params.dataIndex) |
|
|
|
}); |
|
|
|
|
|
|
|
console.log(this.mapList) |
|
|
|
this.loadMap() |
|
|
|
this.isfirstInit = false |
|
|
|
|
|
|
|
_that.categoryCode = _that.pieData[params.dataIndex].categoryCode |
|
|
|
_that.getTable() |
|
|
|
} |
|
|
|
this.$refs.pieChart.handleClick(fun) |
|
|
|
this.clickPie(maxIndex) |
|
|
|
} 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) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
clickPie (seriesIndex) { |
|
|
|
this.pieData.forEach((element, index) => { |
|
|
|
if (index === seriesIndex) { |
|
|
|
element.label = { |
|
|
|
show: true, |
|
|
|
|
|
|
|
}; |
|
|
|
element.labelLine = { |
|
|
|
show: true, |
|
|
|
lineStyle: { |
|
|
|
opacity: 1, |
|
|
|
lineInitOk (dom) { |
|
|
|
|
|
|
|
|
|
|
|
this.lineInitState = true |
|
|
|
|
|
|
|
}, |
|
|
|
getLine () { |
|
|
|
if (this.lineInitState) { |
|
|
|
this.getLineChart() |
|
|
|
} else { |
|
|
|
setTimeout(() => { |
|
|
|
this.getLine() |
|
|
|
}, 500) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 获取折线图 |
|
|
|
async getLineChart () { |
|
|
|
this.$refs.lineChart.clear() |
|
|
|
|
|
|
|
const _that = this |
|
|
|
// this.$refs.lineChart.showLoading() |
|
|
|
// const url ="/gov/project/project/projectdistributionanalysisleft"; |
|
|
|
const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/projectdistributionanalysisleft"; |
|
|
|
let params = { |
|
|
|
orgId: this.orgId, |
|
|
|
startDate: this.timeRange.length > 0 && this.timeRange[0] || '', |
|
|
|
endDate: this.timeRange.length > 0 && this.timeRange[1] || '' |
|
|
|
}; |
|
|
|
console.log('zhilma') |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
// 获取pieChart配置 |
|
|
|
this.lineOption = lineOption() |
|
|
|
|
|
|
|
if (data && data.length > 0) { |
|
|
|
|
|
|
|
this.loadCategoryData() |
|
|
|
|
|
|
|
} else { |
|
|
|
element.label = { |
|
|
|
show: false, |
|
|
|
|
|
|
|
}; |
|
|
|
element.labelLine = { |
|
|
|
show: false, |
|
|
|
lineStyle: { |
|
|
|
opacity: 0, |
|
|
|
color: 'rgba(255,255,255,0)' |
|
|
|
} |
|
|
|
this.$refs.lineChart.setOption(this.lineOption, true) |
|
|
|
this.$refs.lineChart.setOption({ |
|
|
|
xAxis: { data: this.xaxis }, |
|
|
|
legend: { data: this.legend }, |
|
|
|
series: this.series |
|
|
|
}, true) |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.pieOption.series[1].data = this.pieData |
|
|
|
// this.$refs.pieChart.hideLoading() |
|
|
|
this.$refs.pieChart.setOption(this.pieOption) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleChangeAgency (value) { |
|
|
|
//解析折线图数据 |
|
|
|
loadCategoryData () { |
|
|
|
|
|
|
|
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label |
|
|
|
this.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' |
|
|
|
this.getApiData() |
|
|
|
console.log(this.agencyIdArray) |
|
|
|
}, |
|
|
|
this.xaxis = [] |
|
|
|
this.series = [] |
|
|
|
this.legend = [] |
|
|
|
let num = this.lineList[0].categoryList.length |
|
|
|
|
|
|
|
//加载组织数据 |
|
|
|
async getTable () { |
|
|
|
// const url = "/data/aggregator/project/categoryprojectlist"; |
|
|
|
const url = "http://yapi.elinkservice.cn/mock/245/data/aggregator/project/categoryprojectlist"; |
|
|
|
let params = { |
|
|
|
dateId: this.dateId, |
|
|
|
agencyId: this.agencyId, |
|
|
|
categoryCode: this.categoryCode, |
|
|
|
pageNo: this.demand.pageNo, |
|
|
|
pageSize: this.demand.pageSize, |
|
|
|
isPage: true |
|
|
|
}; |
|
|
|
let dataArray = new Array(num) |
|
|
|
//遍历每个分类 |
|
|
|
this.lineList[0].categoryList.forEach((categoryItem, index) => { |
|
|
|
this.legend.push(categoryItem.name) |
|
|
|
dataArray[index] = [] |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
this.demand.loading = false; |
|
|
|
}); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.demand.total = data.total; |
|
|
|
this.demand.list = data.list.map((item) => { |
|
|
|
//楼院小组:issue; 项目立项:agency 事件上报:resi_event【也可控制点击查看时里边三个按钮的显示】 |
|
|
|
item.originShow = item.origin === 'issue' ? '楼院小组' : item.origin === 'agency' ? '项目立项' : '事件上报' |
|
|
|
//状态:待处理 pending,已结案closed |
|
|
|
item.statusShow = item.status === 'pending' ? '待处理' : '已结案' |
|
|
|
return [ |
|
|
|
{ type: "index" }, |
|
|
|
item.projectCode, |
|
|
|
item.categoryNames.join(','), |
|
|
|
item.originShow, |
|
|
|
item.gridName, |
|
|
|
item.statusShow, |
|
|
|
item.title, |
|
|
|
item.time, |
|
|
|
{ type: "operate", list: ["查看"] }, |
|
|
|
]; |
|
|
|
//遍历每个时间 |
|
|
|
this.lineList.forEach(item => { |
|
|
|
this.xaxis.push(item.time) |
|
|
|
|
|
|
|
//遍历每个分类 |
|
|
|
item.categoryList.forEach((categoryItem, index) => { |
|
|
|
dataArray[index].push(categoryItem.count) |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
//遍历第一组的分类 |
|
|
|
this.lineList[0].categoryList.forEach((categoryItem, index) => { |
|
|
|
|
|
|
|
let object = { |
|
|
|
name: categoryItem.name, |
|
|
|
type: 'line', |
|
|
|
barWidth: 15, |
|
|
|
areaStyle: {}, |
|
|
|
itemStyle: { |
|
|
|
color: new echarts.graphic.LinearGradient( |
|
|
|
0, 1, 0, 0, |
|
|
|
[ |
|
|
|
{ offset: 0, color: 'rgba(121, 55, 255, 0)' }, |
|
|
|
{ offset: 1, color: categoryItem.color } |
|
|
|
] |
|
|
|
) |
|
|
|
}, |
|
|
|
data: dataArray[index] |
|
|
|
} |
|
|
|
|
|
|
|
this.series.push(object) |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handlePageNoChange_demand (val) { |
|
|
|
this.demand.pageNo = val; |
|
|
|
this.getTable(); |
|
|
|
handleChangeAgency (value) { |
|
|
|
this.agencyName = this.$refs["myCascader"].getCheckedNodes()[0].label |
|
|
|
this.orgId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '' |
|
|
|
this.getApiData() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
toUserInfo (uid) { |
|
|
|
this.$router.push({ path: `/main-shuju/visual-basicinfo-people/${uid}` }); |
|
|
|
}, |
|
|
@ -406,12 +540,15 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
computed: {}, |
|
|
|
computed: { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
components: { |
|
|
|
cptCard, |
|
|
|
cptTb, |
|
|
|
screenEchartsFrame, |
|
|
|
screenMap |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|