From 6f4c9b7fdd80615dc5e712f0ecef96031390649d Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Wed, 7 Jan 2026 17:42:40 +0900 Subject: [PATCH] =?UTF-8?q?ix:=20=EB=B6=80=EB=AA=A8-=EC=9E=90=EC=8B=9D=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=A0=84?= =?UTF-8?q?=EB=8B=AC=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20=EB=B0=8F?= =?UTF-8?q?=20=EB=AF=B8=EC=82=AC=EC=9A=A9=20multiRowSave=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=A0=9C=EA=B1=B0=20InteractiveScreenViewerDynamic?= =?UTF-8?q?:=20=EC=83=9D=EC=84=B1=20=EB=AA=A8=EB=93=9C=EC=97=90=EC=84=9C?= =?UTF-8?q?=20formData=EB=A5=BC=20initialData=EB=A1=9C=20=EC=A0=84?= =?UTF-8?q?=EB=8B=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20Uni?= =?UTF-8?q?versalFormModal:=20saveMultipleRows=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=EB=B0=8F=20multiRowSave=20=EA=B4=80=EB=A0=A8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=A0=84=EC=B2=B4=20=EC=A0=9C=EA=B1=B0=20types/con?= =?UTF-8?q?fig:=20MultiRowSaveConfig=20=EC=9D=B8=ED=84=B0=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=20=EB=B0=8F=20=EA=B8=B0=EB=B3=B8=EA=B0=92=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20FieldDetailSettingsModal:=20receiveFromPar?= =?UTF-8?q?ent=20UI=20=EC=98=B5=EC=85=98=20=EC=A0=9C=EA=B1=B0=20SaveSettin?= =?UTF-8?q?gsModal:=20=EC=A0=80=EC=9E=A5=20=EB=AA=A8=EB=93=9C=20=EC=84=A4?= =?UTF-8?q?=EB=AA=85=20=EA=B0=9C=EC=84=A0=20DB:=20multiRowSave.enabled=3Dt?= =?UTF-8?q?rue=EC=9D=B8=20=ED=99=94=EB=A9=B4=203=EA=B0=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/InteractiveScreenViewerDynamic.tsx | 2 +- .../SplitPanelLayout2Component.tsx | 1 - .../UniversalFormModalComponent.tsx | 130 +----------------- .../UniversalFormModalConfigPanel.tsx | 1 - .../components/universal-form-modal/config.ts | 9 -- .../components/universal-form-modal/index.ts | 21 ++- .../modals/FieldDetailSettingsModal.tsx | 57 -------- .../modals/SaveSettingsModal.tsx | 32 +++-- .../components/universal-form-modal/types.ts | 16 --- 9 files changed, 40 insertions(+), 229 deletions(-) diff --git a/frontend/components/screen/InteractiveScreenViewerDynamic.tsx b/frontend/components/screen/InteractiveScreenViewerDynamic.tsx index 1dfdba14..d906a404 100644 --- a/frontend/components/screen/InteractiveScreenViewerDynamic.tsx +++ b/frontend/components/screen/InteractiveScreenViewerDynamic.tsx @@ -365,7 +365,7 @@ export const InteractiveScreenViewerDynamic: React.FC 0) ? originalData : formData} // ๐Ÿ†• originalData๊ฐ€ ์žˆ์œผ๋ฉด ์‚ฌ์šฉ, ์—†์œผ๋ฉด formData ์‚ฌ์šฉ (์ƒ์„ฑ ๋ชจ๋“œ์—์„œ ๋ถ€๋ชจ ๋ฐ์ดํ„ฐ ์ „๋‹ฌ) onFormDataChange={handleFormDataChange} screenId={screenInfo?.id} tableName={screenInfo?.tableName} diff --git a/frontend/lib/registry/components/split-panel-layout2/SplitPanelLayout2Component.tsx b/frontend/lib/registry/components/split-panel-layout2/SplitPanelLayout2Component.tsx index 6e38e86e..a06c046f 100644 --- a/frontend/lib/registry/components/split-panel-layout2/SplitPanelLayout2Component.tsx +++ b/frontend/lib/registry/components/split-panel-layout2/SplitPanelLayout2Component.tsx @@ -654,7 +654,6 @@ export const SplitPanelLayout2Component: React.FC DynamicComponentRenderer์—์„œ ์ „๋‹ฌ๋œ prop const initialData = propInitialData || _initialData; + // ์„ค์ • ๋ณ‘ํ•ฉ const config: UniversalFormModalConfig = useMemo(() => { const componentConfig = component?.config || {}; @@ -155,11 +156,6 @@ export function UniversalFormModalComponent({ ...defaultConfig.saveConfig, ...propConfig?.saveConfig, ...componentConfig.saveConfig, - multiRowSave: { - ...defaultConfig.saveConfig.multiRowSave, - ...propConfig?.saveConfig?.multiRowSave, - ...componentConfig.saveConfig?.multiRowSave, - }, afterSave: { ...defaultConfig.saveConfig.afterSave, ...propConfig?.saveConfig?.afterSave, @@ -1504,118 +1500,6 @@ export function UniversalFormModalComponent({ formData, ]); - // ๋‹ค์ค‘ ํ–‰ ์ €์žฅ (๊ฒธ์ง ๋“ฑ) - const saveMultipleRows = useCallback(async () => { - const { multiRowSave } = config.saveConfig; - if (!multiRowSave) return; - - let { commonFields = [], repeatSectionId = "" } = multiRowSave; - const { typeColumn, mainTypeValue, subTypeValue, mainSectionFields = [] } = multiRowSave; - - // ๊ณตํ†ต ํ•„๋“œ๊ฐ€ ์„ค์ •๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ, ๊ธฐ๋ณธ์ •๋ณด ์„น์…˜์˜ ๋ชจ๋“  ํ•„๋“œ๋ฅผ ๊ณตํ†ต ํ•„๋“œ๋กœ ์‚ฌ์šฉ - if (commonFields.length === 0) { - const nonRepeatableSections = config.sections.filter((s) => !s.repeatable); - commonFields = nonRepeatableSections.flatMap((s) => (s.fields || []).map((f) => f.columnName)); - } - - // ๋ฐ˜๋ณต ์„น์…˜ ID๊ฐ€ ์„ค์ •๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ, ์ฒซ ๋ฒˆ์งธ ๋ฐ˜๋ณต ์„น์…˜ ์‚ฌ์šฉ - if (!repeatSectionId) { - const repeatableSection = config.sections.find((s) => s.repeatable); - if (repeatableSection) { - repeatSectionId = repeatableSection.id; - } - } - - // ๋ฐ˜๋ณต ์„น์…˜ ๋ฐ์ดํ„ฐ - const repeatItems = repeatSections[repeatSectionId] || []; - - // ์ €์žฅํ•  ํ–‰๋“ค ์ƒ์„ฑ - const rowsToSave: any[] = []; - - // ๊ณตํ†ต ๋ฐ์ดํ„ฐ (๋ชจ๋“  ํ–‰์— ์ ์šฉ) - const commonData: any = {}; - commonFields.forEach((fieldName) => { - if (formData[fieldName] !== undefined) { - commonData[fieldName] = formData[fieldName]; - } - }); - - // ๋ฉ”์ธ ์„น์…˜ ํ•„๋“œ ๋ฐ์ดํ„ฐ (๋ฉ”์ธ ํ–‰์—๋งŒ ์ ์šฉ๋˜๋Š” ๋ถ€์„œ/์ง๊ธ‰ ๋“ฑ) - const mainSectionData: any = {}; - mainSectionFields.forEach((fieldName) => { - if (formData[fieldName] !== undefined) { - mainSectionData[fieldName] = formData[fieldName]; - } - }); - - // ๋ฉ”์ธ ํ–‰ (๊ณตํ†ต ๋ฐ์ดํ„ฐ + ๋ฉ”์ธ ์„น์…˜ ํ•„๋“œ) - const mainRow: any = { ...commonData, ...mainSectionData }; - if (typeColumn) { - mainRow[typeColumn] = mainTypeValue || "main"; - } - rowsToSave.push(mainRow); - - // ๋ฐ˜๋ณต ์„น์…˜ ํ–‰๋“ค (๊ณตํ†ต ๋ฐ์ดํ„ฐ + ๋ฐ˜๋ณต ์„น์…˜ ํ•„๋“œ) - for (const item of repeatItems) { - const subRow: any = { ...commonData }; - - // ๋ฐ˜๋ณต ์„น์…˜์˜ ํ•„๋“œ ๊ฐ’ ์ถ”๊ฐ€ - const repeatSection = config.sections.find((s) => s.id === repeatSectionId); - (repeatSection?.fields || []).forEach((field) => { - if (item[field.columnName] !== undefined) { - subRow[field.columnName] = item[field.columnName]; - } - }); - - if (typeColumn) { - subRow[typeColumn] = subTypeValue || "concurrent"; - } - - rowsToSave.push(subRow); - } - - // ์ €์žฅ ์‹œ์  ์ฑ„๋ฒˆ๊ทœ์น™ ์ฒ˜๋ฆฌ (๋ฉ”์ธ ํ–‰๋งŒ) - for (const section of config.sections) { - if (section.repeatable || section.type === "table") continue; - - for (const field of section.fields || []) { - if (field.numberingRule?.enabled && field.numberingRule?.ruleId) { - // generateOnSave ๋˜๋Š” generateOnOpen ๋ชจ๋‘ ์ €์žฅ ์‹œ ์‹ค์ œ ์ˆœ๋ฒˆ ํ• ๋‹น - const shouldAllocate = field.numberingRule.generateOnSave || field.numberingRule.generateOnOpen; - if (shouldAllocate) { - const response = await allocateNumberingCode(field.numberingRule.ruleId); - if (response.success && response.data?.generatedCode) { - // ๋ชจ๋“  ํ–‰์— ๋™์ผํ•œ ์ฑ„๋ฒˆ ๊ฐ’ ์ ์šฉ (๊ณตํ†ต ํ•„๋“œ์ธ ๊ฒฝ์šฐ) - if (commonFields.includes(field.columnName)) { - rowsToSave.forEach((row) => { - row[field.columnName] = response.data?.generatedCode; - }); - } else { - rowsToSave[0][field.columnName] = response.data?.generatedCode; - } - } - } - } - } - } - - // ๋ชจ๋“  ํ–‰ ์ €์žฅ - for (let i = 0; i < rowsToSave.length; i++) { - const row = rowsToSave[i]; - - // ๋นˆ ๊ฐ์ฒด ์ฒดํฌ - if (Object.keys(row).length === 0) { - continue; - } - - const response = await apiClient.post(`/table-management/tables/${config.saveConfig.tableName}/add`, row); - - if (!response.data?.success) { - throw new Error(response.data?.message || `${i + 1}๋ฒˆ์งธ ํ–‰ ์ €์žฅ ์‹คํŒจ`); - } - } - }, [config.sections, config.saveConfig, formData, repeatSections]); - // ๋‹ค์ค‘ ํ…Œ์ด๋ธ” ์ €์žฅ (๋ฒ”์šฉ) const saveWithMultiTable = useCallback(async () => { const { customApiSave } = config.saveConfig; @@ -1863,16 +1747,13 @@ export function UniversalFormModalComponent({ setSaving(true); try { - const { multiRowSave, customApiSave } = config.saveConfig; + const { customApiSave } = config.saveConfig; - // ์ปค์Šคํ…€ API ์ €์žฅ ๋ชจ๋“œ + // ์ปค์Šคํ…€ API ์ €์žฅ ๋ชจ๋“œ (๋‹ค์ค‘ ํ…Œ์ด๋ธ”) if (customApiSave?.enabled) { await saveWithCustomApi(); - } else if (multiRowSave?.enabled) { - // ๋‹ค์ค‘ ํ–‰ ์ €์žฅ - await saveMultipleRows(); } else { - // ๋‹จ์ผ ํ–‰ ์ €์žฅ + // ๋‹จ์ผ ํ…Œ์ด๋ธ” ์ €์žฅ await saveSingleRow(); } @@ -1886,7 +1767,7 @@ export function UniversalFormModalComponent({ } // onSave ์ฝœ๋ฐฑ์€ ์ €์žฅ ์™„๋ฃŒ ์•Œ๋ฆผ์šฉ์œผ๋กœ๋งŒ ์‚ฌ์šฉ - // ์‹ค์ œ ์ €์žฅ์€ ์ด๋ฏธ ์œ„์—์„œ ์™„๋ฃŒ๋จ (saveSingleRow ๋˜๋Š” saveMultipleRows) + // ์‹ค์ œ ์ €์žฅ์€ ์ด๋ฏธ ์œ„์—์„œ ์™„๋ฃŒ๋จ // EditModal ๋“ฑ ๋ถ€๋ชจ ์ปดํฌ๋„ŒํŠธ์˜ ์ €์žฅ ๋กœ์ง์ด ๋‹ค์‹œ ์‹คํ–‰๋˜์ง€ ์•Š๋„๋ก // _saveCompleted ํ”Œ๋ž˜๊ทธ๋ฅผ ํฌํ•จํ•˜์—ฌ ์ „๋‹ฌ if (onSave) { @@ -1916,7 +1797,6 @@ export function UniversalFormModalComponent({ onSave, validateRequiredFields, saveSingleRow, - saveMultipleRows, saveWithCustomApi, ]); diff --git a/frontend/lib/registry/components/universal-form-modal/UniversalFormModalConfigPanel.tsx b/frontend/lib/registry/components/universal-form-modal/UniversalFormModalConfigPanel.tsx index 7186ca7e..b060c4b4 100644 --- a/frontend/lib/registry/components/universal-form-modal/UniversalFormModalConfigPanel.tsx +++ b/frontend/lib/registry/components/universal-form-modal/UniversalFormModalConfigPanel.tsx @@ -885,7 +885,6 @@ export function UniversalFormModalConfigPanel({ tableColumns={tableColumns} numberingRules={numberingRules} onLoadTableColumns={loadTableColumns} - availableParentFields={availableParentFields} targetTableName={config.saveConfig?.tableName} targetTableColumns={config.saveConfig?.tableName ? tableColumns[config.saveConfig.tableName] || [] : []} /> diff --git a/frontend/lib/registry/components/universal-form-modal/config.ts b/frontend/lib/registry/components/universal-form-modal/config.ts index 41c18043..78b1583e 100644 --- a/frontend/lib/registry/components/universal-form-modal/config.ts +++ b/frontend/lib/registry/components/universal-form-modal/config.ts @@ -45,15 +45,6 @@ export const defaultConfig: UniversalFormModalConfig = { saveConfig: { tableName: "", primaryKeyColumn: "id", - multiRowSave: { - enabled: false, - commonFields: [], - repeatSectionId: "", - typeColumn: "", - mainTypeValue: "main", - subTypeValue: "concurrent", - mainSectionFields: [], - }, afterSave: { closeModal: true, refreshParent: true, diff --git a/frontend/lib/registry/components/universal-form-modal/index.ts b/frontend/lib/registry/components/universal-form-modal/index.ts index f98bf438..40af1dfc 100644 --- a/frontend/lib/registry/components/universal-form-modal/index.ts +++ b/frontend/lib/registry/components/universal-form-modal/index.ts @@ -9,14 +9,14 @@ import { defaultConfig } from "./config"; /** * ๋ฒ”์šฉ ํผ ๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ ์ •์˜ * - * ์„น์…˜ ๊ธฐ๋ฐ˜ ํผ ๋ ˆ์ด์•„์›ƒ, ์ฑ„๋ฒˆ๊ทœ์น™, ๋‹ค์ค‘ ํ–‰ ์ €์žฅ์„ ์ง€์›ํ•˜๋Š” + * ์„น์…˜ ๊ธฐ๋ฐ˜ ํผ ๋ ˆ์ด์•„์›ƒ, ์ฑ„๋ฒˆ๊ทœ์น™์„ ์ง€์›ํ•˜๋Š” * ๋ฒ”์šฉ ๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค. */ export const UniversalFormModalDefinition = createComponentDefinition({ id: "universal-form-modal", name: "๋ฒ”์šฉ ํผ ๋ชจ๋‹ฌ", nameEng: "Universal Form Modal", - description: "์„น์…˜ ๊ธฐ๋ฐ˜ ํผ ๋ ˆ์ด์•„์›ƒ, ์ฑ„๋ฒˆ๊ทœ์น™, ๋‹ค์ค‘ ํ–‰ ์ €์žฅ์„ ์ง€์›ํ•˜๋Š” ๋ฒ”์šฉ ๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ", + description: "์„น์…˜ ๊ธฐ๋ฐ˜ ํผ ๋ ˆ์ด์•„์›ƒ, ์ฑ„๋ฒˆ๊ทœ์น™์„ ์ง€์›ํ•˜๋Š” ๋ฒ”์šฉ ๋ชจ๋‹ฌ ์ปดํฌ๋„ŒํŠธ", category: ComponentCategory.INPUT, webType: "form", component: UniversalFormModalComponent, @@ -28,7 +28,7 @@ export const UniversalFormModalDefinition = createComponentDefinition({ }, configPanel: UniversalFormModalConfigPanel, icon: "FormInput", - tags: ["ํผ", "๋ชจ๋‹ฌ", "์ž…๋ ฅ", "์ €์žฅ", "์ฑ„๋ฒˆ", "๊ฒธ์ง", "๋‹ค์ค‘ํ–‰"], + tags: ["ํผ", "๋ชจ๋‹ฌ", "์ž…๋ ฅ", "์ €์žฅ", "์ฑ„๋ฒˆ"], version: "1.0.0", author: "๊ฐœ๋ฐœํŒ€", documentation: ` @@ -36,22 +36,22 @@ export const UniversalFormModalDefinition = createComponentDefinition({ ### ์ฃผ์š” ๊ธฐ๋Šฅ - **์„น์…˜ ๊ธฐ๋ฐ˜ ๋ ˆ์ด์•„์›ƒ**: ๊ธฐ๋ณธ ์ •๋ณด, ์ถ”๊ฐ€ ์ •๋ณด ๋“ฑ ์„น์…˜๋ณ„๋กœ ํผ ๊ตฌ์„ฑ -- **๋ฐ˜๋ณต ์„น์…˜**: ๊ฒธ์ง์ฒ˜๋Ÿผ ๋™์ผํ•œ ํ•„๋“œ ๊ทธ๋ฃน์„ ์—ฌ๋Ÿฌ ๊ฐœ ์ถ”๊ฐ€ ๊ฐ€๋Šฅ +- **๋ฐ˜๋ณต ์„น์…˜**: ๋™์ผํ•œ ํ•„๋“œ ๊ทธ๋ฃน์„ ์—ฌ๋Ÿฌ ๊ฐœ ์ถ”๊ฐ€ ๊ฐ€๋Šฅ - **์ฑ„๋ฒˆ๊ทœ์น™ ์—ฐ๋™**: ์ž๋™ ์ฝ”๋“œ ์ƒ์„ฑ (๋ชจ๋‹ฌ ์—ด๋ฆด ๋•Œ ๋˜๋Š” ์ €์žฅ ์‹œ์ ) -- **๋‹ค์ค‘ ํ–‰ ์ €์žฅ**: ๊ณตํ†ต ํ•„๋“œ + ๊ฐœ๋ณ„ ํ•„๋“œ ์กฐํ•ฉ์œผ๋กœ ์—ฌ๋Ÿฌ ํ–‰ ๋™์‹œ ์ €์žฅ +- **๋‹จ์ผ/๋‹ค์ค‘ ํ…Œ์ด๋ธ” ์ €์žฅ**: ๋‹จ์ผ ํ…Œ์ด๋ธ” ๋˜๋Š” ๋ฉ”์ธ+์„œ๋ธŒ ํ…Œ์ด๋ธ”์— ์ €์žฅ - **์™ธ๋ถ€ ๋ฐ์ดํ„ฐ ์ˆ˜์‹ **: ๋ถ€๋ชจ ํ™”๋ฉด์—์„œ ์ „๋‹ฌ๋ฐ›์€ ๊ฐ’ ์ž๋™ ์ฑ„์›€ ### ์‚ฌ์šฉ ์˜ˆ์‹œ -1. ๋ถ€์„œ๊ด€๋ฆฌ ์‚ฌ์› ์ถ”๊ฐ€ + ๊ฒธ์ง ๋“ฑ๋ก -2. ํ’ˆ๋ชฉ ๋“ฑ๋ก + ๊ทœ๊ฒฉ ์˜ต์…˜ ์ถ”๊ฐ€ -3. ๊ฑฐ๋ž˜์ฒ˜ ๋“ฑ๋ก + ๋‹ด๋‹น์ž ์ •๋ณด ์ถ”๊ฐ€ +1. ์‚ฌ์› ๋“ฑ๋ก, ๋ถ€์„œ ๋“ฑ๋ก, ๊ฑฐ๋ž˜์ฒ˜ ๋“ฑ๋ก (๋‹จ์ผ ํ…Œ์ด๋ธ”) +2. ์ฃผ๋ฌธ ๋“ฑ๋ก + ์ฃผ๋ฌธ ์ƒ์„ธ (๋‹ค์ค‘ ํ…Œ์ด๋ธ”) +3. ํ’ˆ๋ชฉ ๋“ฑ๋ก + ๊ทœ๊ฒฉ ์˜ต์…˜ ์ถ”๊ฐ€ ### ์„ค์ • ๋ฐฉ๋ฒ• 1. ์ €์žฅ ํ…Œ์ด๋ธ” ์„ ํƒ -2. ์„น์…˜ ์ถ”๊ฐ€ (๊ธฐ๋ณธ ์ •๋ณด, ๊ฒธ์ง ์ •๋ณด ๋“ฑ) +2. ์„น์…˜ ์ถ”๊ฐ€ (๊ธฐ๋ณธ ์ •๋ณด ๋“ฑ) 3. ๊ฐ ์„น์…˜์— ํ•„๋“œ ์ถ”๊ฐ€ 4. ๋ฐ˜๋ณต ์„น์…˜ ์„ค์ • (ํ•„์š” ์‹œ) -5. ๋‹ค์ค‘ ํ–‰ ์ €์žฅ ์„ค์ • (ํ•„์š” ์‹œ) +5. ๋‹ค์ค‘ ํ…Œ์ด๋ธ” ์ €์žฅ ์„ค์ • (ํ•„์š” ์‹œ) 6. ์ฑ„๋ฒˆ๊ทœ์น™ ์—ฐ๋™ (ํ•„์š” ์‹œ) `, }); @@ -69,7 +69,6 @@ export type { FormSectionConfig, FormFieldConfig, SaveConfig, - MultiRowSaveConfig, NumberingRuleConfig, SelectOptionConfig, FormDataState, diff --git a/frontend/lib/registry/components/universal-form-modal/modals/FieldDetailSettingsModal.tsx b/frontend/lib/registry/components/universal-form-modal/modals/FieldDetailSettingsModal.tsx index 8882d9bc..453429e7 100644 --- a/frontend/lib/registry/components/universal-form-modal/modals/FieldDetailSettingsModal.tsx +++ b/frontend/lib/registry/components/universal-form-modal/modals/FieldDetailSettingsModal.tsx @@ -65,8 +65,6 @@ interface FieldDetailSettingsModalProps { tableColumns: { [tableName: string]: { name: string; type: string; label: string }[] }; numberingRules: { id: string; name: string }[]; onLoadTableColumns: (tableName: string) => void; - // ๋ถ€๋ชจ ํ™”๋ฉด์—์„œ ์ „๋‹ฌ ๊ฐ€๋Šฅํ•œ ํ•„๋“œ ๋ชฉ๋ก (์„ ํƒ์‚ฌํ•ญ) - availableParentFields?: AvailableParentField[]; // ์ €์žฅ ํ…Œ์ด๋ธ” ์ •๋ณด (ํƒ€๊ฒŸ ์ปฌ๋Ÿผ ์„ ํƒ์šฉ) targetTableName?: string; targetTableColumns?: { name: string; type: string; label: string }[]; @@ -81,7 +79,6 @@ export function FieldDetailSettingsModal({ tableColumns, numberingRules, onLoadTableColumns, - availableParentFields = [], // targetTableName์€ ํƒ€๊ฒŸ ์ปฌ๋Ÿผ ์„ ํƒ ์‹œ ์ฐธ๊ณ ์šฉ์œผ๋กœ ์ „๋‹ฌ๋จ (ํ˜„์žฌ targetTableColumns๋งŒ ์‚ฌ์šฉ) targetTableName: _targetTableName, targetTableColumns = [], @@ -330,60 +327,6 @@ export function FieldDetailSettingsModal({ /> ํ™”๋ฉด์— ํ‘œ์‹œํ•˜์ง€ ์•Š์ง€๋งŒ ๊ฐ’์€ ์ €์žฅ๋ฉ๋‹ˆ๋‹ค - - - -
- ๋ถ€๋ชจ์—์„œ ๊ฐ’ ๋ฐ›๊ธฐ - updateField({ receiveFromParent: checked })} - /> -
- ๋ถ€๋ชจ ํ™”๋ฉด์—์„œ ์ „๋‹ฌ๋ฐ›์€ ๊ฐ’์œผ๋กœ ์ž๋™ ์ฑ„์›Œ์ง‘๋‹ˆ๋‹ค - - {/* ๋ถ€๋ชจ์—์„œ ๊ฐ’ ๋ฐ›๊ธฐ ํ™œ์„ฑํ™” ์‹œ ํ•„๋“œ ์„ ํƒ */} - {localField.receiveFromParent && ( -
- - {availableParentFields.length > 0 ? ( - - ) : ( -
- updateField({ parentFieldName: e.target.value })} - placeholder={`์˜ˆ: ${localField.columnName || "parent_field_name"}`} - className="h-8 text-xs" - /> -

- ๋ถ€๋ชจ ํ™”๋ฉด์—์„œ ์ „๋‹ฌ๋ฐ›์„ ํ•„๋“œ๋ช…์„ ์ž…๋ ฅํ•˜์„ธ์š”. ๋น„์›Œ๋‘๋ฉด "{localField.columnName}"์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. -

-
- )} -
- )} {/* Accordion์œผ๋กœ ๊ณ ๊ธ‰ ์„ค์ • */} diff --git a/frontend/lib/registry/components/universal-form-modal/modals/SaveSettingsModal.tsx b/frontend/lib/registry/components/universal-form-modal/modals/SaveSettingsModal.tsx index 11b3a8ae..01c87fcb 100644 --- a/frontend/lib/registry/components/universal-form-modal/modals/SaveSettingsModal.tsx +++ b/frontend/lib/registry/components/universal-form-modal/modals/SaveSettingsModal.tsx @@ -378,7 +378,11 @@ export function SaveSettingsModal({ ๋‹จ์ผ ํ…Œ์ด๋ธ” ์ €์žฅ - ๋ชจ๋“  ํ•„๋“œ๋ฅผ ํ•˜๋‚˜์˜ ํ…Œ์ด๋ธ”์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค (๊ธฐ๋ณธ ๋ฐฉ์‹) + + ํผ ๋ฐ์ดํ„ฐ๋ฅผ ํ•˜๋‚˜์˜ ํ…Œ์ด๋ธ”์— 1๊ฐœ ํ–‰์œผ๋กœ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. +
+ ์˜ˆ: ์‚ฌ์› ๋“ฑ๋ก, ๋ถ€์„œ ๋“ฑ๋ก, ๊ฑฐ๋ž˜์ฒ˜ ๋“ฑ๋ก ๋“ฑ ๋‹จ์ˆœ ๋“ฑ๋ก ํ™”๋ฉด +
@@ -387,9 +391,13 @@ export function SaveSettingsModal({
- ๋ฉ”์ธ ํ…Œ์ด๋ธ” + ์„œ๋ธŒ ํ…Œ์ด๋ธ”์— ํŠธ๋žœ์žญ์…˜์œผ๋กœ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค + ํ•˜๋‚˜์˜ ํผ์œผ๋กœ ์—ฌ๋Ÿฌ ํ…Œ์ด๋ธ”์— ๋™์‹œ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. (ํŠธ๋žœ์žญ์…˜์œผ๋กœ ๋ฌถ์ž„)
- ์˜ˆ: ์ฃผ๋ฌธ(orders) + ์ฃผ๋ฌธ์ƒ์„ธ(order_items), ์‚ฌ์›(user_info) + ๋ถ€์„œ(user_dept) + ๋ฉ”์ธ ํ…Œ์ด๋ธ”: ํผ์˜ ๋ชจ๋“  ํ•„๋“œ ์ค‘ ํ•ด๋‹น ํ…Œ์ด๋ธ” ์ปฌ๋Ÿผ๊ณผ ์ผ์น˜ํ•˜๋Š” ๊ฒƒ ์ž๋™ ์ €์žฅ +
+ ์„œ๋ธŒ ํ…Œ์ด๋ธ”: ํ•„๋“œ ๋งคํ•‘์—์„œ ์ง€์ •ํ•œ ํ•„๋“œ๋งŒ ์ €์žฅ (๋ฉ”์ธ ํ…Œ์ด๋ธ”์˜ ํ‚ค ๊ฐ’์ด ์ž๋™ ์—ฐ๊ฒฐ๋จ) +
+ ์˜ˆ: ์‚ฌ์›+๋ถ€์„œ๋ฐฐ์ •(user_info+user_dept), ์ฃผ๋ฌธ+์ฃผ๋ฌธ์ƒ์„ธ(orders+order_items)
@@ -691,9 +699,11 @@ export function SaveSettingsModal({ - ๋ฐ˜๋ณต ์„น์…˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณ„๋„ ํ…Œ์ด๋ธ”์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. + ํผ์—์„œ ์ž…๋ ฅํ•œ ํ•„๋“œ๋ฅผ ์„œ๋ธŒ ํ…Œ์ด๋ธ”์— ๋‚˜๋ˆ ์„œ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
- ์˜ˆ: ์ฃผ๋ฌธ์ƒ์„ธ(order_items), ๊ฒธ์ง๋ถ€์„œ(user_dept) + ๋ฉ”์ธ ํ…Œ์ด๋ธ”์˜ ํ‚ค ๊ฐ’(์˜ˆ: user_id)์ด ์„œ๋ธŒ ํ…Œ์ด๋ธ”์— ์ž๋™์œผ๋กœ ์—ฐ๊ฒฐ๋ฉ๋‹ˆ๋‹ค. +
+ ํ•„๋“œ ๋งคํ•‘์—์„œ ์ง€์ •ํ•œ ํ•„๋“œ๋งŒ ์„œ๋ธŒ ํ…Œ์ด๋ธ”์— ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.
{(localSaveConfig.customApiSave?.multiTable?.subTables || []).length === 0 ? ( @@ -802,13 +812,13 @@ export function SaveSettingsModal({
- + - ์ด ์„œ๋ธŒ ํ…Œ์ด๋ธ”์— ์ €์žฅํ•  ๋ฐ˜๋ณต ์„น์…˜์„ ์„ ํƒํ•˜์„ธ์š” + + ๋ฐ˜๋ณต ์„น์…˜: ํผ ์•ˆ์—์„œ ๋™์ ์œผ๋กœ ํ•ญ๋ชฉ์„ ์ถ”๊ฐ€/์‚ญ์ œํ•  ์ˆ˜ ์žˆ๋Š” ์„น์…˜ (์˜ˆ: ์ฃผ๋ฌธ ํ’ˆ๋ชฉ ๋ชฉ๋ก) +
+ ๋ฐ˜๋ณต ์„น์…˜์ด ์žˆ์œผ๋ฉด ํ•ด๋‹น ์„น์…˜์˜ ๊ฐ ํ•ญ๋ชฉ์ด ์„œ๋ธŒ ํ…Œ์ด๋ธ”์— ์—ฌ๋Ÿฌ ํ–‰์œผ๋กœ ์ €์žฅ๋ฉ๋‹ˆ๋‹ค. +
+ ๋ฐ˜๋ณต ์„น์…˜ ์—†์ด ํ•„๋“œ ๋งคํ•‘๋งŒ ์‚ฌ์šฉํ•˜๋ฉด 1๊ฐœ ํ–‰๋งŒ ์ €์žฅ๋ฉ๋‹ˆ๋‹ค. +
diff --git a/frontend/lib/registry/components/universal-form-modal/types.ts b/frontend/lib/registry/components/universal-form-modal/types.ts index 9d54270b..ebd0b902 100644 --- a/frontend/lib/registry/components/universal-form-modal/types.ts +++ b/frontend/lib/registry/components/universal-form-modal/types.ts @@ -639,19 +639,6 @@ export interface TableCalculationRule { conditionalCalculation?: ConditionalCalculationConfig; } -// ๋‹ค์ค‘ ํ–‰ ์ €์žฅ ์„ค์ • -export interface MultiRowSaveConfig { - enabled?: boolean; // ์‚ฌ์šฉ ์—ฌ๋ถ€ (๊ธฐ๋ณธ: false) - commonFields?: string[]; // ๋ชจ๋“  ํ–‰์— ๊ณตํ†ต ์ €์žฅํ•  ํ•„๋“œ (columnName ๊ธฐ์ค€) - repeatSectionId?: string; // ๋ฐ˜๋ณต ์„น์…˜ ID - typeColumn?: string; // ๊ตฌ๋ถ„ ์ปฌ๋Ÿผ๋ช… (์˜ˆ: "employment_type") - mainTypeValue?: string; // ๋ฉ”์ธ ํ–‰ ๊ฐ’ (์˜ˆ: "main") - subTypeValue?: string; // ์„œ๋ธŒ ํ–‰ ๊ฐ’ (์˜ˆ: "concurrent") - - // ๋ฉ”์ธ ์„น์…˜ ํ•„๋“œ (๋ฐ˜๋ณต ์„น์…˜์ด ์•„๋‹Œ ๊ณณ์˜ ๋ถ€์„œ/์ง๊ธ‰ ๋“ฑ) - mainSectionFields?: string[]; // ๋ฉ”์ธ ํ–‰์—๋งŒ ์ €์žฅํ•  ํ•„๋“œ -} - /** * ์„น์…˜๋ณ„ ์ €์žฅ ๋ฐฉ์‹ ์„ค์ • * ๊ณตํ†ต ์ €์žฅ: ํ•ด๋‹น ์„น์…˜์˜ ํ•„๋“œ ๊ฐ’์ด ๋ชจ๋“  ํ’ˆ๋ชฉ ํ–‰์— ๋™์ผํ•˜๊ฒŒ ์ €์žฅ๋ฉ๋‹ˆ๋‹ค (์˜ˆ: ์ˆ˜์ฃผ๋ฒˆํ˜ธ, ๊ฑฐ๋ž˜์ฒ˜) @@ -672,9 +659,6 @@ export interface SaveConfig { tableName: string; primaryKeyColumn?: string; // PK ์ปฌ๋Ÿผ (์ˆ˜์ • ์‹œ ์‚ฌ์šฉ) - // ๋‹ค์ค‘ ํ–‰ ์ €์žฅ ์„ค์ • - multiRowSave?: MultiRowSaveConfig; - // ์ปค์Šคํ…€ API ์ €์žฅ ์„ค์ • (ํ…Œ์ด๋ธ” ์ง์ ‘ ์ €์žฅ ๋Œ€์‹  ์ „์šฉ API ์‚ฌ์šฉ) customApiSave?: CustomApiSaveConfig;