Реализация onCloseWithoutSave

This commit is contained in:
brusnitsyn
2025-12-19 00:40:19 +09:00
parent 76d1df235d
commit cc10b54ece

View File

@@ -24,7 +24,7 @@ const archiveInfo = ref({
post_in: null,
status: null
})
const emits = defineEmits(['historyUpdated'])
const emits = defineEmits(['historyUpdated', 'closeWithoutSave'])
const onResetData = () => {
archiveInfo.value = {
@@ -35,6 +35,10 @@ const onResetData = () => {
}
}
const onCloseWithoutSave = () => {
emits('closeWithoutSave')
open.value = false
}
const patientData = ref({
...patient.value.info
@@ -152,7 +156,7 @@ watch(() => props.patientId, async (newId) => {
</script>
<template>
<NModal v-model:show="open" preset="card" class="max-w-4xl" closable @close="open = false">
<NModal v-model:show="open" preset="card" class="max-w-4xl" closable @close="onCloseWithoutSave">
<template #header>
{{ patient.info?.medcardnum }} {{ patient.info?.family }} {{ patient.info?.name }} {{ patient.info?.ot }}
</template>
@@ -180,7 +184,7 @@ watch(() => props.patientId, async (newId) => {
<template #action>
<NFlex justify="end" align="center">
<NSpace align="center" :size="0">
<NButton secondary>
<NButton secondary @click="onCloseWithoutSave">
Закрыть без сохранения
</NButton>
<NDivider vertical />