Fix: refactor Kai CRUD UI to no redirect

This commit is contained in:
Hasyim Kai
2025-12-05 14:15:54 +07:00
parent 89b6163da8
commit 3e812db8eb
34 changed files with 396 additions and 353 deletions

No files matched your search

@@ -0,0 +1,22 @@
<script setup lang="ts">
import { crudQueryParamsMode } from '~/lib/system-constants';
import List from './list.vue'
import Add from './add.vue'
import Edit from './edit.vue'
const props = defineProps<{
encounter_id: number
}>()
const { crudQueryParams, goToEntry } = useQueryCRUD()
</script>
<template>
<List v-if="crudQueryParams.mode === crudQueryParamsMode.list" :encounter_id="encounter_id" :redirectToForm="goToEntry" />
<Add v-else-if="crudQueryParams.mode === crudQueryParamsMode.entry && !crudQueryParams.recordId" :encounter_id="encounter_id" />
<Edit v-else-if="crudQueryParams.mode === crudQueryParamsMode.entry && crudQueryParams.recordId"
:encounter_id="encounter_id"
:record_id="crudQueryParams.recordId" />
<List v-else :encounter_id="encounter_id" :redirectToForm="goToEntry" />
</template>