diff --git a/src/pages/SecurityEvents.tsx b/src/pages/SecurityEvents.tsx index a1ade21..6c2d5da 100644 --- a/src/pages/SecurityEvents.tsx +++ b/src/pages/SecurityEvents.tsx @@ -4,6 +4,12 @@ import { ReloadOutlined, SafetyOutlined } from '@ant-design/icons' import { api } from '@/services/http-client' import dayjs from 'dayjs' +const contentTypeLabels: Record = { + text: '文本', image: '图片', chat: '聊天', knowledge_item: '知识点', knowledge_base: '知识库', +} +const riskLabels: Record = { critical: '严重', high: '高', medium: '中', low: '低' } +const resultLabels: Record = { pending: '待审核', passed: '通过', blocked: '拦截' } + const { Title } = Typography export default function SecurityEventsPage() { @@ -12,10 +18,10 @@ export default function SecurityEventsPage() { const cols = [ { title: '时间', dataIndex: 'createdAt', width: 140, render: (d: string) => dayjs(d).format('MM-DD HH:mm:ss') }, - { title: '类型', dataIndex: 'contentType', width: 100 }, + { title: '类型', dataIndex: 'contentType', width: 100, render: (v: string) => contentTypeLabels[v] || v }, { title: '用户', dataIndex: 'userId', width: 100, ellipsis: true , render: (_: any, r: any) => r.userName || r.userId }, - { title: '风险', dataIndex: 'riskLevel', width: 70, render: (v: string) => {v} }, - { title: '结果', dataIndex: 'result', width: 80, render: (v: string) => {v} }, + { title: '风险', dataIndex: 'riskLevel', width: 70, render: (v: string) => {riskLabels[v] || v} }, + { title: '结果', dataIndex: 'result', width: 80, render: (v: string) => {resultLabels[v] || v} }, { title: '匹配词', dataIndex: 'matchedWords', ellipsis: true, width: 150, render: (v: string) => v || '-' }, ]