Update App.jsx via upload script - 2026-09-20 10:41:25
This commit is contained in:
parent
fe609ee29c
commit
df96aca914
16
App.jsx
16
App.jsx
|
|
@ -624,7 +624,7 @@ function insertExtraSpecs(list, extraSpecs, labelProp) {
|
||||||
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 (isInverterCategory(cat) && ['太阳能混网逆变器', '并网/离网逆变器'].includes(p.type)) {
|
if (isInverterCategory(cat)) {
|
||||||
if (p.batteryType) rows.push({ labelKey: '电池类型', value: p.batteryType });
|
if (p.batteryType) rows.push({ labelKey: '电池类型', value: p.batteryType });
|
||||||
if (p.batteryVoltage) rows.push({ labelKey: '电池电压', value: p.batteryVoltage });
|
if (p.batteryVoltage) rows.push({ labelKey: '电池电压', value: p.batteryVoltage });
|
||||||
if (p.maxChargingVoltage) rows.push({ labelKey: '最大充电电压', value: p.maxChargingVoltage });
|
if (p.maxChargingVoltage) rows.push({ labelKey: '最大充电电压', value: p.maxChargingVoltage });
|
||||||
|
|
@ -706,7 +706,7 @@ function productExportRows(p, categories) {
|
||||||
if (p.noiseLevel) rows.push({ labelKey: '噪音', value: p.noiseLevel });
|
if (p.noiseLevel) rows.push({ labelKey: '噪音', value: p.noiseLevel });
|
||||||
if (p.dimensions) rows.push({ labelKey: '尺寸(mm)', value: p.dimensions });
|
if (p.dimensions) rows.push({ labelKey: '尺寸(mm)', value: p.dimensions });
|
||||||
if (p.netWeight) rows.push({ labelKey: '净重(kg)', value: p.netWeight });
|
if (p.netWeight) rows.push({ labelKey: '净重(kg)', value: p.netWeight });
|
||||||
} else if (isUpsCategory(cat) && ['机架式UPS', '在线式高频UPS', '工频UPS', '高频塔式UPS', '模块化UPS'].includes(p.type)) {
|
} else if (isUpsCategory(cat) && !['迷你UPS', '离线式UPS', '在线互动式UPS'].includes(p.type)) {
|
||||||
if (p.powerOrCapacity) rows.push({ labelKey: '容量', value: p.powerOrCapacity });
|
if (p.powerOrCapacity) rows.push({ labelKey: '容量', value: p.powerOrCapacity });
|
||||||
if (p.phase) rows.push({ labelKey: '相数', value: p.phase });
|
if (p.phase) rows.push({ labelKey: '相数', value: p.phase });
|
||||||
if (p.inputVoltage) rows.push({ labelKey: '输入电压', value: p.inputVoltage });
|
if (p.inputVoltage) rows.push({ labelKey: '输入电压', value: p.inputVoltage });
|
||||||
|
|
@ -978,7 +978,7 @@ 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 (isInverterCategory(cat) && ['太阳能混网逆变器', '并网/离网逆变器'].includes(p.type)) {
|
if (isInverterCategory(cat)) {
|
||||||
const items = [];
|
const items = [];
|
||||||
if (p.batteryType) items.push({ key: 'batterytype', label: '电池类型', value: p.batteryType });
|
if (p.batteryType) items.push({ key: 'batterytype', label: '电池类型', value: p.batteryType });
|
||||||
if (p.batteryVoltage) items.push({ key: 'batteryvoltage', label: '电池电压', value: p.batteryVoltage });
|
if (p.batteryVoltage) items.push({ key: 'batteryvoltage', label: '电池电压', value: p.batteryVoltage });
|
||||||
|
|
@ -1076,7 +1076,7 @@ function powerInfoItems(p, categories) {
|
||||||
if (p.container40hq) items.push({ key: 'container40hq', label: '40高柜装箱数量', value: p.container40hq });
|
if (p.container40hq) items.push({ key: 'container40hq', label: '40高柜装箱数量', value: p.container40hq });
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
if (isUpsCategory(cat) && ['机架式UPS', '在线式高频UPS', '工频UPS', '高频塔式UPS', '模块化UPS'].includes(p.type)) {
|
if (isUpsCategory(cat) && !['迷你UPS', '离线式UPS', '在线互动式UPS'].includes(p.type)) {
|
||||||
const items = [];
|
const items = [];
|
||||||
if (p.powerOrCapacity) items.push({ key: 'capacity', label: '容量', value: p.powerOrCapacity });
|
if (p.powerOrCapacity) items.push({ key: 'capacity', label: '容量', value: p.powerOrCapacity });
|
||||||
if (p.phase) items.push({ key: 'phase', label: '相数', value: p.phase });
|
if (p.phase) items.push({ key: 'phase', label: '相数', value: p.phase });
|
||||||
|
|
@ -5289,9 +5289,13 @@ function ProductForm({ draft, setDraft, onSave, onCancel, categories, onManage,
|
||||||
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 isOfflineOrLI = isUps && (draft.type === '离线式UPS' || draft.type === '在线互动式UPS');
|
||||||
const isRackLikeUps = isUps && ['机架式UPS', '在线式高频UPS', '工频UPS', '高频塔式UPS', '模块化UPS'].includes(draft.type);
|
// 排除法而不是白名单:UPS大类下除了迷你UPS、离线式/在线互动式这两类有自己独立字段集的小型UPS,
|
||||||
|
// 其他任何细分品类(机架式、在线式高频、工频、高频塔式、模块化,以及以后在"产品分组"里新增的
|
||||||
|
// 任何自定义细分品类)都自动落入这套完整的大功率UPS字段集,不用每次新增分类都要改代码。
|
||||||
|
const isRackLikeUps = isUps && !isMiniUps && !isOfflineOrLI;
|
||||||
const isBatterySystem = isBatteryCategory(cat) && draft.type === 'UPS配套锂电池系统';
|
const isBatterySystem = isBatteryCategory(cat) && draft.type === 'UPS配套锂电池系统';
|
||||||
const isSolarHybridInverter = isInverterCategory(cat) && ['太阳能混网逆变器', '并网/离网逆变器'].includes(draft.type);
|
// 光伏逆变器大类下只有这一套字段集,所以整个大类直接通用,同样不管以后新增什么细分品类名字
|
||||||
|
const isSolarHybridInverter = isInverterCategory(cat);
|
||||||
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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue