diff --git a/apps/as/src/pages/esntl-atch-file-mng/model/esntl-atch-file-columns.tsx b/apps/as/src/pages/esntl-atch-file-mng/model/esntl-atch-file-columns.tsx index 4dd0c32bf..61a11056e 100644 --- a/apps/as/src/pages/esntl-atch-file-mng/model/esntl-atch-file-columns.tsx +++ b/apps/as/src/pages/esntl-atch-file-mng/model/esntl-atch-file-columns.tsx @@ -1,7 +1,7 @@ "use client"; import { createColumnHelper } from "@tanstack/react-table"; -import { Paperclip } from "lucide-react"; +import { Download } from "lucide-react"; import type { Code } from "@/entities/code"; import { findCodeLabel } from "@/entities/code"; @@ -58,26 +58,18 @@ export function createEsntlAtchFileColumns({ }), columnHelper.display({ id: "templateDownload", - header: "양식 다운로드", + header: "양식 내려받기", meta: { align: "center" }, cell: ({ row }) => { - const files = row.original.atchFileList ?? []; + const atflCd = row.original.atchFileGroupId ?? ""; - if (files.length === 0) return "-"; + if (!atflCd) return "-"; return ( -
e.stopPropagation()}> - {files.map((file) => ( - onDownloadTemplate(file.atflId)} - > - - {file.orgnlFileNm || "다운로드"} - - ))} -
+ ); }, }), diff --git a/apps/as/src/pages/esntl-atch-file-mng/ui/esntl-atch-file-list.tsx b/apps/as/src/pages/esntl-atch-file-mng/ui/esntl-atch-file-list.tsx index 71d0ac080..0872198f8 100644 --- a/apps/as/src/pages/esntl-atch-file-mng/ui/esntl-atch-file-list.tsx +++ b/apps/as/src/pages/esntl-atch-file-mng/ui/esntl-atch-file-list.tsx @@ -6,7 +6,7 @@ import { useConfirm } from "@frontend-opensource/use-react-hooks"; import { getCoreRowModel, type PaginationState } from "@tanstack/react-table"; import { useDataTable } from "@/shared/lib"; -import { useDownloadAttachmentByAtflId } from "@/entities/attach"; +import { useDownloadAttachmentByAtflCd } from "@/entities/attach"; import { useCodeList } from "@/entities/code"; import { type EsntlAtchFileMng, @@ -38,7 +38,7 @@ function EsntlAtchFileList({ }: EsntlAtchFileListProps) { const { confirm } = useConfirm(); const { data: docSeCodes } = useCodeList("ASDOCSE"); - const { mutate: downloadTemplate } = useDownloadAttachmentByAtflId(); + const { mutate: downloadTemplate } = useDownloadAttachmentByAtflCd(); const [dialogMode, setDialogMode] = useState<"create" | "edit" | null>(null); const [editingRow, setEditingRow] = useState(null); @@ -67,8 +67,8 @@ function EsntlAtchFileList({ ); const handleDownloadTemplate = useCallback( - (atflId: string) => { - downloadTemplate(atflId); + (atflCd: string) => { + downloadTemplate(atflCd); }, [downloadTemplate], ); diff --git a/apps/as/src/widgets/pbadms-sprt/ui/attachments-form-section.tsx b/apps/as/src/widgets/pbadms-sprt/ui/attachments-form-section.tsx index cf3bc912b..816c3e6b7 100644 --- a/apps/as/src/widgets/pbadms-sprt/ui/attachments-form-section.tsx +++ b/apps/as/src/widgets/pbadms-sprt/ui/attachments-form-section.tsx @@ -4,14 +4,14 @@ import { useEffect, useRef, useState } from "react"; import { Controller, useFormContext } from "react-hook-form"; import { useQueryClient } from "@tanstack/react-query"; -import { Paperclip, X } from "lucide-react"; +import { Download, Paperclip, X } from "lucide-react"; import { ENDPOINT } from "@/shared/config"; import { useTus } from "@/shared/lib"; import type { AtflMngClientResponseDto, EsntlAtchFileMngTreeResponseDto } from "@/shared/model"; import { TextShimmer } from "@/shared/ui"; import { SectionCollapsible } from "@/shared/ui"; -import { attachService, useDownloadAttachmentByAtflId } from "@/entities/attach"; +import { attachService, useDownloadAttachmentByAtflCd } from "@/entities/attach"; import { useEsntlAtchFileMngTree } from "@/entities/esntl"; import { Button, @@ -212,7 +212,7 @@ function AttachmentsFormSection({ const { data: essentialFiles = [], isPending: isLoadingEssentialFiles } = useEsntlAtchFileMngTree( { docSeComCd }, ); - const { mutate: downloadTemplate } = useDownloadAttachmentByAtflId(); + const { mutate: downloadTemplate } = useDownloadAttachmentByAtflCd(); async function invalidateAttachmentQueries() { await queryClient.invalidateQueries({ @@ -376,10 +376,9 @@ function AttachmentsFormSection({

필수 첨부파일

- + - - + @@ -387,7 +386,6 @@ function AttachmentsFormSection({ 파일명 파일 확장자 - 파일 양식 파일첨부 @@ -400,36 +398,30 @@ function AttachmentsFormSection({ ) : ( essentialFiles.map((file) => { - const templateFiles = file.templateAtchFileList ?? []; + const atflCd = file.atchFileGroupId ?? ""; return ( - {file.esntlAtchFileNm} +
+ {file.esntlAtchFileNm} + {atflCd ? ( + + ) : null} +
{file.esntlAtchFileRmrk} - - {templateFiles.length === 0 ? ( - - - ) : ( -
- {templateFiles.map((templateFile) => ( - downloadTemplate(templateFile.atflId)} - > - - {templateFile.orgnlFileNm || "다운로드"} - - ))} -
- )} -
{uploadedFiles[file.esntlAtchFileId]?.length > 0 && (