60 lines
1.8 KiB
TypeScript
60 lines
1.8 KiB
TypeScript
import dayjs from "dayjs";
|
|
import { createColumnHelper } from "@tanstack/react-table";
|
|
import { type LinkLog } from "@/entities/link";
|
|
|
|
const columnHelper = createColumnHelper<LinkLog>();
|
|
|
|
const columns = [
|
|
columnHelper.accessor('rownum', {
|
|
id: 'rownum',
|
|
header: 'NO',
|
|
}),
|
|
columnHelper.accessor('intg_link_sn', {
|
|
id: 'intg_link_sn',
|
|
header: '연계일련번호',
|
|
}),
|
|
columnHelper.accessor('link_nm', {
|
|
id: 'link_nm',
|
|
header: '연계 명',
|
|
}),
|
|
columnHelper.accessor('link_excn_stp_nm', {
|
|
id: 'link_excn_stp_nm',
|
|
header: '연계실행단계',
|
|
cell: (info) => (info.getValue() ? info.getValue() : '-'),
|
|
}),
|
|
columnHelper.display({
|
|
id: 'link_rslt_nm',
|
|
header: '연계실행결과',
|
|
cell: (info) => {
|
|
const isSucc = info.row.original.link_rslt_nm.trim() === 'SUCC';
|
|
return <span className={`${isSucc ? 'text-[rgb(53,162,235)]' : 'text-[rgb(255,99,132)]'}`}>{isSucc ? '성공' : '실패'}</span>
|
|
},
|
|
}),
|
|
columnHelper.accessor('link_err_nm', {
|
|
id: 'link_err_nm',
|
|
header: '연계오류코드',
|
|
cell: (info) => (info.getValue() ? info.getValue() : '-'),
|
|
}),
|
|
columnHelper.accessor('err_cn', {
|
|
id: 'err_cn',
|
|
header: '연계오류메세지',
|
|
cell: (info) => (
|
|
<div
|
|
className="max-w-[500px] truncate"
|
|
title={info.getValue() ?? ''}
|
|
>
|
|
{info.getValue() || '-'}
|
|
</div>
|
|
),
|
|
}),
|
|
columnHelper.accessor('log_crt_dt', {
|
|
id: 'log_crt_dt',
|
|
header: '연계실행일자',
|
|
cell: (info) => {
|
|
const date = dayjs(info.getValue());
|
|
return date.format('YYYY-MM-DD HH:mm');
|
|
}
|
|
}),
|
|
];
|
|
|
|
export { columns }; |