From b798bb3eb5e1d07510393fdb7e30abc87d11823d Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Sat, 17 Feb 2024 14:27:20 +0800 Subject: [PATCH] Optimize modal --- src/pages/System/Group.tsx | 2 ++ src/pages/System/Role.tsx | 2 ++ src/pages/System/Settings/Mail.tsx | 1 + src/pages/System/Tools/Base.tsx | 5 +++++ src/pages/System/Tools/Category.tsx | 1 + src/pages/System/Tools/Template.tsx | 4 ++++ src/pages/System/Tools/index.tsx | 3 +++ src/pages/System/User.tsx | 3 +++ src/pages/Tools/index.tsx | 4 ++++ 9 files changed, 25 insertions(+) diff --git a/src/pages/System/Group.tsx b/src/pages/System/Group.tsx index 51ae287..529cf43 100644 --- a/src/pages/System/Group.tsx +++ b/src/pages/System/Group.tsx @@ -191,6 +191,7 @@ const Group = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除选中的 ${tableSelectedItem.length} 个用户组吗?` }) .then( @@ -243,6 +244,7 @@ const Group = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除角色 ${value.name} 吗?` }) .then( diff --git a/src/pages/System/Role.tsx b/src/pages/System/Role.tsx index 04efd72..989f7cb 100644 --- a/src/pages/System/Role.tsx +++ b/src/pages/System/Role.tsx @@ -183,6 +183,7 @@ const Role = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除选中的 ${tableSelectedItem.length} 个角色吗?` }) .then( @@ -235,6 +236,7 @@ const Role = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除角色 ${value.name} 吗?` }) .then( diff --git a/src/pages/System/Settings/Mail.tsx b/src/pages/System/Settings/Mail.tsx index 91d6694..da1e02a 100644 --- a/src/pages/System/Settings/Mail.tsx +++ b/src/pages/System/Settings/Mail.tsx @@ -17,6 +17,7 @@ const Mail = () => { const handleOnTest = () => { void modal.confirm({ title: '发送测试邮件', + maskClosable: true, content: ( <> diff --git a/src/pages/System/Tools/Base.tsx b/src/pages/System/Tools/Base.tsx index 47d3147..e57891e 100644 --- a/src/pages/System/Tools/Base.tsx +++ b/src/pages/System/Tools/Base.tsx @@ -232,6 +232,7 @@ const Base = () => { compileForm.setFieldValue('entryFileName', undefined) void modal.confirm({ title: '编译', + maskClosable: true, content: ( <> @@ -372,6 +373,7 @@ const Base = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除基板 ${value.name} 吗?` }) .then( @@ -535,6 +537,7 @@ const Base = () => { const handleOnAddFile = () => { void modal.confirm({ title: '新建文件', + maskClosable: true, content: ( { renameFileForm.setFieldValue('fileName', fileName) void modal.confirm({ title: '重命名文件', + maskClosable: true, content: ( { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除文件 ${fileName} 吗?` }) .then( diff --git a/src/pages/System/Tools/Category.tsx b/src/pages/System/Tools/Category.tsx index c17bf62..625e287 100644 --- a/src/pages/System/Tools/Category.tsx +++ b/src/pages/System/Tools/Category.tsx @@ -122,6 +122,7 @@ const Category = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除类别 ${value.name} 吗?` }) .then( diff --git a/src/pages/System/Tools/Template.tsx b/src/pages/System/Tools/Template.tsx index 5586c15..f6985ac 100644 --- a/src/pages/System/Tools/Template.tsx +++ b/src/pages/System/Tools/Template.tsx @@ -230,6 +230,7 @@ const Template = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除模板 ${value.name} 吗?` }) .then( @@ -398,6 +399,7 @@ const Template = () => { const handleOnAddFile = () => { void modal.confirm({ title: '新建文件', + maskClosable: true, content: ( { renameFileForm.setFieldValue('fileName', fileName) void modal.confirm({ title: '重命名文件', + maskClosable: true, content: ( { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除文件 ${fileName} 吗?` }) .then( diff --git a/src/pages/System/Tools/index.tsx b/src/pages/System/Tools/index.tsx index 8073d1d..abd429a 100644 --- a/src/pages/System/Tools/index.tsx +++ b/src/pages/System/Tools/index.tsx @@ -190,6 +190,7 @@ const Tools = () => { form.setFieldValue('pass', undefined) void modal.confirm({ title: '审核', + maskClosable: true, content: ( { modal .confirm({ title: '确定下架', + maskClosable: true, content: `确定下架工具 ${value.author.username}:${value.toolId}:${value.ver} 吗?` }) .then( @@ -364,6 +366,7 @@ const Tools = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除工具 ${value.author.username}:${value.toolId}:${value.ver} 吗?` }) .then( diff --git a/src/pages/System/User.tsx b/src/pages/System/User.tsx index af9ee4b..05a0255 100644 --- a/src/pages/System/User.tsx +++ b/src/pages/System/User.tsx @@ -286,6 +286,7 @@ const User = () => { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除选中的 ${tableSelectedItem.length} 个用户吗?` }) .then( @@ -335,6 +336,7 @@ const User = () => { 修改用户 {value.username} 的密码 ), + maskClosable: true, content: ( { modal .confirm({ title: '确定删除', + maskClosable: true, content: `确定删除用户 ${value.username} 吗?` }) .then( diff --git a/src/pages/Tools/index.tsx b/src/pages/Tools/index.tsx index 44725b5..b27f0dd 100644 --- a/src/pages/Tools/index.tsx +++ b/src/pages/Tools/index.tsx @@ -216,6 +216,7 @@ const Tools = () => { modal .confirm({ title: '删除', + maskClosable: true, content: `确定删除工具 ${tool.name}:${tool.ver} 吗?` }) .then( @@ -245,6 +246,7 @@ const Tools = () => { const handleOnUpgradeTool = (tool: ToolVo) => { void modal.confirm({ title: '更新工具', + maskClosable: true, content: ( <> @@ -319,6 +321,7 @@ const Tools = () => { modal .confirm({ title: '提交审核', + maskClosable: true, content: `确定提交审核工具 ${tool.name}:${tool.ver} 吗?` }) .then( @@ -357,6 +360,7 @@ const Tools = () => { modal .confirm({ title: '取消审核', + maskClosable: true, content: `确定取消审核工具 ${tool.name}:${tool.ver} 吗?` }) .then(