Update App.jsx via upload script - 2026-07-27 10:09:52
This commit is contained in:
parent
b9bde850c0
commit
0ad7227ae6
104
App.jsx
104
App.jsx
|
|
@ -295,6 +295,16 @@ const TRANSLATION_DICTIONARY = {
|
||||||
'输出功率': { en: 'Output Power', fr: 'Puissance de sortie', ru: 'Выходная мощность', es: 'Potencia de salida', ar: 'طاقة الخرج' },
|
'输出功率': { en: 'Output Power', fr: 'Puissance de sortie', ru: 'Выходная мощность', es: 'Potencia de salida', ar: 'طاقة الخرج' },
|
||||||
'功率 / 容量': { en: 'Power / Capacity', fr: 'Puissance / Capacité', ru: 'Мощность / Ёмкость', es: 'Potencia / Capacidad', ar: 'الطاقة / السعة' },
|
'功率 / 容量': { en: 'Power / Capacity', fr: 'Puissance / Capacité', ru: 'Мощность / Ёмкость', es: 'Potencia / Capacidad', ar: 'الطاقة / السعة' },
|
||||||
'输入电压': { en: 'Input Voltage', fr: "Tension d'entrée", ru: 'Входное напряжение', es: 'Voltaje de entrada', ar: 'جهد الدخل' },
|
'输入电压': { en: 'Input Voltage', fr: "Tension d'entrée", ru: 'Входное напряжение', es: 'Voltaje de entrada', ar: 'جهد الدخل' },
|
||||||
|
'容量': { en: 'Capacity', fr: 'Capacité', ru: 'Ёмкость', es: 'Capacidad', ar: 'السعة' },
|
||||||
|
'输入电压范围': { en: 'Input Voltage Range', fr: "Plage de tension d'entrée", ru: 'Диапазон входного напряжения', es: 'Rango de voltaje de entrada', ar: 'نطاق جهد الدخل' },
|
||||||
|
'输入频率': { en: 'Input Frequency', fr: "Fréquence d'entrée", ru: 'Входная частота', es: 'Frecuencia de entrada', ar: 'تردد الدخل' },
|
||||||
|
'输出电压': { en: 'Output Voltage', fr: 'Tension de sortie', ru: 'Выходное напряжение', es: 'Voltaje de salida', ar: 'جهد الخرج' },
|
||||||
|
'输出电压范围': { en: 'Output Voltage Range', fr: 'Plage de tension de sortie', ru: 'Диапазон выходного напряжения', es: 'Rango de voltaje de salida', ar: 'نطاق جهد الخرج' },
|
||||||
|
'转换时间': { en: 'Transfer Time', fr: 'Temps de transfert', ru: 'Время переключения', es: 'Tiempo de transferencia', ar: 'وقت التحويل' },
|
||||||
|
'波形': { en: 'Waveform', fr: "Forme d'onde", ru: 'Форма волны', es: 'Forma de onda', ar: 'شكل الموجة' },
|
||||||
|
'电池电压': { en: 'Battery Voltage', fr: 'Tension de batterie', ru: 'Напряжение батареи', es: 'Voltaje de batería', ar: 'جهد البطارية' },
|
||||||
|
'电池型号和数量': { en: 'Battery Model & Qty', fr: 'Modèle et quantité de batterie', ru: 'Модель и кол-во батарей', es: 'Modelo y cantidad de batería', ar: 'طراز وعدد البطاريات' },
|
||||||
|
'充电电流': { en: 'Charge Current', fr: 'Courant de charge', ru: 'Ток зарядки', es: 'Corriente de carga', ar: 'تيار الشحن' },
|
||||||
'电压': { en: 'Voltage', fr: 'Tension', ru: 'Напряжение', es: 'Voltaje', ar: 'الجهد' },
|
'电压': { en: 'Voltage', fr: 'Tension', ru: 'Напряжение', es: 'Voltaje', ar: 'الجهد' },
|
||||||
'视载功率': { en: 'Rated Power (VA)', fr: 'Puissance nominale (VA)', ru: 'Номинальная мощность (ВА)', es: 'Potencia nominal (VA)', ar: 'الطاقة الاسمية (فولت أمبير)' },
|
'视载功率': { en: 'Rated Power (VA)', fr: 'Puissance nominale (VA)', ru: 'Номинальная мощность (ВА)', es: 'Potencia nominal (VA)', ar: 'الطاقة الاسمية (فولت أمبير)' },
|
||||||
'功率因数': { en: 'Power Factor', fr: 'Facteur de puissance', ru: 'Коэффициент мощности', es: 'Factor de potencia', ar: 'معامل القدرة' },
|
'功率因数': { en: 'Power Factor', fr: 'Facteur de puissance', ru: 'Коэффициент мощности', es: 'Factor de potencia', ar: 'معامل القدرة' },
|
||||||
|
|
@ -373,7 +383,21 @@ async function resolveExportTranslations(terms, lang) {
|
||||||
function productExportRows(p, categories) {
|
function productExportRows(p, categories) {
|
||||||
const cat = (categories || []).find(c => c.id === p.category);
|
const cat = (categories || []).find(c => c.id === p.category);
|
||||||
const rows = [];
|
const rows = [];
|
||||||
if (isUpsCategory(cat) && p.type !== '迷你UPS') {
|
if (isUpsCategory(cat) && (p.type === '离线式UPS' || p.type === '在线互动式UPS')) {
|
||||||
|
if (p.powerOrCapacity) rows.push({ labelKey: '容量', value: p.powerOrCapacity });
|
||||||
|
if (p.inputVoltage) rows.push({ labelKey: '输入电压', value: p.inputVoltage });
|
||||||
|
if (p.inputVoltageRange) rows.push({ labelKey: '输入电压范围', value: p.inputVoltageRange });
|
||||||
|
if (p.inputFrequency) rows.push({ labelKey: '输入频率', value: p.inputFrequency });
|
||||||
|
if (p.outputVoltage) rows.push({ labelKey: '输出电压', value: p.outputVoltage });
|
||||||
|
if (p.outputVoltageRange) rows.push({ labelKey: '输出电压范围', value: p.outputVoltageRange });
|
||||||
|
if (p.transferTime) rows.push({ labelKey: '转换时间', value: p.transferTime });
|
||||||
|
if (p.waveform) rows.push({ labelKey: '波形', value: p.waveform });
|
||||||
|
if (p.batteryVoltage) rows.push({ labelKey: '电池电压', value: p.batteryVoltage });
|
||||||
|
if (p.batterySpec) rows.push({ labelKey: '电池型号和数量', value: p.batterySpec });
|
||||||
|
if (p.chargeCurrent) rows.push({ labelKey: '充电电流', value: p.chargeCurrent });
|
||||||
|
if (p.dimensions) rows.push({ labelKey: '尺寸(mm)', value: p.dimensions });
|
||||||
|
if (p.netWeight) rows.push({ labelKey: '净重(kg)', value: p.netWeight });
|
||||||
|
} else if (isUpsCategory(cat) && p.type !== '迷你UPS') {
|
||||||
const maxKW = computeMaxPowerKW(p.ratedPower, p.ratedPowerUnit, p.powerFactor);
|
const maxKW = computeMaxPowerKW(p.ratedPower, p.ratedPowerUnit, p.powerFactor);
|
||||||
if (p.ratedPower) rows.push({ labelKey: '视载功率', value: `${p.ratedPower} ${p.ratedPowerUnit || 'VA'}` });
|
if (p.ratedPower) rows.push({ labelKey: '视载功率', value: `${p.ratedPower} ${p.ratedPowerUnit || 'VA'}` });
|
||||||
if (p.powerFactor) rows.push({ labelKey: '功率因数', value: p.powerFactor });
|
if (p.powerFactor) rows.push({ labelKey: '功率因数', value: p.powerFactor });
|
||||||
|
|
@ -424,15 +448,25 @@ const blankProduct = () => ({
|
||||||
id: 'p_' + Date.now() + '_' + Math.random().toString(36).slice(2, 7),
|
id: 'p_' + Date.now() + '_' + Math.random().toString(36).slice(2, 7),
|
||||||
name: '', extraNames: [], brand: '', category: '', type: '',
|
name: '', extraNames: [], brand: '', category: '', type: '',
|
||||||
machineVariant: '', // 标机 / 长机,仅UPS大类适用,独立于细分品类(迷你UPS固定为标机)
|
machineVariant: '', // 标机 / 长机,仅UPS大类适用,独立于细分品类(迷你UPS固定为标机)
|
||||||
powerOrCapacity: '', // 非UPS大类的功率/容量,或UPS大类下"迷你UPS"的输出功率
|
powerOrCapacity: '', // 非UPS大类的功率/容量;迷你UPS的输出功率;离线式/在线互动式UPS的容量(如400VA/240W)
|
||||||
ratedPower: '', ratedPowerUnit: 'VA', powerFactor: '', // UPS大类下除"迷你UPS"外的三段式功率
|
ratedPower: '', ratedPowerUnit: 'VA', powerFactor: '', // UPS大类下机架式/高频塔式/工频/模块化UPS的三段式功率
|
||||||
voltage: '', // 非迷你UPS:电压;迷你UPS:输入电压(默认 100~240Vac/50-60Hz,可修改)
|
voltage: '', // 非迷你UPS的通用大类:电压;迷你UPS:输入电压(默认 100~240Vac/50-60Hz,可修改)
|
||||||
outputPortCount: '', // 迷你UPS专属:输出口数量 1-6
|
outputPortCount: '', // 迷你UPS专属:输出口数量 1-6
|
||||||
outputPortTypes: [], // 迷你UPS专属:输出口类型(多选)
|
outputPortTypes: [], // 迷你UPS专属:输出口类型(多选)
|
||||||
outputPorts: [], // 迷你UPS专属:每个已选输出口类型对应的输出电压/电流,如 [{type:'USB', voltage:'5Vdc', current:'3.0A'}]
|
outputPorts: [], // 迷你UPS专属:每个已选输出口类型对应的输出电压/电流,如 [{type:'USB', voltage:'5Vdc', current:'3.0A'}]
|
||||||
batterySpec: '', // 迷你UPS专属:电池数量和容量,如 "5000mAh*4"
|
// 离线式UPS / 在线互动式UPS 专属:输入输出参数(这两个细分品类共用同一套字段)
|
||||||
dimensions: '', // 迷你UPS专属:尺寸(mm),如 "210*130*40"
|
inputVoltage: '', // 输入电压,如 "110V/120Vac or 220V/230Vac"
|
||||||
netWeight: '', // 迷你UPS专属:净重(kg)
|
inputVoltageRange: '', // 输入电压范围,如 "81-134Vac/89-145Vac or 162-268Vac/170-280Vac"
|
||||||
|
inputFrequency: '', // 输入频率,如 "50/60Hz(自动识别)"
|
||||||
|
outputVoltage: '', // 输出电压,如 "110V/120Vac or 220V/230Vac"
|
||||||
|
outputVoltageRange: '', // 输出电压范围,如 "±10%"
|
||||||
|
transferTime: '', // 转换时间,如 "Typical 2-8ms, 13ms max"
|
||||||
|
waveform: '', // 波形(电池模式),如 "Simulated Sine Wave" / "Sine Wave"
|
||||||
|
batteryVoltage: '', // 电池电压,如 "12V" / "24V"
|
||||||
|
chargeCurrent: '', // 充电电流,如 "1A"
|
||||||
|
batterySpec: '', // 电池型号和数量,如 "12V4.5AH*1"(迷你UPS/离线式/在线互动式UPS共用)
|
||||||
|
dimensions: '', // 尺寸(mm)(迷你UPS/离线式/在线互动式UPS共用)
|
||||||
|
netWeight: '', // 净重(kg)(迷你UPS/离线式/在线互动式UPS共用)
|
||||||
productImageFileName: '', productImageOriginalName: '', // 产品主图,导出多语言PDF时展示
|
productImageFileName: '', productImageOriginalName: '', // 产品主图,导出多语言PDF时展示
|
||||||
sellingPoints: '', // 对客卖点/主要特点,每行一条,专门给客户看的(和下面的costPrice/notes内部信息彻底分开,不会一起导出)
|
sellingPoints: '', // 对客卖点/主要特点,每行一条,专门给客户看的(和下面的costPrice/notes内部信息彻底分开,不会一起导出)
|
||||||
costPrice: '', notes: '',
|
costPrice: '', notes: '',
|
||||||
|
|
@ -452,6 +486,23 @@ function computeMaxPowerKW(ratedPower, ratedPowerUnit, powerFactor) {
|
||||||
}
|
}
|
||||||
function powerInfoItems(p, categories) {
|
function powerInfoItems(p, categories) {
|
||||||
const cat = (categories || []).find(c => c.id === p.category);
|
const cat = (categories || []).find(c => c.id === p.category);
|
||||||
|
if (isUpsCategory(cat) && (p.type === '离线式UPS' || p.type === '在线互动式UPS')) {
|
||||||
|
const items = [];
|
||||||
|
if (p.powerOrCapacity) items.push({ key: 'capacity', label: '容量', value: p.powerOrCapacity });
|
||||||
|
if (p.inputVoltage) items.push({ key: 'inputvoltage', label: '输入电压', value: p.inputVoltage });
|
||||||
|
if (p.inputVoltageRange) items.push({ key: 'inputvoltagerange', label: '输入电压范围', value: p.inputVoltageRange });
|
||||||
|
if (p.inputFrequency) items.push({ key: 'inputfreq', label: '输入频率', value: p.inputFrequency });
|
||||||
|
if (p.outputVoltage) items.push({ key: 'outputvoltage', label: '输出电压', value: p.outputVoltage });
|
||||||
|
if (p.outputVoltageRange) items.push({ key: 'outputvoltagerange', label: '输出电压范围', value: p.outputVoltageRange });
|
||||||
|
if (p.transferTime) items.push({ key: 'transfertime', label: '转换时间', value: p.transferTime });
|
||||||
|
if (p.waveform) items.push({ key: 'waveform', label: '波形', value: p.waveform });
|
||||||
|
if (p.batteryVoltage) items.push({ key: 'batteryvoltage', label: '电池电压', value: p.batteryVoltage });
|
||||||
|
if (p.batterySpec) items.push({ key: 'batteryspec', label: '电池型号和数量', value: p.batterySpec });
|
||||||
|
if (p.chargeCurrent) items.push({ key: 'chargecurrent', label: '充电电流', value: p.chargeCurrent });
|
||||||
|
if (p.dimensions) items.push({ key: 'dim', label: '尺寸(mm)', value: p.dimensions });
|
||||||
|
if (p.netWeight) items.push({ key: 'weight', label: '净重(kg)', value: p.netWeight });
|
||||||
|
return items;
|
||||||
|
}
|
||||||
if (isUpsCategory(cat) && p.type !== '迷你UPS') {
|
if (isUpsCategory(cat) && p.type !== '迷你UPS') {
|
||||||
const maxKW = computeMaxPowerKW(p.ratedPower, p.ratedPowerUnit, p.powerFactor);
|
const maxKW = computeMaxPowerKW(p.ratedPower, p.ratedPowerUnit, p.powerFactor);
|
||||||
return [
|
return [
|
||||||
|
|
@ -1848,6 +1899,10 @@ function MainApp({ username, onLogout }) {
|
||||||
outputPortCount: p.outputPortCount || '',
|
outputPortCount: p.outputPortCount || '',
|
||||||
outputPortTypes: Array.isArray(p.outputPortTypes) ? p.outputPortTypes : [],
|
outputPortTypes: Array.isArray(p.outputPortTypes) ? p.outputPortTypes : [],
|
||||||
outputPorts: Array.isArray(p.outputPorts) ? p.outputPorts : [],
|
outputPorts: Array.isArray(p.outputPorts) ? p.outputPorts : [],
|
||||||
|
inputVoltage: p.inputVoltage || '', inputVoltageRange: p.inputVoltageRange || '', inputFrequency: p.inputFrequency || '',
|
||||||
|
outputVoltage: p.outputVoltage || '', outputVoltageRange: p.outputVoltageRange || '',
|
||||||
|
transferTime: p.transferTime || '', waveform: p.waveform || '',
|
||||||
|
batteryVoltage: p.batteryVoltage || '', chargeCurrent: p.chargeCurrent || '',
|
||||||
batterySpec: p.batterySpec || '', dimensions: p.dimensions || '', netWeight: p.netWeight || '', notes: p.notes || '',
|
batterySpec: p.batterySpec || '', dimensions: p.dimensions || '', netWeight: p.netWeight || '', notes: p.notes || '',
|
||||||
}));
|
}));
|
||||||
setAiImportDrafts(drafts);
|
setAiImportDrafts(drafts);
|
||||||
|
|
@ -1890,6 +1945,10 @@ function MainApp({ username, onLogout }) {
|
||||||
machineVariant: d.machineVariant || '', powerOrCapacity: d.powerOrCapacity || '', voltage: d.voltage || '',
|
machineVariant: d.machineVariant || '', powerOrCapacity: d.powerOrCapacity || '', voltage: d.voltage || '',
|
||||||
ratedPower: d.ratedPower || '', ratedPowerUnit: d.ratedPowerUnit || 'VA', powerFactor: d.powerFactor || '',
|
ratedPower: d.ratedPower || '', ratedPowerUnit: d.ratedPowerUnit || 'VA', powerFactor: d.powerFactor || '',
|
||||||
outputPortCount: d.outputPortCount || '', outputPortTypes: d.outputPortTypes || [], outputPorts: d.outputPorts || [],
|
outputPortCount: d.outputPortCount || '', outputPortTypes: d.outputPortTypes || [], outputPorts: d.outputPorts || [],
|
||||||
|
inputVoltage: d.inputVoltage || '', inputVoltageRange: d.inputVoltageRange || '', inputFrequency: d.inputFrequency || '',
|
||||||
|
outputVoltage: d.outputVoltage || '', outputVoltageRange: d.outputVoltageRange || '',
|
||||||
|
transferTime: d.transferTime || '', waveform: d.waveform || '',
|
||||||
|
batteryVoltage: d.batteryVoltage || '', chargeCurrent: d.chargeCurrent || '',
|
||||||
batterySpec: d.batterySpec || '', dimensions: d.dimensions || '', netWeight: d.netWeight || '', notes: d.notes || '',
|
batterySpec: d.batterySpec || '', dimensions: d.dimensions || '', netWeight: d.netWeight || '', notes: d.notes || '',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -3462,6 +3521,7 @@ function ProductForm({ draft, setDraft, onSave, onCancel, categories, onManage,
|
||||||
const typeOptions = cat ? cat.types : [];
|
const typeOptions = cat ? cat.types : [];
|
||||||
const isUps = isUpsCategory(cat);
|
const isUps = isUpsCategory(cat);
|
||||||
const isMiniUps = isUps && draft.type === '迷你UPS';
|
const isMiniUps = isUps && draft.type === '迷你UPS';
|
||||||
|
const isOfflineOrLI = isUps && (draft.type === '离线式UPS' || draft.type === '在线互动式UPS');
|
||||||
const maxKW = computeMaxPowerKW(draft.ratedPower, draft.ratedPowerUnit, draft.powerFactor);
|
const maxKW = computeMaxPowerKW(draft.ratedPower, draft.ratedPowerUnit, draft.powerFactor);
|
||||||
const extraNames = draft.extraNames || [];
|
const extraNames = draft.extraNames || [];
|
||||||
const [imageUploading, setImageUploading] = useState(false);
|
const [imageUploading, setImageUploading] = useState(false);
|
||||||
|
|
@ -3608,7 +3668,35 @@ function ProductForm({ draft, setDraft, onSave, onCancel, categories, onManage,
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isUps && !isMiniUps ? (
|
{isUps && isOfflineOrLI ? (
|
||||||
|
<>
|
||||||
|
<div className="grid-2">
|
||||||
|
<div className="field"><span className="field-label">容量</span><input className="input" value={draft.powerOrCapacity} onChange={e => set({ powerOrCapacity: e.target.value })} placeholder="如:400VA/240W" /></div>
|
||||||
|
<div className="field"><span className="field-label">输入电压</span><input className="input" value={draft.inputVoltage} onChange={e => set({ inputVoltage: e.target.value })} placeholder="如:110V/120Vac or 220V/230Vac" /></div>
|
||||||
|
</div>
|
||||||
|
<div className="grid-2">
|
||||||
|
<div className="field"><span className="field-label">输入电压范围</span><input className="input" value={draft.inputVoltageRange} onChange={e => set({ inputVoltageRange: e.target.value })} placeholder="如:162-268Vac/170-280Vac" /></div>
|
||||||
|
<div className="field"><span className="field-label">输入频率</span><input className="input" value={draft.inputFrequency} onChange={e => set({ inputFrequency: e.target.value })} placeholder="如:50/60Hz(自动识别)" /></div>
|
||||||
|
</div>
|
||||||
|
<div className="grid-2">
|
||||||
|
<div className="field"><span className="field-label">输出电压</span><input className="input" value={draft.outputVoltage} onChange={e => set({ outputVoltage: e.target.value })} placeholder="如:110V/120Vac or 220V/230Vac" /></div>
|
||||||
|
<div className="field"><span className="field-label">输出电压范围</span><input className="input" value={draft.outputVoltageRange} onChange={e => set({ outputVoltageRange: e.target.value })} placeholder="如:±10%" /></div>
|
||||||
|
</div>
|
||||||
|
<div className="grid-2">
|
||||||
|
<div className="field"><span className="field-label">转换时间</span><input className="input" value={draft.transferTime} onChange={e => set({ transferTime: e.target.value })} placeholder="如:Typical 2-8ms, 13ms max" /></div>
|
||||||
|
<div className="field"><span className="field-label">波形(电池模式)</span><input className="input" value={draft.waveform} onChange={e => set({ waveform: e.target.value })} placeholder="如:Simulated Sine Wave" /></div>
|
||||||
|
</div>
|
||||||
|
<div className="grid-2">
|
||||||
|
<div className="field"><span className="field-label">电池电压</span><input className="input" value={draft.batteryVoltage} onChange={e => set({ batteryVoltage: e.target.value })} placeholder="如:12V / 24V" /></div>
|
||||||
|
<div className="field"><span className="field-label">充电电流</span><input className="input" value={draft.chargeCurrent} onChange={e => set({ chargeCurrent: e.target.value })} placeholder="如:1A" /></div>
|
||||||
|
</div>
|
||||||
|
<div className="grid-2">
|
||||||
|
<div className="field"><span className="field-label">电池型号和数量</span><input className="input" value={draft.batterySpec} onChange={e => set({ batterySpec: spaceToAsterisk(e.target.value) })} placeholder="如:12V4.5AH*1" /></div>
|
||||||
|
<div className="field"><span className="field-label">尺寸(mm)</span><input className="input" value={draft.dimensions} onChange={e => set({ dimensions: spaceToAsterisk(e.target.value) })} placeholder="如:315*100*143" /></div>
|
||||||
|
</div>
|
||||||
|
<div className="field"><span className="field-label">净重(kg)</span><input className="input" value={draft.netWeight} onChange={e => set({ netWeight: e.target.value })} placeholder="如:4" /></div>
|
||||||
|
</>
|
||||||
|
) : isUps && !isMiniUps ? (
|
||||||
<div className="grid-2">
|
<div className="grid-2">
|
||||||
<div className="field">
|
<div className="field">
|
||||||
<span className="field-label">视载功率</span>
|
<span className="field-label">视载功率</span>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue