|
|
@ -3,6 +3,11 @@ |
|
|
|
<div> |
|
|
|
<div class="m-search"> |
|
|
|
<el-form :inline="true" :model="formData" ref="ref_searchform" :label-width="'100px'"> |
|
|
|
<el-form-item label="所属组织" prop="agencyId"> |
|
|
|
<el-cascader class="u-item-width-normal" size="small" ref="myCascader" |
|
|
|
v-model.trim="formData.agencyId" :options="orgOptions" :props="orgOptionProps" |
|
|
|
clearable @change="handleCascaderChange"></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="统计时间"> |
|
|
|
<el-date-picker v-model.trim="formData.queryDateStart" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
placeholder="开始时间" style="width: 202px" clearable> |
|
|
@ -68,9 +73,9 @@ |
|
|
|
<img src="../../analysis/img/perp.png" alt /> |
|
|
|
<div class="item_content"> |
|
|
|
<div class="item_row1"> |
|
|
|
<div class="row_left">{{ analysisList.illegalConnectTotal }}</div> |
|
|
|
<div class="row_left">{{ analysisList.illegalConnectTotal || 0 }}</div> |
|
|
|
|
|
|
|
<div class="text1">{{ analysisList.illegalConnectRate }}%</div> |
|
|
|
<div class="text1">{{ analysisList.illegalConnectRate || 0 }}%</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="item_row2"> |
|
|
@ -85,9 +90,9 @@ |
|
|
|
<img src="@/assets/images/category/perpon.png" alt /> |
|
|
|
<div class="item_content"> |
|
|
|
<div class="item_row1"> |
|
|
|
<div class="row_left">{{ analysisList.illegalResolveTotal }}</div> |
|
|
|
<div class="row_left">{{ analysisList.illegalResolveTotal || 0 }}</div> |
|
|
|
|
|
|
|
<div class="text2">{{ analysisList.illegalResolveRate }}%</div> |
|
|
|
<div class="text2">{{ analysisList.illegalResolveRate || 0 }}%</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="item_row2"> |
|
|
@ -191,7 +196,6 @@ export default { |
|
|
|
return { |
|
|
|
starttime: "", |
|
|
|
endtime: "", |
|
|
|
level: 1, |
|
|
|
tableList: [], |
|
|
|
communityList: [], |
|
|
|
departmentList: [], |
|
|
@ -199,14 +203,16 @@ export default { |
|
|
|
formData: { |
|
|
|
queryDateStart: "", |
|
|
|
queryDateEnd: "", |
|
|
|
agencyId:'' |
|
|
|
}, |
|
|
|
|
|
|
|
agencyLevel: '', |
|
|
|
|
|
|
|
orgData: { |
|
|
|
id: "", |
|
|
|
level: "agency", |
|
|
|
orgOptionProps:{ |
|
|
|
multiple: false, |
|
|
|
value: 'agencyId', |
|
|
|
label: 'agencyName', |
|
|
|
children: 'subAgencyList', |
|
|
|
checkStrictly: true |
|
|
|
}, |
|
|
|
|
|
|
|
analysisList: {}, |
|
|
|
|
|
|
|
// 内容字段 |
|
|
@ -217,37 +223,14 @@ export default { |
|
|
|
departHotline: "", |
|
|
|
hotDemand: "", |
|
|
|
}, |
|
|
|
orgOptions:[], |
|
|
|
|
|
|
|
mobileData: [], |
|
|
|
addressMobileData: [], |
|
|
|
addComplainData: [], |
|
|
|
|
|
|
|
eventCategorys: [], |
|
|
|
|
|
|
|
categoryPie: {}, |
|
|
|
communityChart: {}, |
|
|
|
departChart: {}, |
|
|
|
hotlineChart: {}, |
|
|
|
|
|
|
|
categoryCountShow: false, |
|
|
|
communityCountShow: false, |
|
|
|
departCountShow: false, |
|
|
|
subCategoryCountShow: false, |
|
|
|
|
|
|
|
recId: "", |
|
|
|
departId: "", |
|
|
|
communityId: "", |
|
|
|
|
|
|
|
eventId: "", |
|
|
|
eventDetailData: {}, |
|
|
|
pageType: "info", |
|
|
|
|
|
|
|
mergeObj: {}, |
|
|
|
mergeArr: ['address'], |
|
|
|
|
|
|
|
myBarchart: {}, |
|
|
|
sourceType:'0' |
|
|
|
|
|
|
|
sourceType:'0', |
|
|
|
selectedValue:null, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@ -262,17 +245,22 @@ export default { |
|
|
|
watch: {}, |
|
|
|
mounted() { |
|
|
|
this.user = this.$store.state.user; |
|
|
|
this.agencyId = this.user.agencyId; |
|
|
|
this.formData.agencyId = this.user.agencyId; |
|
|
|
this.selectedValue = this.user.agencyId |
|
|
|
this.getLastMonthRange() |
|
|
|
this.getOrgData(); |
|
|
|
this.initEcharts() |
|
|
|
this.agencyLevel = localStorage.getItem("level", this.orgData.level); |
|
|
|
this.getTableData(); |
|
|
|
this.EventCategoryAnalysis(); |
|
|
|
this.EventCate(); |
|
|
|
this.getOrgTreeList() |
|
|
|
this.getCategoryTree() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleCascaderChange(value) { |
|
|
|
// value 是选中的完整路径数组 |
|
|
|
// 获取最后一个选中的值 |
|
|
|
const lastValue = value[value.length - 1]; |
|
|
|
console.log(lastValue); |
|
|
|
this.selectedValue = lastValue; |
|
|
|
}, |
|
|
|
calculateRowspan(item) { |
|
|
|
if (!item.children || !item.children.length) { |
|
|
|
return 1; |
|
|
@ -293,34 +281,17 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
//加载组织数据 |
|
|
|
async getOrgData() { |
|
|
|
const url = "/gov/org/agency/maporg"; |
|
|
|
let params = { |
|
|
|
orgId: "", |
|
|
|
level: "", |
|
|
|
}; |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.orgData = data; |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 搜索事件 |
|
|
|
handleSearch(val) { |
|
|
|
this.communityList = []; |
|
|
|
this.departmentList = []; |
|
|
|
|
|
|
|
console.log(this.formData); |
|
|
|
this.myBarchart =null; |
|
|
|
// 清空数据 |
|
|
|
this.getTableData(); |
|
|
|
this.EventCategoryAnalysis(); |
|
|
|
this.EventCate(); |
|
|
|
this.getCategoryTree() |
|
|
|
this.initEcharts() |
|
|
|
}, |
|
|
|
//事件类型统计 |
|
|
|
async getCategoryTree() { |
|
|
@ -341,9 +312,7 @@ export default { |
|
|
|
const { data, code, msg } = await requestPost(url, param); |
|
|
|
if (code === 0) { |
|
|
|
this.tableList = data |
|
|
|
// this.tableList=this.flattenTree(data); |
|
|
|
console.log(this.tableList); |
|
|
|
console.log(this.tableList, "lksdjfklj s"); |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
@ -360,39 +329,15 @@ export default { |
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
|
|
|
}, |
|
|
|
initEcharts() { |
|
|
|
this.$http.get("/actual/base/residentIntegrity/resiCategoryStats/byOrg/query4Org").then(({ data: { data } }) => { |
|
|
|
let params = { |
|
|
|
startDate: this.starttime, |
|
|
|
endDate: this.endtime, |
|
|
|
usableFlag: false, |
|
|
|
agencyId:this.selectedValue |
|
|
|
} |
|
|
|
this.$http.post("/governance/icEvent/getSourceTypeNum",params).then(({ data: { data } }) => { |
|
|
|
this.myBarchart = echarts.init(document.getElementById("myBarchart")); |
|
|
|
data = { |
|
|
|
"totalResiNum": 25391, |
|
|
|
"nonIntegratedResiNum": 8359, |
|
|
|
"categoryStatsDatas": [ |
|
|
|
|
|
|
|
{ |
|
|
|
"resiCategory": "VETERAN_FLAG", |
|
|
|
"resiCategoryName": "退役军人", |
|
|
|
"total": 306, |
|
|
|
"integratedNum": 149, |
|
|
|
"nonIntegratedNum": 157 |
|
|
|
}, |
|
|
|
{ |
|
|
|
"resiCategory": "UNEMPLOYED_FLAG", |
|
|
|
"resiCategoryName": "失业人员", |
|
|
|
"total": 240, |
|
|
|
"integratedNum": 0, |
|
|
|
"nonIntegratedNum": 240 |
|
|
|
}, |
|
|
|
{ |
|
|
|
"resiCategory": "SUBSISTENCE_ALLOWANCE_FLAG", |
|
|
|
"resiCategoryName": "低保人员", |
|
|
|
"total": 53, |
|
|
|
"integratedNum": 2, |
|
|
|
"nonIntegratedNum": 51 |
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
} |
|
|
|
let xData = data.categoryStatsDatas.map(item => item.resiCategoryName) |
|
|
|
|
|
|
|
let xData = data.map(item => item.sourceTypeName) |
|
|
|
let option = { |
|
|
|
backgroundColor: '#fff', |
|
|
|
color: ['#448cf6', '#f7ca60',], |
|
|
@ -436,9 +381,9 @@ export default { |
|
|
|
type: 'bar', |
|
|
|
stack: '总量', |
|
|
|
barWidth: '50px', |
|
|
|
data: data.categoryStatsDatas.map((item, index) => ({ |
|
|
|
value: item.integratedNum, |
|
|
|
extraProperty: item.resiCategory |
|
|
|
data: data.map((item, index) => ({ |
|
|
|
value: item.num, |
|
|
|
// extraProperty: item.resiCategory |
|
|
|
})), |
|
|
|
}, |
|
|
|
{ |
|
|
@ -446,9 +391,9 @@ export default { |
|
|
|
type: 'bar', |
|
|
|
stack: '总量', |
|
|
|
barWidth: '50px', |
|
|
|
data: data.categoryStatsDatas.map((item, index) => ({ |
|
|
|
value: item.nonIntegratedNum, |
|
|
|
extraProperty: item.resiCategory |
|
|
|
data: data.map((item, index) => ({ |
|
|
|
value: item.num, |
|
|
|
// extraProperty: item.resiCategory |
|
|
|
})), |
|
|
|
} |
|
|
|
] |
|
|
@ -477,78 +422,24 @@ export default { |
|
|
|
console.log(this.formData.queryDateEnd); |
|
|
|
}, |
|
|
|
//对部门进行统计 |
|
|
|
async EventCate() { |
|
|
|
const url = "/governance/icEvent/EventCategoryAnalysis"; |
|
|
|
// 对社区,部门进行更改 |
|
|
|
if (this.formData.queryDateStart && this.formData.queryDateEnd) { |
|
|
|
this.starttime = this.formData.queryDateStart, |
|
|
|
this.endtime = this.formData.queryDateEnd |
|
|
|
} else { |
|
|
|
{ |
|
|
|
this.getLastMonthRange() |
|
|
|
} |
|
|
|
} |
|
|
|
let param = { |
|
|
|
startDate: this.starttime, |
|
|
|
endDate: this.endtime, |
|
|
|
usableFlag: true |
|
|
|
} |
|
|
|
const { data, code, msg } = await requestPost(url, param); |
|
|
|
if (code === 0) { |
|
|
|
console.log(data); |
|
|
|
data.map(item => { |
|
|
|
if (item.assignOrgType == "duty") { |
|
|
|
this.departmentList.push(item) |
|
|
|
|
|
|
|
getOrgTreeList () { |
|
|
|
this.$http |
|
|
|
.post('/gov/org/customeragency/agencygridtree', {}) |
|
|
|
.then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} else { |
|
|
|
this.communityList.push(item) |
|
|
|
this.orgOptions = res.data |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
flattenTree(tree, levelKeys = []) { |
|
|
|
let result = []; |
|
|
|
console.log(tree, "tree"); |
|
|
|
tree.forEach(node => { |
|
|
|
console.log(levelKeys); |
|
|
|
let newLevelKeys = [...levelKeys]; |
|
|
|
newLevelKeys.push(node.categoryName); |
|
|
|
console.log(newLevelKeys, "newLevelKeys"); |
|
|
|
let level1 = newLevelKeys[0] || null; |
|
|
|
let level2 = newLevelKeys[1] || null; |
|
|
|
let level3 = newLevelKeys[2] || null; |
|
|
|
let level4 = newLevelKeys[3] || null; |
|
|
|
let level5 = newLevelKeys[4] || null; |
|
|
|
|
|
|
|
if (level2) level1 = null; |
|
|
|
if (level3) level2 = null; |
|
|
|
if (level4) level3 = null; |
|
|
|
if (level5) level4 = null; |
|
|
|
|
|
|
|
let flattenedNode = { |
|
|
|
...node, |
|
|
|
level1: level1, |
|
|
|
level2: level2, |
|
|
|
level3: level3, |
|
|
|
level4: level4, |
|
|
|
level5: level5 |
|
|
|
}; |
|
|
|
|
|
|
|
delete flattenedNode.children; |
|
|
|
result.push(flattenedNode); |
|
|
|
|
|
|
|
if (node.children && node.children.length > 0) { |
|
|
|
console.log(node, "node"); |
|
|
|
result = result.concat(this.flattenTree(node.children, newLevelKeys)); |
|
|
|
} |
|
|
|
}); |
|
|
|
console.log(result); |
|
|
|
return result; |
|
|
|
.catch(() => { |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 对总数做出统计 |
|
|
|
async EventCategoryAnalysis() { |
|
|
|
const url = "/governance/icEvent/EventCategoryAnalysis"; |
|
|
|
const url = "/governance/icEvent/EventOldCategoryAnalysis"; |
|
|
|
if (this.formData.queryDateStart && this.formData.queryDateEnd) { |
|
|
|
this.starttime = this.formData.queryDateStart, |
|
|
|
this.endtime = this.formData.queryDateEnd |
|
|
@ -560,13 +451,12 @@ export default { |
|
|
|
let params = { |
|
|
|
startDate: this.starttime, |
|
|
|
endDate: this.endtime, |
|
|
|
usableFlag: false |
|
|
|
usableFlag: false, |
|
|
|
agencyId:this.selectedValue |
|
|
|
} |
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code === 0) { |
|
|
|
console.log(data); |
|
|
|
this.analysisList = data[0]; |
|
|
|
console.log(this.analysisList); |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
@ -577,112 +467,6 @@ export default { |
|
|
|
this.$message.info('功能即将开通,敬请期待') |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取分类 |
|
|
|
async getTableData() { |
|
|
|
const url = '/governance/dwdEvent/report'; |
|
|
|
const { formData } = this; |
|
|
|
const { data, code, internalMsg } = await requestPost(url, { |
|
|
|
...formData |
|
|
|
}); |
|
|
|
if (code != 0) { |
|
|
|
this.$message.info(internalMsg); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!data) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.report = data; |
|
|
|
|
|
|
|
this.tableLoading = true; |
|
|
|
|
|
|
|
this.mobileData = this.report.mobileEvent |
|
|
|
? this.report.mobileEvent.map(item => { |
|
|
|
return item; |
|
|
|
}) |
|
|
|
: []; |
|
|
|
|
|
|
|
this.addressMobileData = this.report.addressMobileEvents |
|
|
|
? this.report.addressMobileEvents.map(item => { |
|
|
|
return item; |
|
|
|
}) |
|
|
|
: []; |
|
|
|
this.addComplainData = this.report.awoEvents |
|
|
|
? this.report.awoEvents.map(item => { |
|
|
|
return item; |
|
|
|
}) |
|
|
|
: []; |
|
|
|
|
|
|
|
this.eventCategorys = this.report.eventCategorys |
|
|
|
? this.report.eventCategorys.map(item => { |
|
|
|
return item; |
|
|
|
}) |
|
|
|
: []; |
|
|
|
|
|
|
|
// 合并行 |
|
|
|
this.getSpanArr(this.addressMobileData); |
|
|
|
|
|
|
|
if (this.report && this.report.categoryCount && Object.keys(this.report.categoryCount).length > 0) { |
|
|
|
this.categoryCountShow = true; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.report && this.report.communityCount && Object.keys(this.report.communityCount).length > 0) { |
|
|
|
this.communityCountShow = true; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.report && this.report.departCount && Object.keys(this.report.departCount).length > 0) { |
|
|
|
this.departCountShow = true; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.report && this.report.subCategoryCount && Object.keys(this.report.subCategoryCount).length > 0) { |
|
|
|
this.subCategoryCountShow = true; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
cleanSearchForm() { |
|
|
|
this.departId = ''; |
|
|
|
this.eventId = ""; |
|
|
|
this.recId = ''; |
|
|
|
this.address = ''; |
|
|
|
this.mobile = ''; |
|
|
|
this.awo_flag = ''; |
|
|
|
}, |
|
|
|
|
|
|
|
getSpanArr(data) { |
|
|
|
this.mergeArr.forEach((key, index1) => { |
|
|
|
let count = 0; // 用来记录需要合并行的起始位置 |
|
|
|
this.mergeObj[key] = []; // 记录每一列的合并信息 |
|
|
|
data.forEach((item, index) => { |
|
|
|
// index == 0表示数据为第一行,直接 push 一个 1 |
|
|
|
if (index === 0) { |
|
|
|
this.mergeObj[key].push(1); |
|
|
|
} else { |
|
|
|
// 判断当前行是否与上一行其值相等 如果相等 在 count 记录的位置其值 +1 表示当前行需要合并 并push 一个 0 作为占位 |
|
|
|
if (item[key] === data[index - 1][key]) { |
|
|
|
this.mergeObj[key][count] += 1; |
|
|
|
this.mergeObj[key].push(0); |
|
|
|
} else { |
|
|
|
// 如果当前行和上一行其值不相等 |
|
|
|
count = index; // 记录当前位置 |
|
|
|
this.mergeObj[key].push(1); // 重新push 一个 1 |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 默认接受四个值 { 当前行的值, 当前列的值, 行的下标, 列的下标 } |
|
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) { |
|
|
|
// 判断列的属性 |
|
|
|
if (this.mergeArr.indexOf(column.property) !== -1) { |
|
|
|
// 判断其值是不是为0 |
|
|
|
if (this.mergeObj[column.property][rowIndex]) { |
|
|
|
return [this.mergeObj[column.property][rowIndex], 1] |
|
|
|
} else { |
|
|
|
// 如果为0则为需要合并的行 |
|
|
|
return [0, 0]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
props: {}, |
|
|
|