update: fix-02
This commit is contained in:
@@ -36,6 +36,15 @@ const statusConfig: Record<CaseStatus, { color: string; label: string }> = {
|
||||
completed: { color: 'green', label: '已完成' },
|
||||
};
|
||||
|
||||
const splitDateTime = (raw: string): { date: string; time: string } => {
|
||||
if (!raw) return { date: '-', time: '-' };
|
||||
const normalized = raw.trim().replace(' ', 'T');
|
||||
if (!normalized.includes('T')) return { date: normalized, time: '-' };
|
||||
const [datePart, timePartRaw = ''] = normalized.split('T');
|
||||
const cleanedTime = timePartRaw.replace('Z', '').split('.')[0] || '-';
|
||||
return { date: datePart || '-', time: cleanedTime };
|
||||
};
|
||||
|
||||
const CaseList: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const qc = useQueryClient();
|
||||
@@ -71,18 +80,19 @@ const CaseList: React.FC = () => {
|
||||
{
|
||||
title: '案件编号',
|
||||
dataIndex: 'caseNo',
|
||||
width: 180,
|
||||
width: 120,
|
||||
ellipsis: true,
|
||||
render: (text, record) => (
|
||||
<a onClick={() => navigate(`/cases/${record.id}/workspace`)}>{text}</a>
|
||||
),
|
||||
},
|
||||
{ title: '案件名称', dataIndex: 'title', ellipsis: true },
|
||||
{ title: '受害人', dataIndex: 'victimName', width: 100 },
|
||||
{ title: '承办人', dataIndex: 'handler', width: 100 },
|
||||
{ title: '案件名称', dataIndex: 'title', width: 140, ellipsis: true },
|
||||
{ title: '受害人', dataIndex: 'victimName', width: 80 },
|
||||
{ title: '承办人', dataIndex: 'handler', width: 80 },
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
width: 100,
|
||||
width: 60,
|
||||
render: (s: CaseStatus) => (
|
||||
<Tag color={statusConfig[s].color}>{statusConfig[s].label}</Tag>
|
||||
),
|
||||
@@ -96,7 +106,7 @@ const CaseList: React.FC = () => {
|
||||
{
|
||||
title: '识别金额(元)',
|
||||
dataIndex: 'totalAmount',
|
||||
width: 140,
|
||||
width: 120,
|
||||
align: 'right',
|
||||
render: (v: number) =>
|
||||
v > 0 ? (
|
||||
@@ -110,11 +120,23 @@ const CaseList: React.FC = () => {
|
||||
{
|
||||
title: '更新时间',
|
||||
dataIndex: 'updatedAt',
|
||||
width: 170,
|
||||
width: 110,
|
||||
render: (raw: string) => {
|
||||
const { date, time } = splitDateTime(raw);
|
||||
return (
|
||||
<div style={{ lineHeight: 1.2 }}>
|
||||
<Typography.Text style={{ fontSize: 12 }}>{date}</Typography.Text>
|
||||
<br />
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{time}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 160,
|
||||
width: 108,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
@@ -207,6 +229,7 @@ const CaseList: React.FC = () => {
|
||||
columns={columns}
|
||||
dataSource={cases}
|
||||
loading={isLoading}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{ pageSize: 10, showSizeChanger: true, showTotal: (t) => `共 ${t} 条` }}
|
||||
/>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user