From 8f06fbf30772f2dd23a0ca7957d0f6d3db92c0e9 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 17 九月 2026 17:36:19 +0800
Subject: [PATCH] feat: 移除“标准维护”中的“标准描述EN”
---
src/workers/InspectionWorker.worker.js | 42 +++++++++++++++++++++++++++++++++++++-----
1 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/src/workers/InspectionWorker.worker.js b/src/workers/InspectionWorker.worker.js
index f838022..8319427 100644
--- a/src/workers/InspectionWorker.worker.js
+++ b/src/workers/InspectionWorker.worker.js
@@ -37,6 +37,9 @@
let sourceInsItemId = null;
// 褰撳墠娑堟伅鐗堟湰銆俉orker 鍗曠嚎绋嬩覆琛屽鐞嗘秷鎭紝渚涢�掑綊鍏紡璁$畻瀹屾垚鍚庡洖浼犵粰涓荤嚎绋嬨��
let currentRevision = null;
+// 鏈杈撳叆鏄惁寰�鍗曞厓鏍煎啓鍏ヨ繃璁$畻缁撴灉銆傞摼寮忓叕寮忓彧鏈夋渶澶栧眰浼氬洖浼犱繚瀛橈紝
+// 鐢ㄥ畠鍦ㄦ渶澶栧眰鍒ゆ柇璁$畻鐨勪腑闂村�兼槸鍚︿篃闇�瑕佽惤搴撱��
+let hasComputedWrite = false;
/**
* 鐢熸垚妯℃澘缁撴瀯绛惧悕
@@ -141,7 +144,8 @@
comparisonList = JSON.parse(JSON.stringify(data.comparisonList));
currentSample = JSON.parse(JSON.stringify(data.currentSample));
PROJECT = data.PROJECT;
- // 鎵ц璁$畻鏂规硶
+ // 鎵ц璁$畻鏂规硶銆傛瘡娆¤緭鍏ラ噸缃爣璁帮紝鐢辨湰娆¤皟鐢ㄦ爤鐨勬渶澶栧眰鍐冲畾鏄惁鍥炰紶淇濆瓨
+ hasComputedWrite = false;
changeInput("", code);
};
@@ -172,6 +176,18 @@
}
/**
+ * 鑾峰彇绾崟鍏冩牸寮曠敤鍏紡鐨勫潗鏍囧悕锛屼緥濡� =F4銆�=$F$4銆�
+ * 绾紩鐢ㄥ簲鐩存帴澶嶅埗鍘熷�硷紝閬垮厤鎶娾�滃瑙傗�濈瓑涓枃鏂囨湰閫佸叆鏁板�艰绠椼��
+ */
+function getDirectReferenceName(f) {
+ if (typeof f !== "string") {
+ return null;
+ }
+ const matched = f.trim().match(/^=\s*\$?([A-Za-z]{1,3})\$?(\d{1,7})\s*$/);
+ return matched ? `${matched[1].toUpperCase()}${matched[2]}` : null;
+}
+
+/**
* 鎸夋楠岄」id鍙栧綋鍓嶆牱鍝佷笅鐨勬楠岄」淇℃伅,鍙栦笉鍒版椂杩斿洖绌哄璞�,閬垮厤鍏紡璁$畻鍥犵己椤逛腑鏂�
*
* @param id 妫�楠岄」id
@@ -197,7 +213,7 @@
return !(typeof r === "number" && isNaN(r));
}
-function changeInput(m, code) {
+function changeInput(m, code, isComputed) {
let str = code.split("-");
let r = str[1]; //褰撳墠琛�
let c = str[2]; //褰撳墠鍒�
@@ -273,7 +289,11 @@
// 濡傛灉鏄嚱鏁版柟娉曪紝鍒欐墽琛屾鏂规硶
let comResult = ""; //鍒濆鍖栬绠楃粨鏋�
try {
- if (
+ const directReferenceName = getDirectReferenceName(item.v.f);
+ if (directReferenceName && Object.prototype.hasOwnProperty.call(comValue, directReferenceName)) {
+ // =F4 杩欑被鍏紡鏃㈠彲鑳藉紩鐢ㄦ暟瀛楋紝涔熷彲鑳藉紩鐢ㄤ腑鏂囨枃鏈紝鐩存帴淇濈暀婧愬�笺��
+ comResult = comValue[directReferenceName];
+ } else if (
getInspectionValueType(item.i) == 1 ||
isNumericFormula(item.v.f)
) {
@@ -451,6 +471,7 @@
a[b].v.v = comResult;
console.log("error---", error);
}
+ hasComputedWrite = true;
break;
}
}
@@ -459,7 +480,9 @@
// 濡傛灉姝よ绠楃粨鏋滄墍灞炲崟鍏冩牸锛屽悓鏃朵篃鏄彟涓�涓猠xcel鍑芥暟鐨勫弬鏁帮紝閭d箞灏遍渶瑕侀�掑綊杩涜璁$畻
// 鍙湁绠楀嚭鏈夋晥缁撴灉鎵嶇户缁悜涓嬫父鍏紡浼犻��,閬垮厤鎶婄┖鍊�/NaN 浼犳煋缁欏叾瀹冨崟鍏冩牸
if (isValidComputedResult(comResult)) {
- changeInput(comResult, `${id}-${item.r}-${item.c}-${pId}`); //鏀瑰彉鏈�缁堝��
+ // 鏍囪涓鸿绠楀眰锛氬畠鍙兘鏄笅娓稿叕寮忕殑鍙傛暟(isSave 浼氳缃垚 false)锛屼絾鑷韩涔熸槸缁撴灉锛�
+ // 淇濆瓨浜ょ粰鏈�澶栧眰缁熶竴鍥炰紶锛屼腑闂村�间笉浼氳婕忔帀锛屼篃涓嶄細姣忎竴绾ч兘鍙戜竴娆′繚瀛樿姹�
+ changeInput(comResult, `${id}-${item.r}-${item.c}-${pId}`, true); //鏀瑰彉鏈�缁堝��
}
currentInsItemId = item.i;
} catch (error) {
@@ -467,7 +490,10 @@
}
}
});
- if (index === -1 || (inputType === undefined && isSave === "true")) {
+ if (
+ !isComputed &&
+ (hasComputedWrite || index === -1 || (inputType === undefined && isSave === "true"))
+ ) {
// 璧嬪�间紶閫掑埌涓荤嚎绋嬬殑鏁版嵁锛宮ethod锛歴aveInsContext琛ㄧず姝ゆ秷鎭渶瑕佷繚瀛樻暟鎹�
result = {
method: "saveInsContext",
@@ -1213,6 +1239,12 @@
return "鏂鑴嗗寲";
}
}
+ // 鍙傛暟浠e叆鍚庡惈涓枃鏃�(濡傛楠屽�煎~浜�"鍧囧寑"),涓嶈兘鍐嶅綋鍏紡 eval 鈥斺��
+ // eval("鍧囧寑") 浼氭姏 ReferenceError,琚灞� catch 鍚炴帀鍚庤繑鍥� undefined,
+ // 璇ュ崟鍏冩牸鐨勭粨鏋滄棦涓嶅啓鍥炰篃涓嶅悜涓嬫父鍏紡浼犻��,鏁存潯璁$畻閾炬柇鍦ㄨ繖閲�
+ if (/[涓�-榫/.test(str)) {
+ return str.trim();
+ }
// 璁$畻甯歌鐨�
const value = eval(str);
// 闄ら浂绛夐潪鏈夐檺缁撴灉涓嶅啓鍥炲崟鍏冩牸(涓� Excel 鐨� #DIV/0! 涓�鑷�:涓嶅嚭鍊�)
--
Gitblit v1.9.3