src/workers/InspectionWorker.worker.js
@@ -10,7 +10,7 @@
let comparisonList = [];
// 当前样品信息
let currentSample = {};
// 当前项目:检测中心、装备电缆
// 当前项目:检测中心
let PROJECT = "";
// 套管
let bushing = "";
@@ -30,6 +30,9 @@
let getDataTypeId = null;
//当前检验项
let currentInsItem = null;
// 当前这次输入对应的原始检验项。计算过程中 pId 会切换到下游计算项,
// 保存时必须同时带回原始检验项,否则只会保存计算结果。
let sourceInsItemId = null;
// 接收到主线程处理逻辑的消息
self.onmessage = function (event) {
  // 保存主线程传过来的值
@@ -54,6 +57,11 @@
  }
  modelType = data.modelType;
  code = data.code;
  const codeParts = typeof code === "string" ? code.split("-") : [];
  sourceInsItemId =
    data.currentInsItem && data.currentInsItem.i != null
      ? data.currentInsItem.i
      : codeParts[3];
  if (data.getDataTypeId) {
    // 记录 优化数采较多数据时-记录最后一个检验项的id
    getDataTypeId = data.getDataTypeId;
@@ -490,6 +498,7 @@
                param: getParam(), //传给后端的参数
                getDataTypeId: getDataTypeId,
                currentInsItemId: item.i,
                sourceInsItemId: sourceInsItemId,
              },
            };
            // 发消息给主线程
@@ -514,7 +523,7 @@
              tell.length > 0 &&
              typeof tell[0] == "string" &&
              tell[0].includes("/") &&
              tell[0] !== "/"; // 装备电缆--判断要求值是否为分数
              tell[0] !== "/"; // 判断要求值是否为分数
            const inspectionItemClass = currentSample.insProduct.find(
              (m) => m.id == item.i
            ).inspectionItemClass; // 检验项分类
@@ -703,6 +712,7 @@
        param: getParam(), //传给后端的参数
        getDataTypeId: getDataTypeId,
        currentInsItemId: currentInsItemId,
        sourceInsItemId: sourceInsItemId,
      },
    };
    // 发消息给主线程
@@ -847,7 +857,11 @@
        b.v.ps.value.includes("检验值")
      ) {
        // 赋值检验值
        b.i && b.v.v && param[b.i].insValue.push(b);
        b.i &&
          b.v.v !== "" &&
          b.v.v !== null &&
          b.v.v !== undefined &&
          param[b.i].insValue.push(b);
      }
      if (b.v.ps != undefined && b.v.ps.value === "计算值") {
        // 赋值计算值