From efd22b9c15b3414d797e71229214013e3a286c2e Mon Sep 17 00:00:00 2001 From: logan Date: Fri, 29 May 2026 17:35:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=A8=E5=B1=80=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E5=89=A9=E4=BD=997=E4=B8=AA=E6=89=8B=E5=86=99=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E4=B8=BAModalOverlay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - LdapConfigPage: 3个弹框(创建OU/添加用户/账号测试) - AnnouncementPage: 2个弹框(查看/编辑公告) - NotificationPage: 1个弹框(编辑通知) - InstancePage: 1个弹框(批量导入) 所有弹框统一使用ModalOverlay组件,行为与EditInstanceDialog一致 tsc --noEmit 通过 --- frontend/src/pages/AnnouncementPage.tsx | 19 +++++++------------ frontend/src/pages/InstancePage.tsx | 10 ++++++---- frontend/src/pages/LdapConfigPage.tsx | 19 ++++++++++--------- frontend/src/pages/NotificationPage.tsx | 10 ++++------ 4 files changed, 27 insertions(+), 31 deletions(-) diff --git a/frontend/src/pages/AnnouncementPage.tsx b/frontend/src/pages/AnnouncementPage.tsx index 182eeee..fb1f5b7 100644 --- a/frontend/src/pages/AnnouncementPage.tsx +++ b/frontend/src/pages/AnnouncementPage.tsx @@ -2,6 +2,7 @@ import { useState, useEffect, useCallback } from 'react'; import request from '@/api/request'; import { Megaphone, Plus, Edit2, Trash2, Eye, Clock, CheckCircle, X, Save } from 'lucide-react'; import { ConfirmDialog } from '@/components/ConfirmDialog'; +import { ModalOverlay } from '@/components/ModalOverlay'; /* ── types ── */ interface Announcement { @@ -230,11 +231,8 @@ export default function AnnouncementPage() { {/* ── View Preview Modal ── */} {viewAnn && ( -
setViewAnn(null)}> -
e.stopPropagation()} - > + setViewAnn(null)} width="max-w-2xl"> +

{viewAnn.title}

@@ -258,16 +256,13 @@ export default function AnnouncementPage() { dangerouslySetInnerHTML={{ __html: simpleMarkdown(viewAnn.content) }} />
-
+ )} {/* ── Create / Edit Modal ── */} {showModal && ( -
setShowModal(false)}> -
e.stopPropagation()} - > + setShowModal(false)} width="max-w-3xl"> +

{editingId ? '编辑公告' : '创建公告'}

-
+ )} + <> +
e.stopPropagation()} + className="bg-[var(--dg-bg-secondary)] rounded-xl shadow-2xl w-full max-h-[90vh] overflow-y-auto" > {/* Header */}
@@ -1448,6 +1449,7 @@ function CreateInstanceForm({ defaultType, onCancel, onCreated }: {
+ { deleteConfirm?.onConfirm(); setDeleteConfirm(null); }} onCancel={() => setDeleteConfirm(null)} /> -
+ ); } diff --git a/frontend/src/pages/LdapConfigPage.tsx b/frontend/src/pages/LdapConfigPage.tsx index 1c697fa..95a2bf5 100644 --- a/frontend/src/pages/LdapConfigPage.tsx +++ b/frontend/src/pages/LdapConfigPage.tsx @@ -1,5 +1,6 @@ import { useState, useEffect, useCallback } from 'react'; import api from '@/api/request'; +import { ModalOverlay } from '@/components/ModalOverlay'; import { toast } from '@/hooks/useToast'; import { Save, ChevronRight, ChevronDown, RefreshCw, @@ -613,8 +614,8 @@ export default function LdapConfigPage() { {/* ── 创建 OU 弹框 ── */} {showCreateOu && ( -
-
+ setShowCreateOu(false)} width="w-[460px]"> +

新建组织单元 (OU)

@@ -661,13 +662,13 @@ export default function LdapConfigPage() {
-
+ )} {/* ── 添加用户弹框 ── */} {showAddUser && ( -
-
+ setShowAddUser(false)} width="w-[500px]"> +

添加用户到 LDAP

@@ -737,13 +738,13 @@ export default function LdapConfigPage() {
-
+ )} {/* ── 账号测试弹框 ── */} {showAccountTest && ( -
setShowAccountTest(false)}> -
e.stopPropagation()}> + setShowAccountTest(false)} width="w-[420px]"> +

LDAP 账号验证测试

-
+ )}
); diff --git a/frontend/src/pages/NotificationPage.tsx b/frontend/src/pages/NotificationPage.tsx index a2988a7..e836d12 100644 --- a/frontend/src/pages/NotificationPage.tsx +++ b/frontend/src/pages/NotificationPage.tsx @@ -2,6 +2,7 @@ import { useState, useEffect, useCallback } from 'react'; import request from '@/api/request'; import { Plus, Trash2, Send, Bell, Mail, Settings, X } from 'lucide-react'; import { ConfirmDialog } from '@/components/ConfirmDialog'; +import { ModalOverlay } from '@/components/ModalOverlay'; /* ── types ── */ type ChannelType = 'dingtalk' | 'webhook_feishu' | 'email'; @@ -362,11 +363,8 @@ export default function NotificationPage() { {/* ── Create / Edit Modal ── */} {showModal && ( -
setShowModal(false)}> -
e.stopPropagation()} - > + setShowModal(false)} width="max-w-2xl"> +

{editingId ? '编辑渠道' : '添加渠道'}

-
+ )}