refactor(web): 新增 useDictionary hook + 4 个页面下拉选项改用字典 API
- 新增 useDictionary hook 支持字典 API 获取 + fallback 降级 - DoctorList 科室/职称改用 useDictionary (health_department/health_title) - FollowUpTaskList 随访类型改用 useDictionary (health_follow_up_type) - ConsultationList 咨询类型改用 useDictionary (health_consultation_type) - FamilyMembersTab 家庭关系改用 useDictionary (health_relationship)
This commit is contained in:
@@ -3,8 +3,9 @@ import { Table, Button, Form, Input, Select, Drawer, message, Popconfirm, Space
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { patientApi, type FamilyMember, type CreateFamilyMemberReq } from '../../../api/health/patients';
|
||||
import { AuthButton } from '../../../components/AuthButton';
|
||||
import { useDictionary } from '../../../hooks/useDictionary';
|
||||
|
||||
const RELATIONSHIP_OPTIONS = [
|
||||
const RELATIONSHIP_FALLBACK = [
|
||||
{ label: '父母', value: 'parent' },
|
||||
{ label: '配偶', value: 'spouse' },
|
||||
{ label: '子女', value: 'child' },
|
||||
@@ -17,6 +18,7 @@ interface Props {
|
||||
}
|
||||
|
||||
export function FamilyMembersTab({ patientId }: Props) {
|
||||
const { options: RELATIONSHIP_OPTIONS } = useDictionary('health_relationship', RELATIONSHIP_FALLBACK);
|
||||
const [members, setMembers] = useState<FamilyMember[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [drawerOpen, setDrawerOpen] = useState(false);
|
||||
|
||||
Reference in New Issue
Block a user