From f02773ab37bd911b1f3a81a93a7d5aaffd04bcad Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Tue, 30 Sep 2025 19:50:09 +0900 Subject: (김준회) 스테이지 선택 로직 오류 수정 및 스크롤 처리 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/docu-list-rule/document-class/service.ts | 25 +++++++++++++++ .../table/document-class-option-add-dialog.tsx | 36 ++++++---------------- 2 files changed, 34 insertions(+), 27 deletions(-) (limited to 'lib/docu-list-rule') diff --git a/lib/docu-list-rule/document-class/service.ts b/lib/docu-list-rule/document-class/service.ts index 378c3215..29ed2642 100644 --- a/lib/docu-list-rule/document-class/service.ts +++ b/lib/docu-list-rule/document-class/service.ts @@ -593,4 +593,29 @@ export async function deleteDocumentClassOption(id: number) { error: "Failed to delete document class option" } } +} + +// 프로젝트 일정 설정을 가져오는 함수 +export async function getProjectKindScheduleSetting(projectCode: string): Promise { + try { + const response = await fetch( + `http://60.100.99.217/DDP/Services/VNDRService.svc/GetProjectKindScheduleSetting?PROJ_NO=${projectCode}`, + { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + } + ) + + if (!response.ok) { + throw new Error('Failed to fetch schedule settings') + } + + const data = await response.json() + return data.GetProjectKindScheduleSettingResult || [] + } catch (error) { + console.error('Error fetching schedule settings:', error) + return [] + } } \ No newline at end of file diff --git a/lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx b/lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx index 31337675..ac943ceb 100644 --- a/lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx +++ b/lib/docu-list-rule/document-class/table/document-class-option-add-dialog.tsx @@ -40,7 +40,7 @@ import { import { cn } from "@/lib/utils" import { useParams } from "next/navigation" -import { createDocumentClassOptionItem } from "@/lib/docu-list-rule/document-class/service" +import { createDocumentClassOptionItem, getProjectKindScheduleSetting } from "@/lib/docu-list-rule/document-class/service" import { getProjectCode } from "@/lib/projects/service" // API 응답 타입 @@ -54,31 +54,6 @@ interface ScheduleSetting { USE_YN2: string } -// 프로젝트 일정 설정을 가져오는 함수 -async function getProjectKindScheduleSetting(projectCode: string): Promise { - try { - const response = await fetch( - `http://60.100.99.217/DDP/Services/VNDRService.svc/GetProjectKindScheduleSetting?PROJ_NO=${projectCode}`, - { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - } - ) - - if (!response.ok) { - throw new Error('Failed to fetch schedule settings') - } - - const data = await response.json() - return data.GetProjectKindScheduleSettingResult || [] - } catch (error) { - console.error('Error fetching schedule settings:', error) - return [] - } -} - const createOptionSchema = z.object({ optionCode: z.string().min(1, "옵션을 선택해주세요."), }) @@ -218,7 +193,14 @@ export function DocumentClassOptionAddDialog({ documentClassId, onSuccess }: Doc {isLoading ? "로딩 중..." : "검색 결과가 없습니다."} - + { + e.stopPropagation(); + const target = e.currentTarget; + target.scrollTop += e.deltaY; + }} + > {scheduleSettings.map((setting) => (