From 1fe3b97466756d56c03a95c82c6ac88119203d68 Mon Sep 17 00:00:00 2001 From: haha Date: Sat, 12 Aug 2023 14:54:19 +0800 Subject: [PATCH] update code --- src/components/project-overview-chart.js | 2 +- src/pages/index.vue | 79 +++++++++++++++++------- 2 files changed, 59 insertions(+), 22 deletions(-) diff --git a/src/components/project-overview-chart.js b/src/components/project-overview-chart.js index 470c445..1e38c40 100644 --- a/src/components/project-overview-chart.js +++ b/src/components/project-overview-chart.js @@ -1,7 +1,7 @@ import Vue from 'vue' Vue.component("project-overview-chart", { template: ` -
+
diff --git a/src/pages/index.vue b/src/pages/index.vue index 22d7e88..68df46d 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -32,13 +32,13 @@ - -
-
安全管理
-
质量管理
+ +
+
安全管理
+
质量管理
- +
@@ -268,19 +268,23 @@ export default { }, }, }, - legendOpt2: { + legendOpt2: { icon: "rect", + orient: "horizontal", + left:'50%', + top:'top', + itemGap:0, textStyle: { fontSize: 14, rich: { name: { color: "#c3dbfd", - padding: [10, 5, 20, 5], + padding: [5, 2, 20, 2], }, percent: { color: "#4676FD", fontSize: 16, - padding: [0, 5, 0, 5], + padding: [0, 2, 0, 2], }, }, } @@ -291,19 +295,9 @@ export default { { text: '西安市地铁2号线二期工程施工总承包项目2标段', id: 2, type: 2 }, { text: '苏州桑田岛项目', id: 3, type: 2 }, ], - dangersDatas: [ - { name: '四口,临边防护工程', value: '0' }, - { name: '混泥土', value: '0' }, - { name: '移动脚手架', value: '0' }, - { name: '砌体', value: '0' }, - { name: '模板支架', value: '0' }, - { name: '外墙', value: '0' } - ], - + dangersDatas: [], //原因类型分析 - availabilityData: [ - - ], + availabilityData: [], overviewText: '项目数量', overviewTotal: 100, //项目概况 @@ -314,6 +308,8 @@ export default { ], //质量管理 qualityNav: 0, + qualityNavTitle:'', + qualityNavTotal:0, //劳务人员 infoNav: 0, staffText: '在岗人员', @@ -494,9 +490,50 @@ export default { this.$bus.$on("deptChange",dept=>{ this.deptInfo=dept; this.onClickoOverview(0) + this.qualityNavClick(0); }); }, methods: { + qualityNavClick(n){ + this.qualityNav=n; + if(n==0){ + this.qualityNavTitle="安全隐患总数"; + this.$api.problemmodify.safetySummary(this.deptInfo.id,0).then(d=>{ + this.dangersDatas=(d||[]).map(it=>{ + return { + text:it.problemArea, + prop:'0.0', + name:it.problemArea, + value:+it.roleType||0 + } + }); + let sum=0; + this.dangersDatas.forEach(it=>{ + sum+=it.value*1; + }) + this.qualityNavTotal=sum; + this.elKey++; + }) + }else{ + this.qualityNavTitle="质量隐患总数"; + this.$api.problemmodify.qualitySummary(this.deptInfo.id,0).then(d=>{ + this.dangersDatas=(d||[]).map(it=>{ + return { + text:it.problemArea, + prop:'0.0', + name:it.problemArea, + value:+it.roleType||0 + } + }); + let sum=0; + this.dangersDatas.forEach(it=>{ + sum+=it.value*1; + }) + this.qualityNavTotal=sum; + this.elKey++; + }) + } + }, numberWithCommas(x) { x = x.toString(); var pattern = /(-?\d+)(\d{3})/;