From 29dd9d628eeddb3d510c2e4875f86e9fe818e37b Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Thu, 25 Jun 2026 13:05:37 +0900 Subject: [PATCH] =?UTF-8?q?260625=5F01=5FENH:=20=EC=97=B0=EA=B5=AC,=20?= =?UTF-8?q?=EC=8B=A4=EC=82=AC=20=EC=88=98=EC=A0=95=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=201=EC=B0=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(pages)/(main)/monitoring/page.tsx | 23 ++-- src/app/(pages)/(main)/performance/page.tsx | 104 ++++++++++++++---- src/app/api/kon/[[...slug]]/route.ts | 7 +- src/app/api/review/[[...slug]]/route.ts | 19 +++- .../common/ReactQueryLoadingSync.tsx | 9 +- src/components/data-table/DataTable.tsx | 11 +- src/components/data-table/DataTable.type.ts | 2 + .../dialog/AssignMonitoringDialog.tsx | 4 +- .../MonitoringPerformanceDetailDialog.tsx | 22 ++-- .../dialog/MonitoringVisitDialog.tsx | 4 +- .../dialog/PerformanceDetailDialog.tsx | 32 +++++- src/lib/gwcf/field-labels.ts | 8 ++ src/lib/gwcf/file.ts | 9 ++ src/lib/gwcf/performance-status.ts | 6 +- src/types/gwcf.ts | 2 +- 15 files changed, 197 insertions(+), 65 deletions(-) diff --git a/src/app/(pages)/(main)/monitoring/page.tsx b/src/app/(pages)/(main)/monitoring/page.tsx index 1c20967..cc0cc86 100644 --- a/src/app/(pages)/(main)/monitoring/page.tsx +++ b/src/app/(pages)/(main)/monitoring/page.tsx @@ -26,7 +26,7 @@ import {StatusPill} from "@/components/gwcf/StatusPill"; const today = toLocalDateString(); const todayTime = new Date(`${today}T00:00:00`).getTime(); -const toDateTime = (date?: string) => { +const toDateTime = (date?: string | null) => { if (!date) return Number.POSITIVE_INFINITY; const time = new Date(`${date}T00:00:00`).getTime(); return Number.isNaN(time) ? Number.POSITIVE_INFINITY : time; @@ -78,7 +78,6 @@ const MonitoringPage = () => { const userId = auth.user?.userId; const [selectedId, setSelectedId] = useState(null); - const [detailId, setDetailId] = useState(null); const [visitMode, setVisitMode] = useState<"departure" | "arrival">("departure"); const refreshMonitoringList = () => { @@ -100,11 +99,6 @@ const MonitoringPage = () => { return sortedItems.find((item) => item.id === selectedId) ?? sortedItems[0] ?? null; }, [selectedId, sortedItems]); - const detailSelected = useMemo(() => { - if (!detailId) return null; - return sortedItems.find((item) => item.id === detailId) ?? null; - }, [detailId, sortedItems]); - const selectedMonitoringRow = useMemo(() => { if (!selected || !userId) return undefined; return ([0, 1] as const) @@ -114,8 +108,6 @@ const MonitoringPage = () => { const hasDeparture = Boolean(selectedMonitoringRow?.slot.timeline.departure || selectedMonitoringRow?.slot.visit?.length); const hasArrival = Boolean(selectedMonitoringRow?.slot.timeline.arrival); - - const columns = useMemo[]>(() => [ { accessorKey: "performanceName", @@ -146,18 +138,18 @@ const MonitoringPage = () => { { id: "monitoringDate", header: PERFORMANCE_FIELD_LABELS.monitoringDate, - cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringDate?.slice(5) || "-", + cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringDate?.slice(5) ?? "", }, { id: "monitoringTime", header: PERFORMANCE_FIELD_LABELS.monitoringTimeInfo, cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringTimeInfo || "-", }, - ], []); + ], [codes]); const visitOpen = isDialogOpen("monitoringVisitDialog"); const detailOpen = isDialogOpen("monitoringDetailDialog"); - const {data: detailData} = usePerformanceDetailQuery(detailId ?? 0, Boolean(detailId && detailOpen)); + const {data: detailData} = usePerformanceDetailQuery(selectedId ?? 0, Boolean(selectedId && detailOpen)); const openVisit = (mode: "departure" | "arrival") => { setVisitMode(mode); @@ -261,7 +253,7 @@ const MonitoringPage = () => { {selected && (
- {selected.performanceMonitoringSchedule?.monitoringDate} {selected.performanceMonitoringSchedule?.monitoringTimeInfo} + {[selected.performanceMonitoringSchedule?.monitoringDate, selected.performanceMonitoringSchedule?.monitoringTimeInfo].filter(Boolean).join(" ")}
{PERFORMANCE_FIELD_LABELS.performanceName}
@@ -292,7 +284,7 @@ const MonitoringPage = () => { getRowId={(row) => String(row.id)} selectMode="click-event" onRowClick={(item) => { - setDetailId(item.id); + setSelectedId(item.id); showDialog("monitoringDetailDialog"); }} highlightRowIds={selected ? [String(selected.id)] : []} @@ -329,10 +321,9 @@ const MonitoringPage = () => { } hideDialog("monitoringDetailDialog"); - setDetailId(null); refreshMonitoringList(); }} - performance={detailData ?? detailSelected} + performance={detailData ?? selected} codes={codes} userId={userId} /> diff --git a/src/app/(pages)/(main)/performance/page.tsx b/src/app/(pages)/(main)/performance/page.tsx index 93f3911..5d76404 100644 --- a/src/app/(pages)/(main)/performance/page.tsx +++ b/src/app/(pages)/(main)/performance/page.tsx @@ -60,6 +60,7 @@ type PerformanceFilters = { area: string[]; startMonth: string[]; monitoringDate: string; + monitoringAdd: string[]; localReviewStatus: string[]; monitoring1Status: string[]; monitoring2Status: string[]; @@ -67,13 +68,39 @@ type PerformanceFilters = { keyword: string; }; -const monthOptions: Code[] = Array.from({length: 12}, (_, index) => ({ - codeGroup: "month", - codeValue: index + 1, - codeGroupLabel: PERFORMANCE_FIELD_LABELS.performanceStartMonth, - codeLabel: `${index + 1}월`, - memo: "", -})); +const monthOptions: Code[] = [ + { + codeGroup: "month", + codeValue: 0, + codeGroupLabel: PERFORMANCE_FIELD_LABELS.performanceStartMonth, + codeLabel: `미정`, + memo: "", + }, + ...Array.from({length: 12}, (_, index) => ({ + codeGroup: "month", + codeValue: index + 1, + codeGroupLabel: PERFORMANCE_FIELD_LABELS.performanceStartMonth, + codeLabel: `${index + 1}월`, + memo: "", + })) +]; + +const monitoringAddOptions: Code[] = [ + { + codeGroup: "monitoring_add", + codeValue: 0, + codeGroupLabel: PERFORMANCE_FIELD_LABELS.monitoringAdd, + codeLabel: "추가 모니터링 X", + memo: "", + }, + { + codeGroup: "monitoring_add", + codeValue: 1, + codeGroupLabel: PERFORMANCE_FIELD_LABELS.monitoringAdd, + codeLabel: "추가 모니터링 O", + memo: "", + }, +]; const PerformancePage = () => { const mounted = useMounted(); @@ -101,6 +128,7 @@ const PerformancePage = () => { area: [], startMonth: [], monitoringDate: "", + monitoringAdd: [], localReviewStatus: [], monitoring1Status: [], monitoring2Status: [], @@ -191,6 +219,7 @@ const PerformancePage = () => { keyword: filters.keyword, }) && matchesStatus(filters.startMonth, String(item.performanceStartMonth)) && + matchesStatus(filters.monitoringAdd, item.id % 100 === 1 ? "0" : "1") && matchesStatus(filters.localReviewStatus, getReviewStatusFilterValue( localReview, getCodeLabel(codes, "review_status", localReview?.reviewStatus), @@ -269,7 +298,7 @@ const PerformancePage = () => { : undefined; return ( -
+
{ const visitUser = getMonitoringRecordedUser(latestVisit); return ( -
+
downloadReviewOriginal(performance.id, row.review) : undefined} @@ -319,27 +348,47 @@ const PerformancePage = () => { }; const columns = useMemo[]>(() => [ + {accessorKey: "no", header: PERFORMANCE_FIELD_LABELS.no, + accessorFn: (row) => row.performanceDetail["performanceNo"] ?? "", + cell: ({row}) => row.original.performanceDetail["performanceNo"] ?? "", + }, {accessorKey: "id", header: PERFORMANCE_FIELD_LABELS.id, cell: ({row}) => row.original.id}, + {accessorKey: "monitoringAdd", header: PERFORMANCE_FIELD_LABELS.monitoringAdd, + accessorFn: (row) => row.id % 100 !== 1? "추가" : "", + cell: ({row}) => row.original.id % 100 !== 1? "추가" : "", + }, {id: "businessType", header: PERFORMANCE_FIELD_LABELS.businessType, cell: ({row}) => getCodeLabel(codes, "business_type", row.original.businessType)}, {id: "genre", header: PERFORMANCE_FIELD_LABELS.performanceGenre, cell: ({row}) => getCodeLabel(codes, "genre", row.original.performanceGenre)}, {id: "area", header: PERFORMANCE_FIELD_LABELS.performanceArea, cell: ({row}) => getCodeLabel(codes, "area", row.original.performanceArea)}, {accessorKey: "artistName", header: PERFORMANCE_FIELD_LABELS.artistName}, {accessorKey: "performanceName", header: PERFORMANCE_FIELD_LABELS.performanceName}, {id: "startMonth", header: PERFORMANCE_FIELD_LABELS.performanceStartMonth, - accessorFn: (row) => row.performanceStartMonth ?? 99, - cell: ({row}) => `${row.original.performanceStartMonth}월`}, + accessorFn: (row) => row.performanceStartMonth ?? 0, + cell: ({row}) => row.original.performanceStartMonth === 0? "미정":`${row.original.performanceStartMonth}월`}, {accessorKey: "performanceDtInfo", header: PERFORMANCE_FIELD_LABELS.performanceDtInfo, enableSorting: false}, {accessorKey: "performanceTimeInfo", header: PERFORMANCE_FIELD_LABELS.performanceTimeInfo, enableSorting: false}, - ...(!isWrittenReviewer ? [{ - id: "monitoringDate", - header: PERFORMANCE_FIELD_LABELS.monitoringDate, - accessorFn: (row) => row.performanceMonitoringSchedule?.monitoringDate ?? "", - cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringDate ?? "", - } satisfies DataTableColumn] : []), + ...(!isWrittenReviewer ? [ + { + id: "monitoringDate", + header: PERFORMANCE_FIELD_LABELS.monitoringDate, + accessorFn: (row) => row.performanceMonitoringSchedule?.monitoringDate ?? "", + cell: ({row}) => row.original.performanceMonitoringSchedule?.monitoringDate ?? "", + }, + { + id: "timeTreeCheckDt", + header: PERFORMANCE_FIELD_LABELS.timeTreeCheckDt, + accessorFn: (row) => row.performanceDetail["timeTreeCheckDt"] ?? "", + cell: ({row}) => row.original.performanceDetail["timeTreeCheckDt"] ?? "", + } + ]: []) as DataTableColumn[], { id: "localReview", header: "지자체 평가", cell: ({row}) => { + if(row.original.id % 100 !== 1){ + return "-"; + } + const found = getReviewByType(row.original, LOCAL_GOVERNMENT_REVIEW_TYPE); return renderReviewStatus({ performance: row.original, @@ -349,13 +398,22 @@ const PerformancePage = () => { noTooltip: isWrittenReviewer, }); }, + size:40, }, - {id: "monitoring1", header: "모니터링 1", cell: ({row}) => renderMonitoringStatus(row.original, 0)}, - {id: "monitoring2", header: "모니터링 2", cell: ({row}) => renderMonitoringStatus(row.original, 1)}, + ...(!isWrittenReviewer ? [ + {id: "monitoring1", header: "모니터링 1", cell: ({row}) => renderMonitoringStatus(row.original, 0), size:40,}, + {id: "monitoring2", header: "모니터링 2", cell: ({row}) => renderMonitoringStatus(row.original, 1), size:40,}, + ] : [ + {id: "monitoring", header: "모니터링", cell: ({row}) => renderMonitoringStatus(row.original, 0), size:40,} + ]) as DataTableColumn[], { id: "writtenReview", header: "서면 평가", cell: ({row}) => { + if(row.original.id % 100 !== 1){ + return "-"; + } + const found = getVisibleWrittenReviewRow(row.original); return renderReviewStatus({ performance: row.original, @@ -365,6 +423,7 @@ const PerformancePage = () => { alwaysAssigned: Boolean(found?.assign), }); }, + size:40, }, ], [codes, getVisibleWrittenReviewRow, isWrittenReviewer]); @@ -410,7 +469,10 @@ const PerformancePage = () => { 검색
-
+
+ {!isWrittenReviewer && ( + updateFilters((prev) => ({...prev, monitoringAdd: value}))} options={monitoringAddOptions} placeholder={PERFORMANCE_FIELD_LABELS.monitoringAdd} /> + )} updateFilters((prev) => ({...prev, localReviewStatus: value}))} options={localReviewStatusOptions} placeholder="지자체 평가 상태" /> updateFilters((prev) => ({...prev, monitoring1Status: value}))} options={monitoringStatusOptions} placeholder="모니터링1 상태" /> updateFilters((prev) => ({...prev, monitoring2Status: value}))} options={monitoringStatusOptions} placeholder="모니터링2 상태" /> @@ -444,6 +506,8 @@ const PerformancePage = () => { selectMode={isWrittenReviewer ? "none" : "click-event"} onRowClick={isWrittenReviewer ? undefined : openDetail} defaultPageSize={10} + headerFontClass="content-text-base" + cellFontClass="content-text-sm" /> diff --git a/src/app/api/kon/[[...slug]]/route.ts b/src/app/api/kon/[[...slug]]/route.ts index 4689a3b..2c23da6 100644 --- a/src/app/api/kon/[[...slug]]/route.ts +++ b/src/app/api/kon/[[...slug]]/route.ts @@ -2,7 +2,7 @@ import {NextRequest, NextResponse} from "next/server"; import {RouteContext} from "@/types/common"; import {errorToResponse} from "@/lib/http-util"; import {createBackApi} from "@/lib/server-api"; -import {PerformanceCompact} from "@/types/gwcf"; +import {PerformanceCompact, PerformanceFull} from "@/types/gwcf"; const ALLOWED_ORIGIN = "https://kon.kric.com"; @@ -73,6 +73,11 @@ export const POST = async ( return withCors(NextResponse.json(result, { status: 200 })); } + if(action === "performance" && slug.length === 2) { + const result = await backApi.get(`/performance/${encodeURIComponent(slug[1])}`) + return withCors(NextResponse.json(result, { status: 200 })); + } + if(action === "performance-list") { const result = await backApi.get(`/performance/list/compact`) return withCors(NextResponse.json(result, { status: 200 })); diff --git a/src/app/api/review/[[...slug]]/route.ts b/src/app/api/review/[[...slug]]/route.ts index b65abd9..8b41495 100644 --- a/src/app/api/review/[[...slug]]/route.ts +++ b/src/app/api/review/[[...slug]]/route.ts @@ -19,10 +19,10 @@ export const GET = async ( const [action, second, third, fourth] = slug; const backApi = await createBackApi(); - if (action === "template" && second === "download" && third && slug.length === 3) { + if (action === "template" && second === "download" && third && fourth && slug.length === 4) { const cookieStore = await cookies(); const accessToken = cookieStore.get(CookieKeys.AuthToken)?.value; - const response = await fetch(`${serverEnv.API_BACK_SERVER.replace(/\/+$/, "")}/review/template/download/${encodeURIComponent(third)}`, { + const response = await fetch(`${serverEnv.API_BACK_SERVER.replace(/\/+$/, "")}/review/template/download/${encodeURIComponent(third)}/${encodeURIComponent(fourth)}`, { headers: accessToken ? {authorization: `Bearer ${accessToken}`} : undefined, cache: "no-store", }); @@ -43,6 +43,21 @@ export const GET = async ( }); } + if (action === "template" && second === "pdf" && third && fourth && slug.length === 4) { + const result = await backApi.get( + `/review/pdf/download/${encodeURIComponent(third)}/${encodeURIComponent(fourth)}`, + { expectBinary: true } + ); + const disposition = req.nextUrl.searchParams.get("disposition") === "inline" ? "inline" : "attachment"; + return new NextResponse(result, { + status: 200, + headers: { + "Content-Type": "application/pdf", + "Content-Disposition": `${disposition}; filename="review-template-${third}-${fourth}.pdf"`, + }, + }); + } + if (action === "download" && second && third && fourth && slug.length === 4) { const result = await backApi.get( `/review/download/${encodeURIComponent(second)}/${encodeURIComponent(third)}/${encodeURIComponent(fourth)}`, diff --git a/src/components/common/ReactQueryLoadingSync.tsx b/src/components/common/ReactQueryLoadingSync.tsx index 86487be..bdda5af 100644 --- a/src/components/common/ReactQueryLoadingSync.tsx +++ b/src/components/common/ReactQueryLoadingSync.tsx @@ -1,19 +1,20 @@ "use client"; -import {useIsFetching} from "@tanstack/react-query"; +import {useIsFetching, useIsMutating} from "@tanstack/react-query"; import {useLoading} from "@/hooks/useLoading"; import {useEffect} from "react"; const ReactQueryLoadingSync = () => { const fetching = useIsFetching(); + const mutating = useIsMutating(); const { showLoading, hideLoading } = useLoading(); useEffect(() => { - if (fetching > 0) showLoading(); + if (fetching > 0 || mutating > 0) showLoading(); else hideLoading(); - }, [fetching, showLoading, hideLoading]); + }, [fetching, mutating, showLoading, hideLoading]); return null; }; -export default ReactQueryLoadingSync; \ No newline at end of file +export default ReactQueryLoadingSync; diff --git a/src/components/data-table/DataTable.tsx b/src/components/data-table/DataTable.tsx index f13a726..5d0ec55 100644 --- a/src/components/data-table/DataTable.tsx +++ b/src/components/data-table/DataTable.tsx @@ -48,7 +48,9 @@ export function DataTable({ defaultPageSize = 10, pageSizeOptions = [5, 10, 25, 50], showPagination = true, - paginationItemsToDisplay = 5 + paginationItemsToDisplay = 5, + headerFontClass = 'content-text-lg', + cellFontClass = 'content-text-base', }: Readonly>) { // Pagination state const [pagination, setPagination] = useState({ @@ -200,7 +202,8 @@ export function DataTable({ ({ @@ -190,7 +193,12 @@ export function MonitoringPerformanceDetailDialog({ ) : {label: "미배치", variant: "danger" as const}; - const downloadTemplate = () => downloadFromUrl("/api/review/template/download/1"); + const reviewType = row?.reviewType ?? 1; + const templateClassification = Number(String(performance?.id ?? 0).charAt(0)); + const downloadTemplate = () => downloadFromUrl(`/api/review/template/download/${reviewType}/${templateClassification}`); + const previewTemplate = () => { + openPreviewWindow(buildReviewTemplatePdfPreviewUrl(reviewType, templateClassification, `review-template-${reviewType}-${templateClassification}.pdf`)); + }; return ( @@ -214,7 +222,7 @@ export function MonitoringPerformanceDetailDialog({ {performance.performanceTimeInfo} {getCodeLabel(codes, "ticket_reservation_status", performance.ticketReservationStatus)} {performance.ticketReservationMemo} - {performance.performanceMonitoringSchedule?.monitoringDate} + {performance.performanceMonitoringSchedule?.monitoringDate ?? ""} {performance.performanceMonitoringSchedule?.monitoringTimeInfo} {performance.performanceMonitoringSchedule?.monitoringAddress} {performance.performanceMemo} @@ -224,10 +232,8 @@ export function MonitoringPerformanceDetailDialog({
나의 진행 상태
- + 미리보기 + 양식 {status.label}
diff --git a/src/components/dialog/MonitoringVisitDialog.tsx b/src/components/dialog/MonitoringVisitDialog.tsx index 456e6a5..6969a26 100644 --- a/src/components/dialog/MonitoringVisitDialog.tsx +++ b/src/components/dialog/MonitoringVisitDialog.tsx @@ -15,7 +15,7 @@ function DetailRow({label, children}: {label: string; children: ReactNode}) { return (
{label}
-
{children || "-"}
+
{children ?? "-"}
); } @@ -51,7 +51,7 @@ export function MonitoringVisitDialog({
{nowText} - {performance?.performanceMonitoringSchedule?.monitoringDate} {performance?.performanceMonitoringSchedule?.monitoringTimeInfo} + {[performance?.performanceMonitoringSchedule?.monitoringDate, performance?.performanceMonitoringSchedule?.monitoringTimeInfo].filter(Boolean).join(" ")} {performance?.performanceName} {performance?.performanceMonitoringSchedule?.monitoringAddress} diff --git a/src/components/dialog/PerformanceDetailDialog.tsx b/src/components/dialog/PerformanceDetailDialog.tsx index 3d77cf6..cf2ee04 100644 --- a/src/components/dialog/PerformanceDetailDialog.tsx +++ b/src/components/dialog/PerformanceDetailDialog.tsx @@ -45,12 +45,13 @@ import { import {PERFORMANCE_FIELD_LABELS, USER_FIELD_LABELS} from "@/lib/gwcf/field-labels"; type CodeMap = Partial>; +type PerformanceDetail = PerformanceCompact["performanceDetail"]; function DetailRow({label, children}: {label: string; children: ReactNode}) { return (
{label}
-
{children || "-"}
+
{children ?? "-"}
); } @@ -225,6 +226,11 @@ function LocalGovernmentReviewRow({ const fallbackReviewRow = getReviewByType(performance as PerformanceFull, reviewType); const userId = fallbackReviewRow?.review.regUser || fallbackReviewRow?.userId; const {data: fetchedReview} = useReviewFileQuery(performance.id, reviewType, userId, performance.id > 0 && Boolean(userId)); + + if(performance.id % 100 !== 1){ + return null; + } + const review = fetchedReview ?? fallbackReviewRow?.review; const label = getCodeLabel(codes, "review_status", review?.reviewStatus); const display = getReviewStatusDisplay(label, review, true); @@ -319,6 +325,10 @@ function WrittenReviewRows({ userMap: Map; canEdit: boolean; }>) { + if(performance.id % 100 !== 1){ + return null; + } + const rows = getWrittenReviewRows(performance as PerformanceFull); if(rows.length === 0){ @@ -419,6 +429,16 @@ export function PerformanceDetailDialog({ setDraft((prev) => prev ? {...prev, [key]: value} : prev); }; + const updateDetail = (key: K, value: PerformanceDetail[K]) => { + setDraft((prev) => prev ? { + ...prev, + performanceDetail: { + ...prev.performanceDetail, + [key]: value, + }, + } : prev); + }; + const updateSchedule = (key: K, value: PerformanceMonitoringSchedule[K]) => { setDraft((prev) => prev ? { ...prev, @@ -481,10 +501,13 @@ export function PerformanceDetailDialog({
+ {draft.performanceDetail["performanceNo"] ?? ""} {draft.id} + {draft.id % 100 !== 1? "추가" : ""} {getCodeLabel(codes, "business_type", draft.businessType)} {getCodeLabel(codes, "genre", draft.performanceGenre)} {getCodeLabel(codes, "area", draft.performanceArea)} + {isEditing ? updateDetail("performanceAreaDetail", event.target.value)} /> : draft.performanceDetail["performanceAreaDetail"] ?? ""} {draft.artistName} {isEditing ? updateDraft("performanceName", event.target.value)} /> : draft.performanceName} {isEditing ? updateDraft("performanceStartMonth", Number(event.target.value))} /> : `${draft.performanceStartMonth}월`} @@ -496,10 +519,15 @@ export function PerformanceDetailDialog({ ) : getCodeLabel(codes, "ticket_reservation_status", draft.ticketReservationStatus)} {isEditing ? updateDraft("ticketReservationMemo", event.target.value)} /> : draft.ticketReservationMemo} - {isEditing ? updateSchedule("monitoringDate", value)} /> : draft.performanceMonitoringSchedule?.monitoringDate} + {isEditing ? updateSchedule("monitoringDate", value)} /> : draft.performanceMonitoringSchedule?.monitoringDate ?? ""} {isEditing ? updateSchedule("monitoringTimeInfo", event.target.value)} /> : draft.performanceMonitoringSchedule?.monitoringTimeInfo} + {isEditing ? updateDetail("needMonitoring", event.target.value)} /> : draft.performanceDetail["needMonitoring"] ?? ""} + {isEditing ? updateDetail("needWrittenReview", event.target.value)} /> : draft.performanceDetail["needWrittenReview"] ?? ""} + {isEditing ? updateDetail("checkDeliver", event.target.value)} /> : draft.performanceDetail["checkDeliver"] ?? ""} + {isEditing ? updateDetail("timeTreeCheckDt", value)} /> : draft.performanceDetail["timeTreeCheckDt"] ?? ""} {isEditing ? updateSchedule("monitoringAddress", event.target.value)} /> : draft.performanceMonitoringSchedule?.monitoringAddress} {isEditing ? updateDraft("performanceMemo", event.target.value)} /> : draft.performanceMemo} + {isEditing ? updateDetail("checkReport", event.target.value)} /> : draft.performanceDetail["checkReport"] ?? ""}
diff --git a/src/lib/gwcf/field-labels.ts b/src/lib/gwcf/field-labels.ts index 890fa3f..33d5749 100644 --- a/src/lib/gwcf/field-labels.ts +++ b/src/lib/gwcf/field-labels.ts @@ -16,10 +16,13 @@ export const USER_FIELD_LABELS = { } as const; export const PERFORMANCE_FIELD_LABELS = { + no: "No.", id: "연번", + monitoringAdd: "추가 모니터링", businessType: "사업유형", performanceGenre: "분야(장르)", performanceArea: "지역", + performanceAreaDetail: "지역 세부", artistName: "단체(인)명", performanceName: "사업명", performanceStartMonth: "사업 수행 월", @@ -30,7 +33,12 @@ export const PERFORMANCE_FIELD_LABELS = { performanceMemo: "메모", monitoringDate: "모니터링 일정", monitoringTimeInfo: "모니터링 시간", + needMonitoring: "모니터링 필요여부", + needWrittenReview: "서면평가 필요여부", + checkDeliver: "교부여부", + timeTreeCheckDt: "타임트리 확인일시", monitoringAddress: "방문 장소", + checkReport: "보고서 확인여부", performanceId: "사업 ID", monitoringPaymentDate: "요원 비용지급일", } as const; diff --git a/src/lib/gwcf/file.ts b/src/lib/gwcf/file.ts index 88d9ded..3245d1e 100644 --- a/src/lib/gwcf/file.ts +++ b/src/lib/gwcf/file.ts @@ -52,6 +52,15 @@ export const buildReviewPdfPreviewUrl = ( return `/file-preview?type=pdf&src=${encodeURIComponent(src)}&title=${encodeURIComponent(title || getReviewPdfDownloadName(performanceId, reviewType))}`; }; +export const buildReviewTemplatePdfPreviewUrl = ( + reviewType: number, + classification: number, + title?: string +) => { + const src = `/api/review/template/pdf/${reviewType}/${classification}?disposition=inline`; + return `/file-preview?type=pdf&src=${encodeURIComponent(src)}&title=${encodeURIComponent(title || `review-template-${reviewType}-${classification}.pdf`)}`; +}; + export const buildEvidenceImageSrc = ( performanceId: number, userId: string, diff --git a/src/lib/gwcf/performance-status.ts b/src/lib/gwcf/performance-status.ts index 6fb7807..3ed5941 100644 --- a/src/lib/gwcf/performance-status.ts +++ b/src/lib/gwcf/performance-status.ts @@ -125,7 +125,6 @@ export const getReviewRows = (performance: Partial) => { export const getMonitoringReviewByIndex = ( performance: Partial, - index: 0 | 1, slot?: MonitoringSlot ) => { const assignedUserId = slot?.assign?.assignUser; @@ -140,10 +139,11 @@ export const getMonitoringReviewByIndex = ( export const getMonitoringDisplayRow = ( performance: Partial, - index: 0 | 1 + index: 0 | 1, + isWrittenReviewer: boolean = false ): MonitoringDisplayRow => { const slot = getMonitoringSlots(performance)[index]; - const reviewRow = getMonitoringReviewByIndex(performance, index, slot); + const reviewRow = getMonitoringReviewByIndex(performance, slot); const visit = slot.visit?.[0]; return { diff --git a/src/types/gwcf.ts b/src/types/gwcf.ts index 6ab58f5..9e55187 100644 --- a/src/types/gwcf.ts +++ b/src/types/gwcf.ts @@ -91,7 +91,7 @@ export type PerformanceFull = PerformanceBase & { export type PerformanceMonitoringSchedule = { id: number; performanceId: number; - monitoringDate: string; + monitoringDate: string | null; monitoringTimeInfo: string; monitoringAddress: string; };