From 0a40c5890d13d9f2de5c3ab663876afecbfbefbe Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期三, 28 十月 2026 17:57:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/utils/inspectionValueFormat.js | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/utils/inspectionValueFormat.js b/src/utils/inspectionValueFormat.js
index f9b6b16..4a5858e 100644
--- a/src/utils/inspectionValueFormat.js
+++ b/src/utils/inspectionValueFormat.js
@@ -1,9 +1,10 @@
/**
* 瑙f瀽鍘熷璁板綍妯℃澘涓殑妫�楠屽�兼壒娉ㄣ��
- * 鍏煎鏃ф牸寮忊�滄楠屽�尖�濓紝骞舵敮鎸侊細妫�楠屽�硷紝2銆佹楠屽�硷紝2锛岀瀛﹁鏁版硶銆�
+ * 鏀寔妫�楠屽�笺�佽绠楀�笺�佹渶缁堝�肩殑鎵规敞锛屼緥濡傦細妫�楠屽�硷紝2銆佽绠楀�硷紝2锛屾渶缁堝�硷紝2锛岀瀛﹁鏁版硶銆�
*/
export function parseInspectionValueAnnotation(annotation) {
- if (typeof annotation !== 'string' || !annotation.includes('妫�楠屽��')) return null;
+ const targetNames = ['妫�楠屽��', '璁$畻鍊�', '鏈�缁堝��'];
+ if (typeof annotation !== 'string') return null;
// 鎵规敞鍏佽涓枃閫楀彿銆佽嫳鏂囬�楀彿浠ュ強鈥滃拰鈥濊繛鎺ユ牸寮忓弬鏁般��
const parts = annotation
.replace(/锛�/g, ',')
@@ -12,6 +13,7 @@
.split(',')
.map(item => item.trim())
.filter(Boolean);
+ if (!targetNames.includes(parts[0])) return null;
const decimalIndex = parts.findIndex((item, index) => index > 0 && /^\d+$/.test(item));
const decimalPlaces = decimalIndex < 0 ? null : Number(parts[decimalIndex]);
if (decimalPlaces != null && (!Number.isInteger(decimalPlaces) || decimalPlaces < 0 || decimalPlaces > 15)) {
@@ -31,9 +33,10 @@
item && index + 1 !== decimalIndex && item !== '绉戝璁℃暟娉�' && !roundingNames[item]
);
if (unsupported.length || parts.length > 4) {
- return { error: '妫�楠屽�兼壒娉ㄦ牸寮忓簲涓猴細妫�楠屽�硷紝2锛屽洓鑸嶄簲鍏� 鎴� 妫�楠屽�硷紝2锛岀瀛﹁鏁版硶锛屽洓鑸嶄簲鍏�' };
+ return { error: '鎵规敞鏍煎紡搴斾负锛氭楠屽�硷紝2锛屽洓鑸嶄簲鍏ワ紱璁$畻鍊硷紝2锛涙渶缁堝�硷紝2锛岀瀛﹁鏁版硶' };
}
return {
+ target: parts[0],
decimalPlaces,
displayMode,
// 鍙傛暟椤哄簭鍐冲畾澶勭悊椤哄簭锛氱瀛﹁鏁版硶鍦ㄥ皬鏁颁綅鍓嶈〃绀哄厛杞瀛﹁鏁版硶銆�
--
Gitblit v1.9.3