diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-04-28 02:13:30 +0000 |
| commit | ef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch) | |
| tree | 345251a3ed0f4429716fa5edaa31024d8f4cb560 /lib/vendor-rfq-response/vendor-tbe-table/tbe-table-columns.tsx | |
| parent | 9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff) | |
~20250428 작업사항
Diffstat (limited to 'lib/vendor-rfq-response/vendor-tbe-table/tbe-table-columns.tsx')
| -rw-r--r-- | lib/vendor-rfq-response/vendor-tbe-table/tbe-table-columns.tsx | 65 |
1 files changed, 49 insertions, 16 deletions
diff --git a/lib/vendor-rfq-response/vendor-tbe-table/tbe-table-columns.tsx b/lib/vendor-rfq-response/vendor-tbe-table/tbe-table-columns.tsx index 7a95d7ed..f664d9a3 100644 --- a/lib/vendor-rfq-response/vendor-tbe-table/tbe-table-columns.tsx +++ b/lib/vendor-rfq-response/vendor-tbe-table/tbe-table-columns.tsx @@ -31,6 +31,8 @@ interface GetColumnsProps { openCommentSheet: (vendorId: number) => void handleDownloadTbeTemplate: (tbeId: number, vendorId: number, rfqId: number) => void handleUploadTbeResponse: (tbeId: number, vendorId: number, rfqId: number, vendorResponseId:number) => void + openVendorContactsDialog: (rfqId: number, rfq: TbeVendorFields) => void // 수정된 시그니처 + } /** @@ -42,6 +44,7 @@ export function getColumns({ openCommentSheet, handleDownloadTbeTemplate, handleUploadTbeResponse, + openVendorContactsDialog }: GetColumnsProps): ColumnDef<TbeVendorFields>[] { // ---------------------------------------------------------------- // 1) Select 컬럼 (체크박스) @@ -112,7 +115,30 @@ export function getColumns({ ) } - + + if (cfg.id === "rfqCode") { + const rfq = row.original; + const rfqId = rfq.rfqId; + + // 협력업체 이름을 클릭할 수 있는 버튼으로 렌더링 + const handleVendorNameClick = () => { + if (rfqId) { + openVendorContactsDialog(rfqId, rfq); // vendor 전체 객체 전달 + } else { + toast.error("협력업체 ID를 찾을 수 없습니다."); + } + }; + + return ( + <Button + variant="link" + className="p-0 h-auto text-left font-normal justify-start hover:underline" + onClick={handleVendorNameClick} + > + {val as string} + </Button> + ); + } if (cfg.id === "rfqVendorStatus") { const statusVal = row.original.rfqVendorStatus if (!statusVal) return null @@ -173,21 +199,28 @@ export function getColumns({ } return ( - <div> - <Button - variant="ghost" - size="sm" - className="h-8 w-8 p-0 group relative" - onClick={handleClick} - aria-label={commCount > 0 ? `View ${commCount} comments` : "Add comment"} - > - <div className="flex items-center justify-center relative"> - <MessageSquare className="h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors" /> - </div> - {commCount > 0 && <span className="absolute -top-1 -right-1 inline-flex h-2 w-2 rounded-full bg-red-500"></span>} - <span className="sr-only">{commCount > 0 ? `${commCount} Comments` : "Add Comment"}</span> - </Button> - </div> + <Button + variant="ghost" + size="sm" + className="relative h-8 w-8 p-0 group" + onClick={handleClick} + aria-label={ + commCount > 0 ? `View ${commCount} comments` : "No comments" + } + > + <MessageSquare className="h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors" /> + {commCount > 0 && ( + <Badge + variant="secondary" + className="pointer-events-none absolute -top-1 -right-1 h-4 min-w-[1rem] p-0 text-[0.625rem] leading-none flex items-center justify-center" + > + {commCount} + </Badge> + )} + <span className="sr-only"> + {commCount > 0 ? `${commCount} Comments` : "No Comments"} + </span> + </Button> ) }, enableSorting: false, |
