chore: prepare production release package
This commit is contained in:
@@ -73,7 +73,6 @@ const productSpecItems = computed(() => {
|
||||
appendSpecItem(items, "品牌", product.brand_name);
|
||||
appendSpecItem(items, "颜色", product.color);
|
||||
appendSpecItem(items, "规格/尺寸", product.size_spec);
|
||||
appendSpecItem(items, "序列号/编码", product.serial_no);
|
||||
|
||||
for (const point of normalizedKeyPoints(result.key_points)) {
|
||||
if (hasSpecItem(items, point.point_name)) continue;
|
||||
@@ -102,11 +101,12 @@ function appendSpecItem(
|
||||
value: unknown,
|
||||
remark: unknown = "",
|
||||
) {
|
||||
const labelText = textValue(label);
|
||||
const valueText = textValue(value);
|
||||
const remarkText = textValue(remark);
|
||||
if (!valueText && !remarkText) return;
|
||||
if (!labelText || isHiddenProductSpecLabel(labelText) || (!valueText && !remarkText)) return;
|
||||
items.push({
|
||||
label,
|
||||
label: labelText,
|
||||
value: valueText || "-",
|
||||
remark: remarkText,
|
||||
});
|
||||
@@ -121,6 +121,11 @@ function textValue(value: unknown) {
|
||||
return String(value ?? "").trim();
|
||||
}
|
||||
|
||||
function isHiddenProductSpecLabel(label: string) {
|
||||
const normalized = label.replace(/\s+/g, "");
|
||||
return normalized === "序列号" || normalized === "序列号/编码";
|
||||
}
|
||||
|
||||
function normalizedKeyPoints(value: unknown) {
|
||||
if (!Array.isArray(value)) return [];
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user