From 47bbfd9f62f285aa9b26d8e15cb982f042614554 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 27 Oct 2026 14:59:22 +0800 Subject: [PATCH] Update App.jsx via upload script - 2026-10-27 14:59:18 --- App.jsx | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/App.jsx b/App.jsx index c91ee33..d35b0e4 100644 --- a/App.jsx +++ b/App.jsx @@ -2366,6 +2366,7 @@ function MainApp({ username, onLogout }) { const [aiImportHintCategory, setAiImportHintCategory] = useState(''); const [aiImportHintBrand, setAiImportHintBrand] = useState(''); const [aiImportHintType, setAiImportHintType] = useState(''); + const [aiImportHintExtraTypes, setAiImportHintExtraTypes] = useState([]); // 这批产品同时属于的其他细分品类(多选) const [aiImportTruncatedWarning, setAiImportTruncatedWarning] = useState(false); const [exportOpen, setExportOpen] = useState(false); @@ -3089,7 +3090,7 @@ function MainApp({ username, onLogout }) { function openAiImport() { setAiImportOpen(true); setAiImportDrafts(null); setAiImportError(''); - setAiImportHintCategory(''); setAiImportHintBrand(''); setAiImportHintType(''); + setAiImportHintCategory(''); setAiImportHintBrand(''); setAiImportHintType(''); setAiImportHintExtraTypes([]); setAiImportTruncatedWarning(false); } function closeAiImport() { setAiImportOpen(false); setAiImportDrafts(null); setAiImportError(''); setAiImportBusy(false); } @@ -3111,6 +3112,7 @@ function MainApp({ username, onLogout }) { _localId: 'aidraft_' + i + '_' + Math.random().toString(36).slice(2, 6), include: true, name: p.name || '', brand: p.brand || '', category: p.category || '', type: p.type || '', + extraTypes: aiImportHintExtraTypes.filter(t => t && t !== (p.type || '')), machineVariant: p.machineVariant || '', powerOrCapacity: p.powerOrCapacity || '', voltage: p.voltage || '', ratedPower: p.ratedPower || '', ratedPowerUnit: p.ratedPowerUnit || 'VA', powerFactor: p.powerFactor || '', outputPortCount: p.outputPortCount || '', @@ -3191,6 +3193,7 @@ function MainApp({ username, onLogout }) { if (cat) { if (d.brand && !cat.brands.includes(d.brand)) cat.brands.push(d.brand); if (d.type && !cat.types.includes(d.type)) cat.types.push(d.type); + for (const t of d.extraTypes || []) if (t && !cat.types.includes(t)) cat.types.push(t); } return { ...d, categoryId: cat ? cat.id : '' }; }); @@ -3201,6 +3204,7 @@ function MainApp({ username, onLogout }) { ...blankProduct(), id: 'p_' + Date.now() + '_' + idx + '_' + Math.random().toString(36).slice(2, 7), name: d.name.trim(), brand: d.brand || '', category: d.categoryId || '', type: d.type || '', + extraTypes: (d.extraTypes || []).filter(t => t && t !== d.type), machineVariant: d.machineVariant || '', powerOrCapacity: d.powerOrCapacity || '', voltage: d.voltage || '', ratedPower: d.ratedPower || '', ratedPowerUnit: d.ratedPowerUnit || 'VA', powerFactor: d.powerFactor || '', outputPortCount: d.outputPortCount || '', outputPortTypes: d.outputPortTypes || [], outputPorts: d.outputPorts || [], @@ -4578,6 +4582,27 @@ function MainApp({ username, onLogout }) { {(productCategories.find(c => c.name === aiImportHintCategory.trim())?.types || []).map(t =>