feat(division): change compoent combobox to tree select
This commit is contained in:
@@ -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 Cell from '~/components/pub/custom-ui/doc-entry/cell.vue'
|
||||||
import Field from '~/components/pub/custom-ui/doc-entry/field.vue'
|
import Field from '~/components/pub/custom-ui/doc-entry/field.vue'
|
||||||
import Label from '~/components/pub/custom-ui/doc-entry/label.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
|
// Types
|
||||||
import type { DivisionFormData } from '~/schemas/division.schema.ts'
|
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 type z from 'zod'
|
||||||
import { toTypedSchema } from '@vee-validate/zod'
|
import { toTypedSchema } from '@vee-validate/zod'
|
||||||
import { useForm } from 'vee-validate'
|
import { useForm } from 'vee-validate'
|
||||||
|
import { convertDivisionToTreeItems } from '~/handlers/_shared.handler'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
schema: z.ZodSchema<any>
|
schema: z.ZodSchema<any>
|
||||||
@@ -90,15 +92,16 @@ function onCancelForm() {
|
|||||||
<Cell>
|
<Cell>
|
||||||
<Label height="compact">Divisi Induk</Label>
|
<Label height="compact">Divisi Induk</Label>
|
||||||
<Field :errMessage="errors.division">
|
<Field :errMessage="errors.division">
|
||||||
<Combobox
|
<TreeSelect
|
||||||
id="division"
|
id="division"
|
||||||
v-model="division"
|
v-model="division"
|
||||||
v-bind="divisionAttrs"
|
v-bind="divisionAttrs"
|
||||||
:items="divisions"
|
:data="convertDivisionToTreeItems(props.divisions)"
|
||||||
:disabled="isLoading || isReadonly"
|
:disabled="isLoading || isReadonly"
|
||||||
placeholder="Pilih Divisi Induk"
|
placeholder="Pilih Divisi Induk"
|
||||||
search-placeholder="Cari divisi"
|
search-placeholder="Cari divisi"
|
||||||
empty-message="Divisi tidak ditemukan"
|
empty-message="Divisi tidak ditemukan"
|
||||||
|
:on-fetch-children="async (_parentId: string) => {}"
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
</Cell>
|
</Cell>
|
||||||
|
|||||||
Reference in New Issue
Block a user