41 lines
981 B
TypeScript
41 lines
981 B
TypeScript
import type { ColumnDef } from "@tanstack/react-table";
|
|
import type { Template } from "./template-interface";
|
|
import dayjs from "dayjs";
|
|
|
|
export const columns: ColumnDef<Template>[] = [
|
|
{
|
|
id: "no",
|
|
header: "NO",
|
|
cell: ({ row, table }) => {
|
|
const totalRows = table.getRowCount();
|
|
const currentPage = table.getState().pagination.pageIndex;
|
|
const pageSize = table.getState().pagination.pageSize;
|
|
return totalRows - (currentPage * pageSize + row.index);
|
|
},
|
|
},
|
|
{
|
|
accessorKey: "tmpltNm",
|
|
header: "템플릿명",
|
|
},
|
|
{
|
|
accessorKey: "tmpltSeNm",
|
|
header: "템플릿분류",
|
|
},
|
|
{
|
|
accessorKey: "useYn",
|
|
header: "사용여부",
|
|
},
|
|
{
|
|
accessorKey: "mdfrNm",
|
|
header: "최종수정자",
|
|
},
|
|
{
|
|
accessorKey: "mdfcnDt",
|
|
header: "최종수정일",
|
|
cell: ({ row }) => {
|
|
const date = row.getValue("mdfcnDt") as string;
|
|
return date ? dayjs(date).format("YYYY-MM-DD") : "";
|
|
},
|
|
},
|
|
];
|