import { Tag } from 'antd'; import { ProTable, type ProColumns } from '@ant-design/pro-components'; import PageContainer from '@/components/common/PageContainer'; import { ruleApi, ExceptionCodeResp } from '@/api/rule'; const DIRECTION_COLOR = { PLUS: 'success', MINUS: 'error' } as const; export default function ExceptionCodeList() { const columns: ProColumns[] = [ { title: '예외코드', dataIndex: 'exceptionCode', width: 120, search: false, render: (_, r) => {r.exceptionCode} }, { title: '예외명', dataIndex: 'exceptionName', width: 160, search: false }, { title: '카테고리', dataIndex: 'category', width: 110, search: false }, { title: '방향', dataIndex: 'direction', width: 80, align: 'center', search: false, render: (_, r) => {r.direction === 'PLUS' ? '가산 (+)' : '차감 (-)'}, }, { title: '자동계산', dataIndex: 'autoCalcYn', width: 90, align: 'center', search: false, render: (_, r) => r.autoCalcYn === 'Y' ? 자동 : 수동, }, { title: '승인 필요', dataIndex: 'approvalRequired', width: 90, align: 'center', search: false, render: (_, r) => r.approvalRequired === 'Y' ? 필요 : 불요, }, { title: '과세', dataIndex: 'taxIncluded', width: 80, align: 'center', search: false, render: (_, r) => r.taxIncluded === 'Y' ? 과세 : 비과세, }, { title: '설명', dataIndex: 'description', ellipsis: true, search: false }, { title: '활성', dataIndex: 'isActive', width: 70, align: 'center', search: false, render: (_, r) => {r.isActive === 'Y' ? 'Y' : 'N'}, }, ]; return ( rowKey="exceptionCode" columns={columns} search={false} request={async () => { const list = await ruleApi.exceptionCodes(); return { data: list, total: list.length, success: true }; }} pagination={{ pageSize: 50, showTotal: (t) => `총 ${t}건` }} options={{ density: false, fullScreen: true, reload: true, setting: true }} dateFormatter="string" /> ); }