refactor(intake): move empty sku item helper

This commit is contained in:
WuYongJie 2026-06-08 21:28:35 +08:00
parent 863e4a470d
commit 993675ef3f
2 changed files with 44 additions and 39 deletions

View File

@ -497,6 +497,7 @@ import {
} from "./reviewSheetHelpers";
import {
cloneSkuItemForNextRow,
createEmptySkuItem,
syncSkuItemsBrandPrefix,
} from "./skuBrandHelpers";
import {
@ -1513,45 +1514,6 @@ const EMPTY_FORM_VALUES: FormValues = {
craftDetail: "",
};
function createEmptySkuItem(): NonIntegratedSkuItem {
return {
id: buildNonIntegratedSkuId(),
skuSequence: 1,
batchNo: 1,
packageGroupId: "",
packageSuffix: "",
image: "",
imageName: "",
model: "",
skuCode: "",
setCount: "1",
specName: "",
barcode: "",
size: "",
color: "",
material: "",
boardMaterialType: "",
versionNo: "V01",
attributeCode: "",
drawingId: "",
installMethod: "",
executeStandard: "",
nationalStandardCompliant: "",
manufacturer: "",
manufacturerCode: "",
salesStatus: "",
tagMaterial: "",
model3dFileName: "",
model3dDataUrl: "",
model3dNodeOffsets: EMPTY_PREVIEW_NODE_OFFSET_MAP,
model3dNodeRotations: EMPTY_PREVIEW_NODE_ROTATION_MAP,
model3dNodeMaterialIds: {},
model3dUvConfig: null,
model3dPreviewNodes: [],
holePoints: [],
};
}
function normalizeSeriesDraftSkuSequence(
option: SeriesDraftSkuOption,
fallbackIndex: number,

View File

@ -3,6 +3,49 @@ import {
buildNonIntegratedSkuId,
type NonIntegratedSkuItem,
} from "./nonIntegratedStorage";
import {
EMPTY_PREVIEW_NODE_OFFSET_MAP,
EMPTY_PREVIEW_NODE_ROTATION_MAP,
} from "./previewState";
export function createEmptySkuItem(): NonIntegratedSkuItem {
return {
id: buildNonIntegratedSkuId(),
skuSequence: 1,
batchNo: 1,
packageGroupId: "",
packageSuffix: "",
image: "",
imageName: "",
model: "",
skuCode: "",
setCount: "1",
specName: "",
barcode: "",
size: "",
color: "",
material: "",
boardMaterialType: "",
versionNo: "V01",
attributeCode: "",
drawingId: "",
installMethod: "",
executeStandard: "",
nationalStandardCompliant: "",
manufacturer: "",
manufacturerCode: "",
salesStatus: "",
tagMaterial: "",
model3dFileName: "",
model3dDataUrl: "",
model3dNodeOffsets: EMPTY_PREVIEW_NODE_OFFSET_MAP,
model3dNodeRotations: EMPTY_PREVIEW_NODE_ROTATION_MAP,
model3dNodeMaterialIds: {},
model3dUvConfig: null,
model3dPreviewNodes: [],
holePoints: [],
};
}
export function syncSkuItemsBrandPrefix(
items: NonIntegratedSkuItem[],