Добавлен лоадер при открытии модальных окон

This commit is contained in:
brusnitsyn
2025-12-19 09:00:14 +09:00
parent 0a1304e55b
commit b86cdaec90
2 changed files with 25 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
<script setup> <script setup>
import { NModal, NDataTable, NSpace, NFlex, NButton, NForm, NFormItem, NInput, NDatePicker, NDivider, NSwitch, NTag } from 'naive-ui' import { NModal, NDataTable, NSpace, NFlex, NButton, NForm, NFormItem, NInput, NDatePicker, NDivider, NSpin, NTag } from 'naive-ui'
import ArchiveHistoryMoveModal from '../ArchiveHistoryMoveModal/Index.vue' import ArchiveHistoryMoveModal from '../ArchiveHistoryMoveModal/Index.vue'
import {computed, ref, watch} from "vue"; import {computed, ref, watch} from "vue";
import {useMedicalHistoryFilter} from "../../../Composables/useMedicalHistoryFilter.js"; import {useMedicalHistoryFilter} from "../../../Composables/useMedicalHistoryFilter.js";
@@ -156,7 +156,7 @@ watch(() => props.patientId, async (newId) => {
</script> </script>
<template> <template>
<NModal v-model:show="open" preset="card" class="max-w-4xl" closable @close="onCloseWithoutSave"> <NModal v-model:show="open" preset="card" class="max-w-4xl relative" closable @close="onCloseWithoutSave">
<template #header> <template #header>
{{ patient.info?.medcardnum }} {{ patient.info?.family }} {{ patient.info?.name }} {{ patient.info?.ot }} {{ patient.info?.medcardnum }} {{ patient.info?.family }} {{ patient.info?.name }} {{ patient.info?.ot }}
</template> </template>
@@ -194,6 +194,10 @@ watch(() => props.patientId, async (newId) => {
</NSpace> </NSpace>
</NFlex> </NFlex>
</template> </template>
<div v-show="loading" class="absolute inset-0 z-10 bg-white flex items-center justify-center">
<NSpin :show="true" />
</div>
</NModal> </NModal>
<ArchiveHistoryMoveModal @history-updated="onUpdateHistory" @close-without-save="selectedArchiveHistoryId = null" :is-create-new="isCreateNewArchiveHistoryModal" v-model:open="showArchiveHistoryModal" :active-history-type="selectedArchiveHistoryType" :archive-history-id="selectedArchiveHistoryId" /> <ArchiveHistoryMoveModal @history-updated="onUpdateHistory" @close-without-save="selectedArchiveHistoryId = null" :is-create-new="isCreateNewArchiveHistoryModal" v-model:open="showArchiveHistoryModal" :active-history-type="selectedArchiveHistoryType" :archive-history-id="selectedArchiveHistoryId" />
</template> </template>

View File

@@ -1,5 +1,18 @@
<script setup> <script setup>
import {NButton, NDatePicker, NDivider, NFlex, NForm, NFormItem, NInput, NModal, NSpace, NSwitch, NSelect} from "naive-ui"; import {
NButton,
NDatePicker,
NDivider,
NFlex,
NForm,
NFormItem,
NInput,
NModal,
NSpace,
NSwitch,
NSelect,
NSpin
} from "naive-ui";
import {ref, watch} from "vue"; import {ref, watch} from "vue";
import {router} from "@inertiajs/vue3"; import {router} from "@inertiajs/vue3";
const open = defineModel('open') const open = defineModel('open')
@@ -99,7 +112,7 @@ watch(() => props.archiveHistoryId, async (newId) => {
</script> </script>
<template> <template>
<NModal v-model:show="open" preset="card" class="max-w-2xl" closable @close="onCloseWithoutSave"> <NModal v-model:show="open" preset="card" class="max-w-2xl relative" closable @close="onCloseWithoutSave">
<template #header> <template #header>
{{ archiveHistoryId === null ? 'Добавить' : 'Редактировать' }} запись выдачи {{ archiveHistoryId === null ? 'Добавить' : 'Редактировать' }} запись выдачи
</template> </template>
@@ -140,6 +153,10 @@ watch(() => props.archiveHistoryId, async (newId) => {
</NSpace> </NSpace>
</NFlex> </NFlex>
</template> </template>
<div v-show="loading" class="absolute inset-0 z-10 bg-white flex items-center justify-center">
<NSpin :show="true" />
</div>
</NModal> </NModal>
</template> </template>