|
|
@@ -6,7 +6,7 @@ import {
|
|
|
doctorMethod,
|
|
|
departmentsMethod,
|
|
|
planEditMethod,
|
|
|
- tagsSearchMethod,
|
|
|
+ allTagsSearchMethod,
|
|
|
} from '@/request/api/follow.api';
|
|
|
import { useRequest } from 'alova/client';
|
|
|
import {
|
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
VxeUI,
|
|
|
type VxeFormInstance,
|
|
|
} from 'vxe-pc-ui';
|
|
|
+import { list2Groups } from '@/tools/data';
|
|
|
|
|
|
type FollowModel = Partial<PlanModel>;
|
|
|
|
|
|
@@ -46,7 +47,7 @@ const { data: departmentsData, loading: depDataLoading } = useRequest(department
|
|
|
initialData: { total: 0, data: [] },
|
|
|
});
|
|
|
// 获取患者标签
|
|
|
-const { data: tagData, loading: tagDataLoading } = useRequest(tagsSearchMethod, {
|
|
|
+const { data: tagData, loading: tagDataLoading } = useRequest(allTagsSearchMethod, {
|
|
|
initialData: { total: 0, data: [] },
|
|
|
});
|
|
|
|
|
|
@@ -169,8 +170,15 @@ const patientsForm = reactive<VxeFormProps<PlanModel['filter']>>({
|
|
|
props: {
|
|
|
placeholder: '患者标签',
|
|
|
loading: tagDataLoading,
|
|
|
- options: computed(() => tagData.value.data),
|
|
|
+ optionGroups: computed(() =>
|
|
|
+ list2Groups(
|
|
|
+ tagData.value.data.filter((tag) => !tag.disabled),
|
|
|
+ 'category',
|
|
|
+ (key) => ({ 1: '系统标签', 2: '个人标签' })[key]!
|
|
|
+ )
|
|
|
+ ),
|
|
|
optionProps: { value: 'id', label: 'name' },
|
|
|
+ optionGroupProps: { options: 'groups' },
|
|
|
clearable: true,
|
|
|
multiple: true,
|
|
|
filterable: true,
|