✨ feat (user): implement user entry form with status and type selection
This commit is contained in:
@@ -11,6 +11,10 @@ const data = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => emit('update:modelValue', val),
|
||||
})
|
||||
const items = [
|
||||
{ value: 'doctor', label: 'Dokter' },
|
||||
{ value: 'nurse', label: 'Perawat' },
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -21,13 +25,25 @@ const data = computed({
|
||||
<FieldGroup :column="2">
|
||||
<Label>Username</Label>
|
||||
<Field>
|
||||
<Input type="text" name="username" />
|
||||
<Input v-model="data.name" />
|
||||
</Field>
|
||||
</FieldGroup>
|
||||
<FieldGroup :column="2">
|
||||
<Label>Password</Label>
|
||||
<Field>
|
||||
<Input type="password" name="password" />
|
||||
<Input v-model="data.password" type="password" />
|
||||
</Field>
|
||||
</FieldGroup>
|
||||
<FieldGroup :column="2">
|
||||
<Label>Status</Label>
|
||||
<Field>
|
||||
<Input v-model="data.status" />
|
||||
</Field>
|
||||
</FieldGroup>
|
||||
<FieldGroup :column="2">
|
||||
<Label>Tipe</Label>
|
||||
<Field>
|
||||
<Select v-model="data.type" :items="items" placeholder="Pilih jenis" />
|
||||
</Field>
|
||||
</FieldGroup>
|
||||
</Block>
|
||||
|
||||
@@ -3,8 +3,9 @@ import Action from '~/components/pub/custom-ui/nav-footer/ba-dr-su.vue'
|
||||
|
||||
const data = ref({
|
||||
name: '',
|
||||
specialization: '',
|
||||
hospital: '',
|
||||
password: '',
|
||||
status: '',
|
||||
type: '',
|
||||
})
|
||||
|
||||
function onClick(type: string) {
|
||||
@@ -23,9 +24,8 @@ function onClick(type: string) {
|
||||
<Icon name="i-lucide-user" class="me-2" />
|
||||
<span class="font-semibold">Tambah</span> Dokter
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<AppDoctorEntryForm v-model="data" />
|
||||
<AppDoctorEntryForm v-if="data.type === 'doctor'" v-model="data" />
|
||||
</div>
|
||||
<AppUserEntryForm v-model="data" />
|
||||
<div class="my-2 flex justify-end py-2">
|
||||
|
||||
Reference in New Issue
Block a user