feat(division): change compoent combobox to tree select

This commit is contained in:
riefive
2025-10-03 11:03:19 +07:00
parent 539a1cefb0
commit 1837afce6c
+6 -3
View File
@@ -4,7 +4,8 @@ import Block from '~/components/pub/custom-ui/doc-entry/block.vue'
import Cell from '~/components/pub/custom-ui/doc-entry/cell.vue'
import Field from '~/components/pub/custom-ui/doc-entry/field.vue'
import Label from '~/components/pub/custom-ui/doc-entry/label.vue'
import Combobox from '~/components/pub/custom-ui/form/combobox.vue'
// import Combobox from '~/components/pub/custom-ui/form/combobox.vue'
import TreeSelect from '~/components/pub/base/select-tree/tree-select.vue'
// Types
import type { DivisionFormData } from '~/schemas/division.schema.ts'
@@ -13,6 +14,7 @@ import type { DivisionFormData } from '~/schemas/division.schema.ts'
import type z from 'zod'
import { toTypedSchema } from '@vee-validate/zod'
import { useForm } from 'vee-validate'
import { convertDivisionToTreeItems } from '~/handlers/_shared.handler'
interface Props {
schema: z.ZodSchema<any>
@@ -90,15 +92,16 @@ function onCancelForm() {
<Cell>
<Label height="compact">Divisi Induk</Label>
<Field :errMessage="errors.division">
<Combobox
<TreeSelect
id="division"
v-model="division"
v-bind="divisionAttrs"
:items="divisions"
:data="convertDivisionToTreeItems(props.divisions)"
:disabled="isLoading || isReadonly"
placeholder="Pilih Divisi Induk"
search-placeholder="Cari divisi"
empty-message="Divisi tidak ditemukan"
:on-fetch-children="async (_parentId: string) => {}"
/>
</Field>
</Cell>