Răsfoiți Sursa

feat: 更新化验室和连续检测日报偏差度显示的颜色

sunxiao 1 zi în urmă
părinte
comite
4cb63deec1
2 a modificat fișierele cu 38 adăugiri și 25 ștergeri
  1. 2 2
      .env.development
  2. 36 23
      src/views/report/record/index.vue

+ 2 - 2
.env.development

@@ -5,7 +5,7 @@ VITE_APP_TITLE = 智能国标化验室数据平台
 VITE_APP_ENV = 'development'
 
 # 管理系统/开发环境
-VITE_APP_BASE_API = http://192.168.40.21:8889
+# VITE_APP_BASE_API = http://192.168.40.21:8889
 
-# VITE_APP_BASE_TEST = http://10.0.0.28:8080/
+VITE_APP_BASE_API =  http://192.168.40.20:8889
 # VITE_APP_BASE_PROD = http://192.168.9.54:8080/

+ 36 - 23
src/views/report/record/index.vue

@@ -33,7 +33,7 @@ const columns = [
   {
     label: '高COD',
     children: [
-      { label: "标称值", prop: 'highCodStandardVal', width: 100 },
+      { label: "质控值", prop: 'highCodStandardVal', width: 100 },
       { label: "化验值", prop: 'highCodResultConcentration', width: 100 },
       { label: "偏差度", prop: 'highCodDeviationRate', width: 100 }
     ]
@@ -41,7 +41,7 @@ const columns = [
   {
     label: '低COD',
     children: [
-      { label: "标称值", prop: 'lowCodStandardVal', width: 100 },
+      { label: "质控值", prop: 'lowCodStandardVal', width: 100 },
       { label: "化验值", prop: 'lowCodResultConcentration', width: 100 },
       { label: "偏差度", prop: 'lowCodDeviationRate', width: 100 }
     ]
@@ -49,7 +49,7 @@ const columns = [
   {
     label: '氨氮',
     children: [
-      { label: "标称值", prop: 'anDanStandardVal', width: 100 },
+      { label: "质控值", prop: 'anDanStandardVal', width: 100 },
       { label: "化验值", prop: 'anDanResultConcentration', width: 100 },
       { label: "偏差度", prop: 'anDanDeviationRate', width: 100 }
     ]
@@ -57,7 +57,7 @@ const columns = [
   {
     label: '总氮',
     children: [
-      { label: "标称值", prop: 'tnStandardVal', width: 100 },
+      { label: "质控值", prop: 'tnStandardVal', width: 100 },
       { label: "化验值", prop: 'tnResultConcentration', width: 100 },
       { label: "偏差度", prop: 'tnDeviationRate', width: 100 }
     ]
@@ -65,7 +65,7 @@ const columns = [
   {
     label: '总磷',
     children: [
-      { label: "标称值", prop: 'tpStandardVal', width: 100 },
+      { label: "质控值", prop: 'tpStandardVal', width: 100 },
       { label: "化验值", prop: 'tpResultConcentration', width: 100 },
       { label: "偏差度", prop: 'tpDeviationRate', width: 100 }
     ]
@@ -73,7 +73,7 @@ const columns = [
   {
     label: '硝酸盐氮',
     children: [
-      { label: "标称值", prop: 'xsydStandardVal', width: 100 },
+      { label: "质控值", prop: 'xsydStandardVal', width: 100 },
       { label: "化验值", prop: 'xsydResultConcentration', width: 100 },
       { label: "偏差度", prop: 'xsydDeviationRate', width: 100 }
     ]
@@ -81,7 +81,7 @@ const columns = [
   {
     label: '亚硝酸盐',
     children: [
-      { label: "标称值", prop: 'yxsyStandardVal', width: 100 },
+      { label: "质控值", prop: 'yxsyStandardVal', width: 100 },
       { label: "化验值", prop: 'yxsyResultConcentration', width: 100 },
       { label: "偏差度", prop: 'yxsyDeviationRate', width: 100 }
     ]
@@ -89,7 +89,7 @@ const columns = [
   {
     label: '正磷酸盐',
     children: [
-      { label: "标称值", prop: 'zlsyStandardVal', width: 100 },
+      { label: "质控值", prop: 'zlsyStandardVal', width: 100 },
       { label: "化验值", prop: 'zlsyResultConcentration', width: 100 },
       { label: "偏差度", prop: 'zlsyDeviationRate', width: 100 }
     ]
@@ -160,24 +160,37 @@ const handleExport = () => {
 }
 
 const test = (key, item) => {
+  
   let color = '#606266';
   
-  const whitelist = [
-    'highCodDeviationRate',
-    'lowCodDeviationRate',
-    'anDanDeviationRate',
-    'tnDeviationRate',
-    'tpDeviationRate',
-    'xsydDeviationRate',
-    'yxsyDeviationRate',
-    'zlsyDeviationRate',
-  ]
+  // const whitelist = [
+  //   'highCodDeviationRate',
+  //   'lowCodDeviationRate',
+  //   'anDanDeviationRate',
+  //   'tnDeviationRate',
+  //   'tpDeviationRate',
+  //   'xsydDeviationRate',
+  //   'yxsyDeviationRate',
+  //   'zlsyDeviationRate',
+  // ]
 
-  if ( whitelist.includes(key) ) {
-    const n = item[key + 'Number'];
-    if ( (n || n == 0) && Math.abs( n ) > 0.1 ) {
-      color = 'red'
-    }
+  const fieldMapping = {
+    highCodDeviationRate: 'highCodRed',
+    lowCodDeviationRate: 'lowCodRed',
+    anDanDeviationRate: 'anDanRed',
+    tnDeviationRate: 'tnRed',
+    tpDeviationRate: 'tpRed',
+    xsydDeviationRate: 'xsydRed',
+    yxsyDeviationRate: 'yxsyRed',
+    zlsyDeviationRate: 'zlsyRed'
+  }
+
+  if ( fieldMapping[key] ) {
+    color = fieldMapping[key] && 'red'
+    //const n = item[key + 'Number'];
+    // if ( (n || n == 0) && Math.abs( n ) > 0.1 ) {
+    //   color = 'red'
+    // }
   }
 
   return {color};