fix: ban close-on-esc in modal

This commit is contained in:
yangsy
2025-08-25 15:56:55 +08:00
parent d0658580a0
commit 2ad2c4d4a3
3 changed files with 3 additions and 2 deletions

View File

@@ -163,7 +163,7 @@ const onModalClose = () => {};
</script>
<template>
<NModal v-model:show="show" preset="card" style="width: 100vw; height: 100vh" :title="`${station.name} - 设备告警详情`" :mask-closable="false" @close="onModalClose">
<NModal v-model:show="show" preset="card" style="width: 100vw; height: 100vh" :title="`${station.name} - 设备告警详情`" :close-on-esc="false" :mask-closable="false" @close="onModalClose">
<div v-if="alarmCount === 0" style="text-align: center; padding: 20px; color: #6c757d">
<span>当前没有设备告警</span>
</div>

View File

@@ -205,6 +205,7 @@ const { mutate: saveDeviceParams } = useMutation({
preset="card"
style="width: 800px; height: 600px"
:title="`${station.name} - 设备参数配置`"
:close-on-esc="false"
:mask-closable="false"
@after-enter="onAfterModalEnter"
@before-leave="onBeforeModalLeave"

View File

@@ -112,7 +112,7 @@ const onModalClose = () => {
</script>
<template>
<NModal v-model:show="show" preset="card" style="width: 800px; height: 600px" :title="`${station.name} - 离线设备详情`" :mask-closable="false" @close="onModalClose">
<NModal v-model:show="show" preset="card" style="width: 800px; height: 600px" :title="`${station.name} - 离线设备详情`" :close-on-esc="false" :mask-closable="false" @close="onModalClose">
<div v-if="offlineDeviceCount === 0" style="text-align: center; padding: 20px; color: #6c757d">
<span>当前没有离线设备</span>
</div>