Browse Source

Merge branch 'feature-xiaowang' of http://120.46.222.128:10021/elink-star/epmet-work-pc into 7.31

feature
mk 1 year ago
parent
commit
7eab24dbdd
  1. 216
      src/views/modules/shequzhili/analysis/index.vue

216
src/views/modules/shequzhili/analysis/index.vue

@ -76,7 +76,7 @@
<div style="display: flex;justify-content: space-between;flex-direction:row;">
<h1 style="font-size: 24px; font-weight: bold;"> 事件类型统计 </h1>
</div>
<table >
<!-- <table >
<thead>
<tr>
<th>一级分类</th>
@ -103,7 +103,51 @@
<TableRow v-for="item in tableList" :key="item.id" :item="item" :level="1" />
</thead>
</table>
</table> -->
<el-table
:data="tableList"
style="width: 100%;margin-bottom: 20px;"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
prop="level1"
label="一级分类"
sortable
width="150">
</el-table-column>
<el-table-column
prop="level2"
label="二级分类"
sortable
width="150">
</el-table-column>
<el-table-column
prop="level3"
label="三级分类"
sortable
width="150">
</el-table-column>
<el-table-column
prop="level4"
label="四级分类"
sortable
width="150">
</el-table-column>
<el-table-column
prop="eventCount"
label="事件数量"
sortable
width="150">
</el-table-column>
<el-table-column
prop="proportion"
label="同级占比"
sortable
>
</el-table-column>
</el-table>
<div style="display: flex;justify-content: space-between;flex-direction:row;">
<h1 style="font-size: 24px; font-weight: bold;"> 部门科室工单量统计 </h1>
<h1 style="font-size: 24px; font-weight: bold; margin-right: 600px;"> 社区工单量统计 </h1>
@ -272,7 +316,7 @@
class="dialog-h" @closed="showAddEventList = false">
<add-complain-list ref="ref_area_no_same_list" @clickAwoFlagData="clickAwoFlagData"></add-complain-list>
</el-dialog>
<awoList ref="awoList" />
<!-- <awoList ref="awoList" /> -->
</div>
</template>
<script>
@ -780,10 +824,10 @@ export default {
console.log(this.formData);
//
this.cleanReportData();
await this.getTableData();
await this.initEcharts();
await this.EventCategoryAnalysis();
await this.EventCate();
// await this.getTableData();
// await this.initEcharts();
// await this.EventCategoryAnalysis();
// await this.EventCate();
await this.getCategoryTree()
},
//
@ -797,8 +841,118 @@ export default {
}
const { data, code, msg } = await requestPost(url, param);
if (code === 0) {
console.log(data);
this.tableList=data
this.tableList=[
{
"id": "1",
"pid": "0",
"customerId": null,
"pids": "0",
"pidList": null,
"parentCategoryCode": null,
"categoryName": "城市综合",
"categoryCode": "A1",
"categoryType": "0",
"sort": 0,
"color": null,
"isDisable": 1,
"infoCode": "A",
"eventCount": 4,
"proportion": 100,
"level1": "城市综合",
"level2": null,
"level3": null,
"level4": null,
"level5": null
},
{
"id": "11",
"pid": "1",
"customerId": null,
"pids": "1",
"pidList": null,
"parentCategoryCode": null,
"categoryName": "城市管理",
"categoryCode": "A102",
"categoryType": "1",
"sort": 0,
"color": null,
"isDisable": 1,
"infoCode": "A",
"eventCount": 2,
"proportion": 50,
"level1": null,
"level2": "城市综合",
"level3": null,
"level4": null,
"level5": null
},
{
"id": "98",
"pid": "11",
"customerId": null,
"pids": "1,11",
"pidList": null,
"parentCategoryCode": null,
"categoryName": "市容环境",
"categoryCode": "A10201",
"categoryType": "2",
"sort": 0,
"color": null,
"isDisable": 1,
"infoCode": "A",
"eventCount": 2,
"proportion": 100,
"level1":null ,
"level2": null,
"level3": "城市综合",
"level4": null,
"level5": null
},
{
"id": "14",
"pid": "1",
"customerId": null,
"pids": "1",
"pidList": null,
"parentCategoryCode": null,
"categoryName": "居民生活",
"categoryCode": "A105",
"categoryType": "1",
"sort": 0,
"color": null,
"isDisable": 1,
"infoCode": "A",
"eventCount": 2,
"proportion": 50,
"level1": null,
"level2": null,
"level3": null,
"level4":"城市综合" ,
"level5": null
},
{
"id": "125",
"pid": "14",
"customerId": null,
"pids": "1,14",
"pidList": null,
"parentCategoryCode": null,
"categoryName": "污水",
"categoryCode": "A10507",
"categoryType": "2",
"sort": 0,
"color": null,
"isDisable": 1,
"infoCode": "A",
"eventCount": 2,
"proportion": 100,
"level1": null,
"level2": null,
"level3": null,
"level4": null,
"level5": "城市综合"
}
]
console.log(this.tableList,"lksdjfklj s");
} else {
this.$message.error(msg);
@ -830,6 +984,50 @@ export default {
this.$message.error(msg);
}
},
flattenTree(tree, levelKeys = []) {
let result = [];
tree.forEach(node => {
let newLevelKeys = [...levelKeys];
newLevelKeys.push(node.categoryName);
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 (level1) {
level2 = level3 = level4 = level5 = null;
} else if (level2) {
level1 = level3 = level4 = level5 = null;
} else if (level3) {
level1 = level2 = level4 = level5 = null;
} else if (level4) {
level1 = level2 = level3 = level5 = null;
} else if (level5) {
level1 = level2 = level3 = 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) {
result = result.concat(flattenTree(node.children, newLevelKeys));
}
});
return result;
},
//
async EventCategoryAnalysis(){
const url = "/governance/icEvent/EventCategoryAnalysis";

Loading…
Cancel
Save