diff --git a/frontend/components/v2/config-panels/V2BomItemEditorConfigPanel.tsx b/frontend/components/v2/config-panels/V2BomItemEditorConfigPanel.tsx index 2b46dd81..ccc37664 100644 --- a/frontend/components/v2/config-panels/V2BomItemEditorConfigPanel.tsx +++ b/frontend/components/v2/config-panels/V2BomItemEditorConfigPanel.tsx @@ -140,19 +140,22 @@ export function V2BomItemEditorConfigPanel({ const currentTableName = screenTableName || propCurrentTableName; const config: BomItemEditorConfig = useMemo( - () => ({ - columns: [], - ...propConfig, - dataSource: { ...propConfig?.dataSource }, - features: { - showAddButton: true, - showDeleteButton: true, - inlineEdit: false, - showRowNumber: false, - maxDepth: 3, - ...propConfig?.features, - }, - }), + () => { + const { columns: propColumns, ...rest } = propConfig || {} as BomItemEditorConfig; + return { + ...rest, + columns: propColumns || [], + dataSource: { ...propConfig?.dataSource }, + features: { + showAddButton: true, + showDeleteButton: true, + inlineEdit: false, + showRowNumber: false, + maxDepth: 3, + ...propConfig?.features, + }, + }; + }, [propConfig], ); diff --git a/frontend/components/v2/config-panels/V2BomTreeConfigPanel.tsx b/frontend/components/v2/config-panels/V2BomTreeConfigPanel.tsx index 11979eb9..17f298d4 100644 --- a/frontend/components/v2/config-panels/V2BomTreeConfigPanel.tsx +++ b/frontend/components/v2/config-panels/V2BomTreeConfigPanel.tsx @@ -134,18 +134,21 @@ export function V2BomTreeConfigPanel({ const currentTableName = screenTableName || propCurrentTableName; const config: BomTreeConfig = useMemo( - () => ({ - columns: [], - ...propConfig, - dataSource: { ...propConfig?.dataSource }, - features: { - showExpandAll: true, - showHeader: true, - showQuantity: true, - showLossRate: true, - ...propConfig?.features, - }, - }), + () => { + const { columns: propColumns, ...rest } = propConfig || {} as BomTreeConfig; + return { + ...rest, + columns: propColumns || [], + dataSource: { ...propConfig?.dataSource }, + features: { + showExpandAll: true, + showHeader: true, + showQuantity: true, + showLossRate: true, + ...propConfig?.features, + }, + }; + }, [propConfig], );