From 21ffb6a54fd229178f8fdf2729d6c95b02cf28d1 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Wed, 11 Nov 2026 00:59:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E5=BC=B9=E7=AA=97=E7=82=B9?= =?UTF-8?q?=E9=81=AE=E7=BD=A9=E4=B8=8D=E5=86=8D=E5=85=B3=E9=97=AD=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=BC=96=E8=BE=91=E4=B8=AD=E8=AF=AF=E8=A7=A6?= =?UTF-8?q?=E4=B8=A2=E8=BE=93=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 管理页的弹窗基本都是表单(套餐 / NVR / 摄像头 / 工作台 / 主体 / 文档 / 成员…), 原来 ModalBox 的遮罩无条件 `@click.self="emit('close')"`,手一滑点到外面整屏输入就没了。 - ModalBox 新增 maskClosable,默认 false:点遮罩不关闭,只能用 × 或底部按钮; - 纯展示类弹窗(实时预览 / 合并输出预览)显式加 mask-closable,保留点击外面关闭的习惯。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- frontend/src/components/ModalBox.vue | 19 +++++++++++++++++-- frontend/src/views/CamerasView.vue | 2 +- frontend/src/views/WorkstationsView.vue | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/ModalBox.vue b/frontend/src/components/ModalBox.vue index bf426cd..9fc8590 100644 --- a/frontend/src/components/ModalBox.vue +++ b/frontend/src/components/ModalBox.vue @@ -3,18 +3,33 @@ * 通用弹窗:遮罩 + 居中面板 + 标题栏 + 底部按钮插槽 * * 用 Teleport 挂到 body,避免被列表容器的 `overflow: hidden` 裁掉。 + * + * **点遮罩默认不关闭**:弹窗里基本都在填表单/编辑内容, + * 手一滑点外面就把整屏输入丢掉太容易发生(编辑中尤其明显)。 + * 只有纯展示类弹窗(例如实时预览)才显式加 `mask-closable`。 */ -withDefaults(defineProps<{ open: boolean; title?: string; width?: string }>(), { +const props = withDefaults(defineProps<{ + open: boolean; + title?: string; + width?: string; + /** 点遮罩是否关闭(默认 false) */ + maskClosable?: boolean; +}>(), { title: '', width: '560px', + maskClosable: false, }); const emit = defineEmits<{ (e: 'close'): void }>(); + +function onMaskClick() { + if (props.maskClosable) emit('close'); +} - +
{{ previewCamera?.name || '通道 ' + previewCamera?.channelNo }} diff --git a/frontend/src/views/WorkstationsView.vue b/frontend/src/views/WorkstationsView.vue index 0892af3..215efa5 100644 --- a/frontend/src/views/WorkstationsView.vue +++ b/frontend/src/views/WorkstationsView.vue @@ -911,7 +911,7 @@ onBeforeUnmount(() => { - +
{{ previewError }}

加载布局…