feat: add learning records and attachments tabs to profile Drawer, plus PDF report button

This commit is contained in:
2026-07-06 17:00:13 +08:00
parent 09eb9ca9e0
commit b4fa3ab1fd

View File

@@ -647,8 +647,33 @@ const StudentsPage: React.FC = () => {
</Descriptions>
) : <div style={{ color: '#999' }}></div>,
},
{
key: 'learning', label: `学情记录 (${drawerData.learningRecords?.length || 0})`,
children: drawerData.learningRecords?.length ? (
<Table rowKey="id" size="small" pagination={false} dataSource={drawerData.learningRecords} columns={[
{ title: '日期', dataIndex: 'recordDate', width: 100 },
{ title: '类型', dataIndex: 'recordType', width: 80 },
{ title: '内容', dataIndex: 'content', ellipsis: true },
{ title: '跟进方式', dataIndex: 'followUpMethod', width: 100 },
{ title: '下一步', dataIndex: 'nextStep', width: 100 },
]} />
) : <div style={{ color: '#999' }}></div>,
},
{
key: 'attachments', label: `附件 (${drawerData.attachments?.length || 0})`,
children: drawerData.attachments?.length ? (
<Table rowKey="id" size="small" pagination={false} dataSource={drawerData.attachments} columns={[
{ title: '分类', dataIndex: 'category', width: 80 },
{ title: '文件名', dataIndex: 'fileName', ellipsis: true },
{ title: '大小', dataIndex: 'fileSize', width: 80, render: (v: number) => v ? `${(v / 1024).toFixed(1)} KB` : '-' },
]} />
) : <div style={{ color: '#999' }}></div>,
},
]} />
)}
<Button type="primary" icon={<DownloadOutlined />} style={{ marginTop: 16 }} onClick={() => {
const token = localStorage.getItem('token');
window.open(`/api/archive/${drawerData?.student?.id}/report?token=${token}`, '_blank');
}}></Button>
</Drawer>
</div>
);