This commit is contained in:
ldh
2026-11-17 16:28:24 +08:00
parent b30d9f92ce
commit 19b7b10e97
28 changed files with 3891 additions and 46 deletions
+30 -2
View File
@@ -109,6 +109,22 @@ function closeForm() {
formOpen.value = false
}
let backdropPressed = false
function onBackdropPointerDown(event: PointerEvent) {
backdropPressed = event.target === event.currentTarget
}
function onBackdropPointerUp(event: PointerEvent) {
if (event.target !== event.currentTarget) backdropPressed = false
}
function closeOnBackdrop(event: MouseEvent, action: () => void) {
const shouldClose = backdropPressed && event.target === event.currentTarget
backdropPressed = false
if (shouldClose) action()
}
async function save() {
if (saving.value) return
@@ -254,7 +270,13 @@ onMounted(() => {
<Teleport to="body">
<Transition name="config-modal">
<div v-if="formOpen" class="config-backdrop" @click.self="closeForm">
<div
v-if="formOpen"
class="config-backdrop"
@pointerdown="onBackdropPointerDown"
@pointerup="onBackdropPointerUp"
@click="closeOnBackdrop($event, closeForm)"
>
<section class="form-card" role="dialog" aria-modal="true" aria-label="系统参数表单">
<h2>{{ editingId === null ? '新增系统参数' : '编辑系统参数' }}</h2>
@@ -316,7 +338,13 @@ onMounted(() => {
<Teleport to="body">
<Transition name="config-modal">
<div v-if="deleting" class="config-backdrop" @click.self="cancelDelete">
<div
v-if="deleting"
class="config-backdrop"
@pointerdown="onBackdropPointerDown"
@pointerup="onBackdropPointerUp"
@click="closeOnBackdrop($event, cancelDelete)"
>
<section class="confirm-card" role="dialog" aria-modal="true" aria-label="删除确认">
<h2>删除系统参数</h2>
<p>