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:
@@ -13,9 +13,10 @@ export interface ScheduleItem {
|
||||
|
||||
interface Props {
|
||||
schedules: Record<string, ScheduleItem[]>;
|
||||
onPanelChange?: (date: Dayjs) => void;
|
||||
}
|
||||
|
||||
export function CalendarView({ schedules }: Props) {
|
||||
export function CalendarView({ schedules, onPanelChange }: Props) {
|
||||
const cellRender = (date: Dayjs) => {
|
||||
const key = date.format('YYYY-MM-DD');
|
||||
const items = schedules[key];
|
||||
@@ -38,5 +39,10 @@ export function CalendarView({ schedules }: Props) {
|
||||
);
|
||||
};
|
||||
|
||||
return <Calendar cellRender={cellRender} />;
|
||||
return (
|
||||
<Calendar
|
||||
cellRender={cellRender}
|
||||
onPanelChange={(date) => onPanelChange?.(date)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ export function PatientSelect({ value, onChange, placeholder }: Props) {
|
||||
>([]);
|
||||
const [fetching, setFetching] = useState(false);
|
||||
|
||||
const genderMap: Record<string, string> = { male: '男', female: '女' };
|
||||
|
||||
const handleSearch = useCallback(async (search: string) => {
|
||||
if (!search || search.length < 1) {
|
||||
setOptions([]);
|
||||
@@ -28,7 +30,7 @@ export function PatientSelect({ value, onChange, placeholder }: Props) {
|
||||
setOptions(
|
||||
result.data.map((p) => ({
|
||||
value: p.id,
|
||||
label: `${p.name}${p.gender ? ` (${p.gender})` : ''}`,
|
||||
label: `${p.name}${p.gender ? ` (${genderMap[p.gender] || p.gender})` : ''}`,
|
||||
})),
|
||||
);
|
||||
} finally {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Line } from '@ant-design/charts';
|
||||
import { Spin, Empty, Select, Space } from 'antd';
|
||||
import { Spin, Empty, Select, Space, Alert } from 'antd';
|
||||
import { healthDataApi } from '../../../api/health/healthData';
|
||||
|
||||
interface Props {
|
||||
@@ -20,17 +20,21 @@ export function VitalSignsChart({ patientId, indicator: initialIndicator }: Prop
|
||||
const [indicator, setIndicator] = useState(initialIndicator ?? 'systolic_bp_morning');
|
||||
const [data, setData] = useState<{ date: string; value: number }[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (!patientId || !indicator) return;
|
||||
setLoading(true);
|
||||
setError(false);
|
||||
healthDataApi
|
||||
.getIndicatorTimeseries(patientId, indicator)
|
||||
.then(setData)
|
||||
.catch(() => setError(true))
|
||||
.finally(() => setLoading(false));
|
||||
}, [patientId, indicator]);
|
||||
|
||||
if (loading) return <Spin />;
|
||||
if (error) return <Alert type="error" message="加载数据失败,请稍后重试" />;
|
||||
if (data.length === 0) return <Empty description="暂无数据" />;
|
||||
|
||||
const config = {
|
||||
|
||||
Reference in New Issue
Block a user