diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-06-20 11:37:31 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-06-20 11:37:31 +0000 |
| commit | aa86729f9a2ab95346a2851e3837de1c367aae17 (patch) | |
| tree | b601b18b6724f2fb449c7fa9ea50cbd652a8077d /components/form-data/form-data-table.tsx | |
| parent | 95bbe9c583ff841220da1267630e7b2025fc36dc (diff) | |
(대표님) 20250620 작업사항
Diffstat (limited to 'components/form-data/form-data-table.tsx')
| -rw-r--r-- | components/form-data/form-data-table.tsx | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/components/form-data/form-data-table.tsx b/components/form-data/form-data-table.tsx index 61e9897f..b59684e3 100644 --- a/components/form-data/form-data-table.tsx +++ b/components/form-data/form-data-table.tsx @@ -57,6 +57,7 @@ import { SEDPConfirmationDialog, SEDPStatusDialog } from "./sedp-components"; import { SEDPCompareDialog } from "./sedp-compare-dialog"; import { getSEDPToken } from "@/lib/sedp/sedp-token"; import { DeleteFormDataDialog } from "./delete-form-data-dialog"; +import { TemplateViewDialog } from "./spreadJS-dialog"; // 기존 fetchTagDataFromSEDP 함수 async function fetchTagDataFromSEDP(projectCode: string, formCode: string): Promise<any> { @@ -328,12 +329,12 @@ export default function DynamicTable({ try { setIsLoadingTemplate(true); - + const templateResult = await fetchTemplateFromSEDP(projectCode, formCode); - + setTemplateData(templateResult); setTemplateDialogOpen(true); - + toast.success("Template data loaded successfully"); } catch (error) { console.error("Error fetching template:", error); @@ -720,21 +721,6 @@ export default function DynamicTable({ </Button> )} - {/* 새로 추가된 Template 보기 버튼 */} - <Button - variant="outline" - size="sm" - onClick={handleGetTemplate} - disabled={isAnyOperationPending || selectedRowCount !== 1} - > - {isLoadingTemplate ? ( - <Loader className="mr-2 size-4 animate-spin" /> - ) : ( - <Eye className="mr-2 size-4" /> - )} - View In Spread - </Button> - {/* 버튼 그룹 */} <div className="flex items-center gap-2"> {/* 태그 관리 드롭다운 */} @@ -827,7 +813,25 @@ export default function DynamicTable({ Export </Button> - + {/* 새로 추가된 Template 보기 버튼 */} + <Button + variant="outline" + size="sm" + onClick={handleGetTemplate} + disabled={isAnyOperationPending || selectedRowCount !== 1} + > + {isLoadingTemplate ? ( + <Loader className="mr-2 size-4 animate-spin" /> + ) : ( + <Eye className="mr-2 size-4" /> + )} + View Template + {selectedRowCount === 1 && ( + <span className="ml-2 text-xs bg-green-100 text-green-700 px-2 py-1 rounded"> + 1 + </span> + )} + </Button> {/* COMPARE WITH SEDP 버튼 */} <Button @@ -918,6 +922,18 @@ export default function DynamicTable({ templateData={templateData} selectedRow={selectedRowsData[0]} formCode={formCode} + contractItemId={contractItemId} + onUpdateSuccess={(updatedValues) => { + // SpreadSheets에서 업데이트된 값을 테이블에 반영 + const tagNo = updatedValues.TAG_NO; + if (tagNo) { + setTableData(prev => + prev.map(item => + item.TAG_NO === tagNo ? updatedValues : item + ) + ); + } + }} /> {/* SEDP Confirmation Dialog */} @@ -989,5 +1005,4 @@ export default function DynamicTable({ )} </> ); -} - +}
\ No newline at end of file |
