diff --git a/src/pages/components/MonitAndWarning.vue b/src/pages/components/MonitAndWarning.vue index 8d71fcd..c9797fe 100644 --- a/src/pages/components/MonitAndWarning.vue +++ b/src/pages/components/MonitAndWarning.vue @@ -14,6 +14,7 @@
预警类型
+
未完成/总数
{ - sum+=it.id; - }) + sum+=it.total; + }); this.todayCnt=sum; sum=0; tmps=d.data?.week||[]; tmps.forEach(it=>{ - sum+=it.id; - }) + sum+=it.total; + }); this.weekCnt=sum; let data=0; sum=0; tmps=d.data?.group||[]; - let objs=tmps.filter(it=>it.infoType==0); + let objs=tmps.filter(it=>it.infotype=="0"); objs.forEach(it=>{ - sum+=it.id; - if(it.checkState==4){ - data+=it.id; + sum+=it.total; + if(it.checkState!="4"){ + data+=it.total; } }); this.warningType[1].data=data; @@ -118,20 +115,30 @@ export default { data=0; sum=0; tmps=d.data?.group||[]; - objs=tmps.filter(it=>it.infoType==1); + objs=tmps.filter(it=>it.infotype=="1"); objs.forEach(it=>{ - sum+=it.id; - if(it.checkState!=4){ - data+=it.id; + sum+=it.total; + if(it.checkState!="4"){ + data+=it.total; } }); this.warningType[2].data=data; this.warningType[2].total=sum; + data=0; + sum=0; + tmps=d.data?.group||[]; + objs=tmps.filter(it=>it.infotype=="96"); + objs.forEach(it=>{ + sum+=it.total; + if(it.checkState!="4"){ + data+=it.total; + } + }); + this.warningType[0].data=data; + this.warningType[0].total=sum; this.elKey++; }); }, }, }; - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/pages/index.vue b/src/pages/index.vue index 2e92bb3..8d4538e 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -790,7 +790,11 @@ export default { tmps.forEach(it => { sum += it.value; }) - this.overviewTotal = sum; + if(n==0){ + this.overviewTotal = sum; + }else{ + this.overviewTotal = sum.toFixed(2); + } this.typeDistributionData = tmps; this.elKey++; }) diff --git a/src/pages/projectQuality.vue b/src/pages/projectQuality.vue index 8caf381..5948701 100644 --- a/src/pages/projectQuality.vue +++ b/src/pages/projectQuality.vue @@ -765,14 +765,14 @@ export default { list.push(item); } }); - } else if (n == 0) { - list = d || []; - } else { + } else if (n > 0) { d.data.forEach((item) => { if (item.measureInfo != "间距" && item.measureInfo != "长度") { list.push(item); } }); + } else { + list = d.data || []; } } this.measuredData = list.map((it) => {