diff --git a/frontend/components/v2/config-panels/V2ItemRoutingConfigPanel.tsx b/frontend/components/v2/config-panels/V2ItemRoutingConfigPanel.tsx index f7855440..0ec5a29f 100644 --- a/frontend/components/v2/config-panels/V2ItemRoutingConfigPanel.tsx +++ b/frontend/components/v2/config-panels/V2ItemRoutingConfigPanel.tsx @@ -292,16 +292,34 @@ export const V2ItemRoutingConfigPanel: React.FC = loadTables(); }, []); + const dispatchConfigEvent = (newConfig: Partial) => { + if (typeof window !== "undefined") { + window.dispatchEvent( + new CustomEvent("componentConfigChanged", { + detail: { config: { ...config, ...newConfig } }, + }) + ); + } + }; + const update = (partial: Partial) => { - onChange({ ...configProp, ...partial }); + const merged = { ...configProp, ...partial }; + onChange(merged); + dispatchConfigEvent(partial); }; const updateDataSource = (field: string, value: string) => { - update({ dataSource: { ...config.dataSource, [field]: value } }); + const newDataSource = { ...config.dataSource, [field]: value }; + const partial = { dataSource: newDataSource }; + onChange({ ...configProp, ...partial }); + dispatchConfigEvent(partial); }; const updateModals = (field: string, value?: number) => { - update({ modals: { ...config.modals, [field]: value } }); + const newModals = { ...config.modals, [field]: value }; + const partial = { modals: newModals }; + onChange({ ...configProp, ...partial }); + dispatchConfigEvent(partial); }; // 공정 컬럼 관리