From 2c0a5a2b0aa0257bd1213c62ad02026c6340019b Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 30 七月 2024 14:37:39 +0800
Subject: [PATCH] 检验任务-数据采集-保留配置的小数位数

---
 static/js/worker.js                                    |    2 +-
 static/js/worker0.js                                   |   14 ++++++++++++--
 src/main.js                                            |    2 +-
 src/components/do/b1-inspect-order-plan/Inspection.vue |    1 +
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index fb42e85..8438b07 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -2349,6 +2349,7 @@
           if (!isTrue) {
             n.v.v = n.v.v.replace('/', '')
           }
+          let num = 0
         }
         try {
           // 鍚� Worker 鍙戦�佹秷鎭紝寮�濮嬪鐞嗛�昏緫
diff --git a/src/main.js b/src/main.js
index 01126d7..2ac230c 100644
--- a/src/main.js
+++ b/src/main.js
@@ -20,7 +20,7 @@
 //鏈湴
 // Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
 // const javaApi = 'http://127.0.0.1:8001';
-const javaApi = 'http://192.168.92.249:8001';
+const javaApi = 'http://192.168.92.2:8001';
 
 //浜�
 // Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080";
diff --git a/static/js/worker.js b/static/js/worker.js
index beba853..60c3ac5 100644
--- a/static/js/worker.js
+++ b/static/js/worker.js
@@ -340,7 +340,7 @@
                     if(comResult==0){
                       a[b].v.v = 0
                     }else{
-                      let val = parseFloat(comResult.toFixed(3))
+                      let val = parseFloat(Number(comResult).toFixed(3))
                       a[b].v.v = isNaN(val) ? '' : val
                     }
                   }catch(error){
diff --git a/static/js/worker0.js b/static/js/worker0.js
index aa80ca3..b725961 100644
--- a/static/js/worker0.js
+++ b/static/js/worker0.js
@@ -42,7 +42,12 @@
               let arr = n.v.ps.value.split('鍊�')
               if(arr[1] ==dataAcquisitionInfo.frequency){
                 setTimeout(()=>{
-                  n.v.v = dataAcquisitionInfo[str]
+                  let num = 0
+                  if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
+                    let str = n.v.ct.fa.split('.')[1]
+                    num = str.length
+                  }
+                  n.v.v = dataAcquisitionInfo[str]?dataAcquisitionInfo[str].toFixed(num):0
                   result = {
                     method:'changeInput',
                     value:{
@@ -55,7 +60,12 @@
               }else if(Number(dataAcquisitionInfo.frequency)>num){
                 if(n.v.ps.value.includes(num)){
                   setTimeout(()=>{
-                    n.v.v = dataAcquisitionInfo[str]
+                    let num = 0
+                    if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
+                      let str = n.v.ct.fa.split('.')[1]
+                      num = str.length
+                    }
+                    n.v.v = dataAcquisitionInfo[str]?Number(dataAcquisitionInfo[str]).toFixed(num):0
                     result = {
                       method:'changeInput',
                       value:{

--
Gitblit v1.9.3