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})/;