fix(web): Phase 3 前端 UX/i18n 修复 — 名称解析/确认对话框/日历切换/删除替换
- ConsultationList: 批量解析患者/医生名称替代截断 UUID - PointsOrderList: 使用 product_name + 批量解析患者/核销人名称 - AppointmentList: 破坏性状态变更添加 Modal.confirm + 取消原因收集 - CalendarView: 添加 onPanelChange 回调支持月份切换 - DoctorSchedule: 日历视图切换月份自动刷新数据 - PointsRuleList: 移除无效删除按钮,Switch 添加启用/停用文字 - PointsProductList: 删除按钮替换为上架/下架 Switch - PatientSelect: 性别显示中文化 (male→男, female→女) - VitalSignsChart: API 失败时显示 Alert 错误提示 - PointsOrder 类型: 添加 product_name 字段
This commit is contained in:
@@ -94,17 +94,19 @@ export default function DoctorSchedule() {
|
||||
}, [page, pageSize, selectedDoctorId]);
|
||||
|
||||
// ---- 日历数据获取 ----
|
||||
const fetchCalendar = useCallback(async () => {
|
||||
const [calendarMonth, setCalendarMonth] = useState<Dayjs>(dayjs());
|
||||
|
||||
const fetchCalendar = useCallback(async (month?: Dayjs) => {
|
||||
if (!selectedDoctorId) {
|
||||
setCalendarData([]);
|
||||
return;
|
||||
}
|
||||
const target = month ?? calendarMonth;
|
||||
setCalendarLoading(true);
|
||||
try {
|
||||
const now = dayjs();
|
||||
const result = await appointmentApi.calendar({
|
||||
start_date: now.startOf('month').format('YYYY-MM-DD'),
|
||||
end_date: now.endOf('month').format('YYYY-MM-DD'),
|
||||
start_date: target.startOf('month').format('YYYY-MM-DD'),
|
||||
end_date: target.endOf('month').format('YYYY-MM-DD'),
|
||||
doctor_id: selectedDoctorId,
|
||||
});
|
||||
setCalendarData(result);
|
||||
@@ -113,7 +115,7 @@ export default function DoctorSchedule() {
|
||||
} finally {
|
||||
setCalendarLoading(false);
|
||||
}
|
||||
}, [selectedDoctorId]);
|
||||
}, [selectedDoctorId, calendarMonth]);
|
||||
|
||||
// 切换医护或视图模式时加载数据
|
||||
useEffect(() => {
|
||||
@@ -339,7 +341,13 @@ export default function DoctorSchedule() {
|
||||
) : (
|
||||
<Spin spinning={calendarLoading}>
|
||||
<div style={{ marginTop: 16 }}>
|
||||
<CalendarView schedules={calendarScheduleMap} />
|
||||
<CalendarView
|
||||
schedules={calendarScheduleMap}
|
||||
onPanelChange={(date) => {
|
||||
setCalendarMonth(date);
|
||||
fetchCalendar(date);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Spin>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user