From 0600ab29100da647a5cd34c935c16f59b3e772e5 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 17 三月 2025 11:14:39 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev

---
 src/utils/thread/worker0.js |  154 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 154 insertions(+), 0 deletions(-)

diff --git a/src/utils/thread/worker0.js b/src/utils/thread/worker0.js
new file mode 100644
index 0000000..5000a18
--- /dev/null
+++ b/src/utils/thread/worker0.js
@@ -0,0 +1,154 @@
+// 姝ょ嚎绋嬩负鏁版嵁閲囬泦绾跨▼
+
+// 淇濆瓨鏁版嵁
+// 鏁版嵁閲囬泦淇℃伅
+'use strict';//涓簀s鑴氭湰寮�鍚弗鏍兼ā寮�
+let dataAcquisitionInfo = null;
+// 鏁版嵁鍒楄〃
+let list = null;
+// 浼犻�掑埌涓荤嚎绋嬬殑鏁版嵁
+let result = {
+  method:'',
+  value:null
+}
+// 浼樺寲鏁伴噰杈冨鏁版嵁鏃�--璁板綍鏁伴噰椤圭洰鐨処d鏁扮粍锛岀洰鐨勬槸鍙栨渶鍚庝竴涓暟閲囬」鐩紝浼犲埌涓荤嚎绋嬭繘琛屾壒閲忕殑鏁版嵁閲囬泦淇濆瓨
+let arrSpecial = []
+// 鎺ユ敹涓荤嚎绋嬩紶閫掕繃鏉ョ殑鏁版嵁
+self.onmessage = function(event) {
+  const data = JSON.parse(event.data);
+  dataAcquisitionInfo = data.dataAcquisitionInfo;
+  list = data.list;
+  // console.log(111,dataAcquisitionInfo)
+  arrSpecial = []
+  // 澶勭悊鏁版嵁
+  handleData()
+}
+
+function handleData(){
+  // 閬嶅巻鏁版嵁鍒楄〃
+  list.forEach((item,index)=>{
+    let num = 0;
+    let str = ''
+    item.forEach(m=>{
+      if(m.v.ps&&(m.v.ps.value=='妫�楠屽瓙椤�'||m.v.ps.value=='妫�楠岄」')){
+        if(m.v.ps&&m.v.ps.value=='妫�楠岄」'){
+          if(num==0){
+            str = m.v.v+','
+            num++
+          }
+        }
+        if(m.v.ps&&m.v.ps.value=='妫�楠屽瓙椤�'){
+          if(num==1){
+            str = str+m.v.v
+          }
+        }
+        // 涓婇潰鍦ㄨ褰曟楠岄」+妫�楠屽瓙椤圭殑鍚嶇О锛屽鏋滄暟閲囧寘鍚楠岄」+妫�楠屽瓙椤圭殑鏁版嵁锛屽垯鎵ц
+        if(dataAcquisitionInfo[str]){
+          let num = 0;//璇ユ楠岄」瀵瑰簲妫�楠屽�肩殑涓暟锛岀敤鐢ㄥ垽鏂渶澶氭湁澶氬皯涓楠屽�硷紝濡傛灉澶氭閲囬泦瓒呰繃浜嗚涓暟锛屽垯璧嬪�肩粰鏈�鍚庝竴涓楠屽��
+          list[index].forEach(n=>{
+            if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('妫�楠屽��')){
+              num++
+            }
+          })
+          list[index].forEach((n,i)=>{
+            if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('妫�楠屽��')){
+              let arr = n.v.ps.value.split('鍊�')
+              if(Array.isArray(dataAcquisitionInfo[str].value)){
+                // 濡傛灉鏁版嵁婧愪负鏁扮粍锛屽垯鎵ц
+                for (let i = 0; i < dataAcquisitionInfo[str].value.length; i++) {
+                  if(i+1==arr[1]){
+                    // 璧嬪�兼暟閲囦紭鍖栨楠岄」鍒楄〃
+                    arrSpecial.push(n.i)
+                    setTimeout(()=>{
+                      let num0 = 0
+                      if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
+                        // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟
+                        let str0 = n.v.ct.fa.split('.')[1]
+                        num0 = str0.length
+                        n.v.v = dataAcquisitionInfo[str].value[i]?Number(dataAcquisitionInfo[str].value[i]).toFixed(num0):dataAcquisitionInfo[str].value[i]
+                      }else{
+                        // 鐩存帴璧嬪��
+                        n.v.v = dataAcquisitionInfo[str].value[i]
+                      }
+                      // 浼犻�掔粰涓荤嚎绋�
+                      result = {
+                        method:'changeInput',
+                        value:{
+                          list:list,
+                          n:n
+                        }
+                      }
+                      self.postMessage(JSON.stringify(result))
+                    },2000)
+                  }
+                }
+              }else{
+                // 濡傛灉鏁版嵁婧愪负瀛楃鎴栨暟瀛楋紝鍒欐墽琛�
+                if(arr[1] ==dataAcquisitionInfo[str].frequency){
+                  // 濡傛灉鏁伴噰娆℃暟绛変簬妫�楠屽�煎簭鍙凤紝鍒欒祴鍊肩粰褰撳墠妫�楠屽��
+                  arrSpecial.push(n.i)
+                  setTimeout(()=>{
+                    let num0 = 0
+                    if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
+                      // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟
+                      let str0 = n.v.ct.fa.split('.')[1]
+                      num0 = str0.length
+                      n.v.v = dataAcquisitionInfo[str].value?Number(dataAcquisitionInfo[str].value).toFixed(num0):dataAcquisitionInfo[str].value
+                    }else{
+                      // 鐩存帴璧嬪��
+                      n.v.v = dataAcquisitionInfo[str].value
+                    }
+                    // 浼犻�掔粰涓荤嚎绋�
+                    result = {
+                      method:'changeInput',
+                      value:{
+                        list:list,
+                        n:n
+                      }
+                    }
+                    self.postMessage(JSON.stringify(result))
+                  },2000)
+                }else if(Number(dataAcquisitionInfo[str].frequency)>num){
+                  // 濡傛灉鏁伴噰娆℃暟澶т簬妫�楠屽�煎簭鍙凤紝鍒欒祴鍊肩粰鏈�鍚庝竴涓楠屽��
+                  if(n.v.ps.value.includes(num)){
+                    arrSpecial.push(n.i)
+                    setTimeout(()=>{
+                      let num0 = 0
+                      if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
+                        // 淇濈暀妯℃澘閰嶇疆鐨勫皬鏁扮偣浣嶆暟
+                        let str0 = n.v.ct.fa.split('.')[1]
+                        num0 = str0.length
+                        n.v.v = dataAcquisitionInfo[str].value?Number(dataAcquisitionInfo[str].value).toFixed(num0):dataAcquisitionInfo[str].value
+                      }else{
+                        // 鐩存帴璧嬪��
+                        n.v.v = dataAcquisitionInfo[str].value
+                      }
+                      // 浼犻�掔粰涓荤嚎绋�
+                      result = {
+                        method:'changeInput',
+                        value:{
+                          list:list,
+                          n:n
+                        }
+                      }
+                      self.postMessage(JSON.stringify(result))
+                    },2000)
+                  }
+                }
+              }
+            }
+          })
+        }
+      }
+    })
+  })
+  // if(arrSpecial[arrSpecial.length-1]){
+  //   //浼樺寲鏁伴噰杈冨鏁版嵁鏃�-璁板綍鏈�鍚庝竴涓楠岄」鐨刬d锛岀敤浜庡悗缁鐞�
+  //   setTimeout(()=>{
+  //     result = {
+  //       getDataTypeId:arrSpecial[arrSpecial.length-1],
+  //     }
+  //     self.postMessage(JSON.stringify(result))
+  //   },0)
+  // }
+}

--
Gitblit v1.9.3