Update App.jsx via upload script - 2026-07-29 00:24:49

This commit is contained in:
mike 2026-07-29 00:25:12 +08:00
parent 8df99b0e50
commit 160f9ee109
1 changed files with 13 additions and 1 deletions

14
App.jsx
View File

@ -517,6 +517,14 @@ function upsertProductByName(list, product) {
return { list: [...list, product], collision: false, isNew: true, resultId: product.id }; return { list: [...list, product], collision: false, isNew: true, resultId: product.id };
} }
// ""/
// 220V50Hz12V9AH*1"线"""
// AI
//
function containsChinese(str) {
return /[\u4e00-\u9fa5]/.test(String(str || ''));
}
function gatherExportTerms(p, categories) { function gatherExportTerms(p, categories) {
const cat = (categories || []).find(c => c.id === p.category); const cat = (categories || []).find(c => c.id === p.category);
const terms = new Set(['产品规格书', '* 产品规格如有变动,恕不另行通知', '型号', '品牌', '产品大类']); const terms = new Set(['产品规格书', '* 产品规格如有变动,恕不另行通知', '型号', '品牌', '产品大类']);
@ -528,6 +536,9 @@ function gatherExportTerms(p, categories) {
rows.forEach(r => { rows.forEach(r => {
if (r.labelKey === '__port__') hasPortRow = true; if (r.labelKey === '__port__') hasPortRow = true;
else terms.add(r.labelKey); else terms.add(r.labelKey);
// "380/400/415VAC线"
// "线"/
if (containsChinese(r.value)) terms.add(r.value);
}); });
if (hasPortRow) terms.add('输出'); if (hasPortRow) terms.add('输出');
// / // /
@ -4099,6 +4110,7 @@ function ProductDetail({ product: p, onEdit, onDelete, categories, exportLang, o
const cat = (categories || []).find(c => c.id === p.category); const cat = (categories || []).find(c => c.id === p.category);
const showMachineVariant = isUpsCategory(cat) && p.machineVariant; const showMachineVariant = isUpsCategory(cat) && p.machineVariant;
const L = (key) => (exportLabels && exportLabels[key]) || key; const L = (key) => (exportLabels && exportLabels[key]) || key;
const V = (value) => (containsChinese(value) ? L(value) : value);
const langInfo = EXPORT_LANGUAGES.find(l => l.code === exportLang) || EXPORT_LANGUAGES[0]; const langInfo = EXPORT_LANGUAGES.find(l => l.code === exportLang) || EXPORT_LANGUAGES[0];
const exportRows = productExportRows(p, categories); const exportRows = productExportRows(p, categories);
return ( return (
@ -4155,7 +4167,7 @@ function ProductDetail({ product: p, onEdit, onDelete, categories, exportLang, o
{exportRows.map((r, i) => ( {exportRows.map((r, i) => (
<tr key={i}> <tr key={i}>
<td className="spec-label">{r.labelKey === '__port__' ? `${r.portType} ${L('输出')}` : L(r.labelKey)}</td> <td className="spec-label">{r.labelKey === '__port__' ? `${r.portType} ${L('输出')}` : L(r.labelKey)}</td>
<td>{r.value}</td> <td>{V(r.value)}</td>
</tr> </tr>
))} ))}
</tbody> </tbody>