fix: audit issues - field mismatches, missing endpoints, data loss

- Report frontends: createdAt→uploadedAt field alignment with backend
- Dashboard: fix pending reports endpoint /api/reports/pending
- FollowUpListPage: status labels upcoming/cancelled
- MedicationController: add PUT/DELETE endpoints + service methods
- FollowUpController: add DELETE endpoint, Notes to CreateRequest
- Auth: UpdateProfileRequest includes doctor fields
- Auth: login restores soft-deleted users instead of crashing
This commit is contained in:
MingNian
2026-05-24 13:24:21 +08:00
parent d6a432aec4
commit ede4a8d29e
11 changed files with 111 additions and 19 deletions

View File

@@ -57,7 +57,7 @@ export function DashboardPage() {
const [patients, consultations, reports, followUps] = await Promise.all([
api.get<RawPatient[]>('/api/patients'),
api.get<RawConsultation[]>('/api/consultations'),
api.get<RawReport[]>('/api/reports?status=pending'),
api.get<RawReport[]>('/api/reports/pending'),
api.get<RawFollowUp[]>('/api/follow-ups'),
]);
setStats({

View File

@@ -16,9 +16,9 @@ export function FollowUpListPage() {
const statusLabel = (s: string) => {
switch (s) {
case 'pending': return { text: '待随访', color: '#F59E0B', bg: '#FFF8E6' };
case 'upcoming': return { text: '待随访', color: '#F59E0B', bg: '#FFF8E6' };
case 'completed': return { text: '已完成', color: '#20C997', bg: '#E6F9F2' };
case 'missed': return { text: '已错过', color: '#EF4444', bg: '#FEE9E9' };
case 'cancelled': return { text: '已取消', color: '#EF4444', bg: '#FEE9E9' };
default: return { text: s, color: '#9BA0B4', bg: '#F5F6F9' };
}
};

View File

@@ -7,7 +7,7 @@ interface RawReport {
imageUrls: string[]; status: string; riskLevel?: string;
summary?: string; suggestions?: string;
patientName?: string; doctorName?: string;
createdAt: string; completedAt?: string;
uploadedAt: string; completedAt?: string;
items?: RawItem[];
}
@@ -81,7 +81,7 @@ export function ReportDetailPage() {
<div style={{ marginTop: 8, fontSize: 13, color: '#9BA0B4' }}>
{report.patientName || '未知'} &nbsp;|&nbsp;
{categoryMap[report.category] || report.category} &nbsp;|&nbsp;
{report.createdAt?.split('T')[0]}
{report.uploadedAt?.split('T')[0]}
</div>
</div>
<span style={{

View File

@@ -4,7 +4,7 @@ import { api } from '../../services/api-client';
interface RawReportItem {
id: string; patientId: string; patientName?: string;
title: string; category: string; status: string; createdAt: string;
title: string; category: string; status: string; uploadedAt: string;
}
export function ReportListPage() {
@@ -52,7 +52,7 @@ export function ReportListPage() {
{s.text}
</span>
</td>
<td style={{ padding: '12px 20px', color: '#9BA0B4' }}>{r.createdAt?.split('T')[0]}</td>
<td style={{ padding: '12px 20px', color: '#9BA0B4' }}>{r.uploadedAt?.split('T')[0]}</td>
<td style={{ padding: '12px 20px' }}>
<Link to={`/reports/${r.id}`} style={{
color: '#4F6EF7', fontSize: 12, fontWeight: 600,