refactor(glob:form): update form handling and type definitions

- Migrate from Form component to vee-validate useForm
- Update combobox component to support number values
- Modify base model ID type for mock data
- Improve type safety in treatment report schema
- Add proper form submission handling
This commit is contained in:
Khafid Prayoga
2025-11-25 20:46:04 +07:00
parent 3fbcdf9e2a
commit 6a29fdfd50
7 changed files with 86 additions and 40 deletions
@@ -5,7 +5,7 @@ import { type Item } from './index'
const props = defineProps<{
id?: string
modelValue?: string
modelValue?: string | number
items: Item[]
placeholder?: string
searchPlaceholder?: string
@@ -15,8 +15,8 @@ const props = defineProps<{
}>()
const emit = defineEmits<{
'update:modelValue': [value: string]
'update:searchText': [value: string]
'update:modelValue': [value: string | number]
'update:searchText': [value: string | number]
}>()
const open = ref(false)
+4 -4
View File
@@ -1,5 +1,5 @@
export interface Item {
value: string
value: string | number
label: string
code?: string
priority?: number
@@ -7,12 +7,12 @@ export interface Item {
export function recStrToItem(input: Record<string, string>): Item[] {
const items: Item[] = []
let idx = 0;
let idx = 0
for (const key in input) {
if (input.hasOwnProperty(key)) {
items.push({
value: key || ('unknown-' + idx),
label: input[key] || ('unknown-' + idx),
value: key || 'unknown-' + idx,
label: input[key] || 'unknown-' + idx,
})
}
idx++