Files
simrsx-fe/app/components/content/document-upload/main.vue
2025-12-05 14:15:54 +07:00

23 lines
835 B
Vue

<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>