- 权限路由守卫:静默重定向改为显示 403 页面,使用 useLocation 替代 window.location.hash,补全缺失路由权限条目 - 随访状态筛选:usePaginatedData hook 添加 filters 变化监听自动刷新 - 告警操作:后端 acknowledge/dismiss/resolve 改返回 AlertResponse (含 patient_name),前端增加 active 状态兼容和错误反馈 - 咨询患者名:后端 create/get/close_session 增加 patient_name 和 doctor_name enrichment,前端 EntityName 空字符串处理
24 lines
622 B
TypeScript
24 lines
622 B
TypeScript
import { Tooltip, Typography } from 'antd';
|
|
|
|
interface EntityNameProps {
|
|
name?: string | null;
|
|
id?: string;
|
|
fallbackLabel?: string;
|
|
}
|
|
|
|
export function EntityName({ name, id, fallbackLabel = '未知' }: EntityNameProps) {
|
|
if (name !== undefined && name !== null && name !== '') return <span>{name}</span>;
|
|
|
|
if (id) {
|
|
return (
|
|
<Tooltip title={`ID: ${id.slice(0, 8)}...`}>
|
|
<Typography.Text type="secondary" style={{ cursor: 'help' }}>
|
|
{fallbackLabel}
|
|
</Typography.Text>
|
|
</Tooltip>
|
|
);
|
|
}
|
|
|
|
return <Typography.Text type="secondary">{fallbackLabel}</Typography.Text>;
|
|
}
|