fix: show user/kb names in LearningData page
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s

This commit is contained in:
wangdl 2026-06-19 12:48:01 +08:00
parent 8da90c721b
commit 129a9b9abc

View File

@ -45,8 +45,8 @@ export default function LearningData() {
const sessionColumns = [ const sessionColumns = [
{ title: 'ID', dataIndex: 'id', width: 100, ellipsis: true }, { title: 'ID', dataIndex: 'id', width: 100, ellipsis: true },
{ title: '用户', dataIndex: 'userId', width: 100, ellipsis: true }, { title: '用户', dataIndex: 'userId', width: 100, ellipsis: true, render: (_: any, r: any) => r.userName || r.userId },
{ title: '知识库', dataIndex: 'knowledgeBaseId', width: 100, ellipsis: true }, { title: '知识库', dataIndex: 'knowledgeBaseId', width: 100, ellipsis: true, render: (_: any, r: any) => r.kbName || r.knowledgeBaseId },
{ title: '模式', dataIndex: 'mode', width: 80 }, { title: '模式', dataIndex: 'mode', width: 80 },
{ title: '状态', dataIndex: 'status', width: 80, render: (s: string) => <Tag color={statusColors[s] || 'default'}>{sessionStatusLabels[s] || s}</Tag> }, { title: '状态', dataIndex: 'status', width: 80, render: (s: string) => <Tag color={statusColors[s] || 'default'}>{sessionStatusLabels[s] || s}</Tag> },
{ title: '时长(分)', dataIndex: 'durationSeconds', width: 80, render: (s: number) => s ? Math.round(s / 60) : '-' }, { title: '时长(分)', dataIndex: 'durationSeconds', width: 80, render: (s: number) => s ? Math.round(s / 60) : '-' },
@ -56,7 +56,7 @@ export default function LearningData() {
const analysisColumns = [ const analysisColumns = [
{ title: 'ID', dataIndex: 'id', width: 100, ellipsis: true }, { title: 'ID', dataIndex: 'id', width: 100, ellipsis: true },
{ title: '用户', dataIndex: 'userId', width: 100, ellipsis: true }, { title: '用户', dataIndex: 'userId', width: 100, ellipsis: true, render: (_: any, r: any) => r.userName || r.userId },
{ title: '摘要', dataIndex: 'summary', width: 200, ellipsis: true }, { title: '摘要', dataIndex: 'summary', width: 200, ellipsis: true },
{ title: '掌握度', dataIndex: 'masteryScore', width: 80, render: (s: number | null) => s != null ? `${s}%` : '-' }, { title: '掌握度', dataIndex: 'masteryScore', width: 80, render: (s: number | null) => s != null ? `${s}%` : '-' },
{ title: '薄弱点', dataIndex: 'weaknesses', width: 200, render: (w: string[]) => (w || []).join('、') || '-' }, { title: '薄弱点', dataIndex: 'weaknesses', width: 200, render: (w: string[]) => (w || []).join('、') || '-' },
@ -65,7 +65,7 @@ export default function LearningData() {
const aiUsageColumns = [ const aiUsageColumns = [
{ title: 'ID', dataIndex: 'id', width: 100, ellipsis: true }, { title: 'ID', dataIndex: 'id', width: 100, ellipsis: true },
{ title: '用户', dataIndex: 'userId', width: 100, ellipsis: true }, { title: '用户', dataIndex: 'userId', width: 100, ellipsis: true, render: (_: any, r: any) => r.userName || r.userId },
{ title: '模型', dataIndex: 'model', width: 140, ellipsis: true }, { title: '模型', dataIndex: 'model', width: 140, ellipsis: true },
{ title: '服务商', dataIndex: 'provider', width: 80 }, { title: '服务商', dataIndex: 'provider', width: 80 },
{ title: '输入 Token', dataIndex: 'inputTokens', width: 90 }, { title: '输入 Token', dataIndex: 'inputTokens', width: 90 },