username 3 år sedan
förälder
incheckning
358c224947

+ 37 - 4
src/views/kxcSystem/pipelineSystem/specialtyAnalysis/clearDistanceAnalysis/widget.vue

@@ -228,11 +228,12 @@ export default {
         pipeType: lineAttr1.type,
         pipeTypeAttr: lineAttr1.attr,
         comparePipeType: lineAttr2.type,
-        comparePipeTypeAttr: lineAttr2.attr
+        comparePipeTypeAttr: lineAttr2.attr,
+        compareType: 1
       }
       getPipelineDistance(data).then(res => {
         if (res.result.length == 0) {
-          this.$message.error("未找到相应的水平净距标准,无法进行分析!")
+          this.$message.warning("未找到相应的水平净距标准,无法进行分析!")
           return
         }
         let resVal = res.result[0].distanceValue.toString().split('-')
@@ -273,9 +274,41 @@ export default {
         pipeType: lineAttr1.type,
         pipeTypeAttr: lineAttr1.attr,
         comparePipeType: lineAttr2.type,
-        comparePipeTypeAttr: lineAttr2.attr
+        comparePipeTypeAttr: lineAttr2.attr,
+        compareType: 2
       }
-
+      getPipelineDistance(data).then(res => {
+        if (res.result.length == 0) {
+          this.$message.warning("未找到相应的垂直净距标准,无法进行分析!")
+          return
+        }
+        let resVal = res.result[0].distanceValue.toString().split('-')
+        // 标准是范围区间
+        if (resVal.length == 2) {
+          this.standard = '≥ ' + resVal[0] + ' m , ≤' + resVal[1] + ' m'
+          const min = parseFloat(resVal[0]).toFixed(2)
+          const max = parseFloat(resVal[1]).toFixed(2)
+          if (value >= min && value <= max) {
+            this.bgc = '#02baaf'
+            this.resultDes = '合规'
+          } else {
+            this.bgc = '#f40'
+            this.resultDes = '不合规'
+          }
+        }
+        // 标准是单个值
+        else {
+          this.standard = '≥ ' + resVal.toString() + " m"
+          if (value < parseFloat(resVal.toString()).toFixed(2)) {
+            this.bgc = '#f40'
+            this.resultDes = '不合规'
+          }
+          else {
+            this.bgc = '#02baaf'
+            this.resultDes = '合规'
+          }
+        }
+      })
     },
     /**
      * 清除结果