fix: 所有的弹窗点击遮罩不能关闭

This commit is contained in:
RubyLiu 2024-02-01 19:03:54 +08:00 committed by Craftsman
parent bdb421d1c6
commit 0e6b6da459
18 changed files with 25 additions and 10 deletions

View File

@ -465,6 +465,7 @@
permissions, permissions,
}); });
} }
canSave.value = false;
Message.success(t('common.saveSuccess')); Message.success(t('common.saveSuccess'));
initData(props.current.id); initData(props.current.id);
} catch (error) { } catch (error) {

View File

@ -65,6 +65,7 @@ export default function useModal() {
okText: t('common.confirmDelete'), okText: t('common.confirmDelete'),
cancelText: t('common.cancel'), cancelText: t('common.cancel'),
hideCancel: false, hideCancel: false,
simple: false,
okButtonProps: { status: 'danger' }, okButtonProps: { status: 'danger' },
titleAlign: 'start', titleAlign: 'start',
modalClass: `ms-usemodal ms-usemodal-warning ms-usemodal-small`, modalClass: `ms-usemodal ms-usemodal-warning ms-usemodal-small`,

View File

@ -5,6 +5,7 @@
class="ms-modal-form ms-modal-medium" class="ms-modal-form ms-modal-medium"
:ok-text="t('system.organization.addMember')" :ok-text="t('system.organization.addMember')"
unmount-on-close unmount-on-close
:mask-closable="false"
@cancel="handleCancel(false)" @cancel="handleCancel(false)"
> >
<template #title> {{ t('system.organization.addMember') }} </template> <template #title> {{ t('system.organization.addMember') }} </template>

View File

@ -5,6 +5,7 @@ export default {
'project.usergroup.memberCount': 'Member Count', 'project.usergroup.memberCount': 'Member Count',
'project.userGroup.viewAuth': 'View Auth', 'project.userGroup.viewAuth': 'View Auth',
'project.userGroup.deleteName': 'Are you sure to delete: {name}?', 'project.userGroup.deleteName': 'Are you sure to delete: {name}?',
'project.userGroup.removeTip': 'Delete it, you`ll lose project auth',
'project.userGroup.deleteTip': 'project.userGroup.deleteTip':
'After deletion, the user group data under the project will be deleted together, please operate with caution!', 'After deletion, the user group data under the project will be deleted together, please operate with caution!',
}; };

View File

@ -8,4 +8,5 @@ export default {
'project.userGroup.deleteTip': '删除后,项目下用户组数据将一起删除,请谨慎操作!', 'project.userGroup.deleteTip': '删除后,项目下用户组数据将一起删除,请谨慎操作!',
'project.userGroup.addRequired': '用户组名称不能为空', 'project.userGroup.addRequired': '用户组名称不能为空',
'project.userGroup.addUserGroup': '添加用户组', 'project.userGroup.addUserGroup': '添加用户组',
'project.userGroup.removeTip': '移除后,将失去用户组权限',
}; };

View File

@ -87,6 +87,7 @@
:ok-text="t('common.create')" :ok-text="t('common.create')"
title-align="start" title-align="start"
class="ms-modal-form ms-modal-small" class="ms-modal-form ms-modal-small"
:mask-closable="false"
> >
<template #title> {{ t('project.userGroup.addUserGroup') }} </template> <template #title> {{ t('project.userGroup.addUserGroup') }} </template>
<div class="form"> <div class="form">

View File

@ -34,7 +34,7 @@
<template #operation="{ record }"> <template #operation="{ record }">
<MsRemoveButton <MsRemoveButton
:title="t('system.organization.removeName', { name: characterLimit(record.name) })" :title="t('system.organization.removeName', { name: characterLimit(record.name) })"
:sub-title-tip="t('system.organization.removeTip')" :sub-title-tip="t('project.userGroup.removeTip')"
@ok="handleRemove(record)" @ok="handleRemove(record)"
/> />
</template> </template>

View File

@ -4,6 +4,7 @@
title-align="start" title-align="start"
class="ms-modal-form ms-modal-medium" class="ms-modal-form ms-modal-medium"
unmount-on-close unmount-on-close
:mask-closable="false"
@cancel="handleCancel(false)" @cancel="handleCancel(false)"
> >
<template #title> <template #title>

View File

@ -4,6 +4,7 @@
title-align="start" title-align="start"
class="ms-modal-form ms-modal-medium" class="ms-modal-form ms-modal-medium"
:ok-text="t('system.organization.addMember')" :ok-text="t('system.organization.addMember')"
:mask-closable="false"
unmount-on-close unmount-on-close
@cancel="handleCancel(false)" @cancel="handleCancel(false)"
> >

View File

@ -32,8 +32,8 @@
</template> </template>
<template #operation="{ record }"> <template #operation="{ record }">
<MsRemoveButton <MsRemoveButton
:title="t('system.organization.removeName', { name: record.name })" :title="t('system.project.removeName', { name: record.name })"
:sub-title-tip="t('system.organization.removeTip')" :sub-title-tip="t('system.project.removeTip')"
@ok="handleRemove(record)" @ok="handleRemove(record)"
/> />
</template> </template>

View File

@ -76,4 +76,5 @@ export default {
'system.project.createProjectSuccess': 'Create project success', 'system.project.createProjectSuccess': 'Create project success',
'system.project.updateProjectSuccess': 'Update project success', 'system.project.updateProjectSuccess': 'Update project success',
'system.project.resourcePool': 'Resource pool', 'system.project.resourcePool': 'Resource pool',
'system.project.removeName': 'Confirm remove the {name}',
}; };

View File

@ -6,7 +6,7 @@ export default {
'system.organization.edit': '编辑', 'system.organization.edit': '编辑',
'system.organization.save': '保存', 'system.organization.save': '保存',
'system.organization.end': '结束', 'system.organization.end': '结束',
'system.organization.removeName': '确认移除 {name} 这个用户吗', 'system.organization.removeName': '确认移除 {name} 这个用户吗',
'system.organization.removeTip': '移除后,将失去组织权限', 'system.organization.removeTip': '移除后,将失去组织权限',
'system.organization.addMember': '添加成员', 'system.organization.addMember': '添加成员',
'system.organization.addMemberPlaceholder': '请选择成员', 'system.organization.addMemberPlaceholder': '请选择成员',
@ -70,4 +70,5 @@ export default {
'system.project.createProjectSuccess': '创建项目成功', 'system.project.createProjectSuccess': '创建项目成功',
'system.project.updateProjectSuccess': '更新项目成功', 'system.project.updateProjectSuccess': '更新项目成功',
'system.project.resourcePool': '资源池', 'system.project.resourcePool': '资源池',
'system.project.removeName': '确认移除 {name} 这个用户吗?',
}; };

View File

@ -5,6 +5,7 @@
:ok-text="isEdit ? t('common.update') : t('common.create')" :ok-text="isEdit ? t('common.update') : t('common.create')"
title-align="start" title-align="start"
unmount-on-close unmount-on-close
:mask-closable="false"
@cancel="handleCancel(false)" @cancel="handleCancel(false)"
> >
<template #title> <template #title>

View File

@ -4,6 +4,7 @@
title-align="start" title-align="start"
class="ms-modal-form ms-modal-medium" class="ms-modal-form ms-modal-medium"
:ok-text="t('system.organization.addMember')" :ok-text="t('system.organization.addMember')"
:mask-closable="false"
unmount-on-close unmount-on-close
@cancel="handleCancel" @cancel="handleCancel"
> >

View File

@ -241,8 +241,8 @@
const handleDelete = (record: TableData) => { const handleDelete = (record: TableData) => {
openDeleteModal({ openDeleteModal({
title: t('system.organization.deleteName', { name: characterLimit(record.name) }), title: t('system.project.deleteName', { name: characterLimit(record.name) }),
content: t('system.organization.deleteTip'), content: t('system.project.deleteTip'),
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
await deleteProject(record.id); await deleteProject(record.id);

View File

@ -33,7 +33,7 @@
</template> </template>
<template #operation="{ record }"> <template #operation="{ record }">
<MsRemoveButton <MsRemoveButton
:title="t('system.organization.removeName', { name: record.name })" :title="t('system.organization.removeName', { name: characterLimit(record.name) })"
:sub-title-tip="props.organizationId ? t('system.organization.removeTip') : t('system.project.removeTip')" :sub-title-tip="props.organizationId ? t('system.organization.removeTip') : t('system.project.removeTip')"
@ok="handleRemove(record)" @ok="handleRemove(record)"
/> />
@ -66,6 +66,7 @@
postUserTableByOrgIdOrProjectId, postUserTableByOrgIdOrProjectId,
} from '@/api/modules/setting/organizationAndProject'; } from '@/api/modules/setting/organizationAndProject';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import { characterLimit } from '@/utils';
export interface projectDrawerProps { export interface projectDrawerProps {
visible: boolean; visible: boolean;

View File

@ -6,7 +6,7 @@ export default {
'system.organization.edit': '编辑', 'system.organization.edit': '编辑',
'system.organization.save': '保存', 'system.organization.save': '保存',
'system.organization.end': '结束', 'system.organization.end': '结束',
'system.organization.removeName': '确认移除 {name} 这个用户吗', 'system.organization.removeName': '确认移除 {name} 这个用户吗',
'system.organization.removeTip': '移除后,将失去组织权限', 'system.organization.removeTip': '移除后,将失去组织权限',
'system.organization.addMember': '添加成员', 'system.organization.addMember': '添加成员',
'system.organization.addMemberTitle': '添加成员({name}', 'system.organization.addMemberTitle': '添加成员({name}',
@ -39,7 +39,7 @@ export default {
'system.organization.email': '邮箱', 'system.organization.email': '邮箱',
'system.organization.phone': '手机', 'system.organization.phone': '手机',
'system.organization.addSuccess': '添加成功', 'system.organization.addSuccess': '添加成功',
'system.organization.deleteName': '确认删除 {name} 这个组织吗', 'system.organization.deleteName': '确认删除 {name} 这个组织吗',
'system.organization.deleteTip': '删除组织同时将该组织下的项目数据一起删除,请谨慎操作!', 'system.organization.deleteTip': '删除组织同时将该组织下的项目数据一起删除,请谨慎操作!',
'system.organization.revokeDeleteToolTip': '该组织将与 {count} 天后自动删除', 'system.organization.revokeDeleteToolTip': '该组织将与 {count} 天后自动删除',
'system.organization.createOrganizationSuccess': '创建组织成功', 'system.organization.createOrganizationSuccess': '创建组织成功',
@ -71,4 +71,6 @@ export default {
'system.project.revokeDeleteToolTip': '该项目将于 {count} 天后自动删除', 'system.project.revokeDeleteToolTip': '该项目将于 {count} 天后自动删除',
'system.project.removeTip': '移除后,将失去项目权限', 'system.project.removeTip': '移除后,将失去项目权限',
'system.organization.projectIsDisabled': '项目已结束,可在 项目列表 开启', 'system.organization.projectIsDisabled': '项目已结束,可在 项目列表 开启',
'system.project.deleteName': '确认删除 {name} 这个项目吗?',
'system.project.deleteTip': '删除后,系统会在 30天 后执行删除项目 (含项目下所有业务数据),请谨慎操作!',
}; };

View File

@ -64,7 +64,7 @@ export default {
phone: '手机', phone: '手机',
remove: '移除', remove: '移除',
quickAddUser: '快速添加用户', quickAddUser: '快速添加用户',
removeName: '确认移除 {name} 这个用户吗', removeName: '确认移除 {name} 这个用户吗',
removeTip: '移除后,将失去用户组权限', removeTip: '移除后,将失去用户组权限',
custom: '自定义用户组', custom: '自定义用户组',
projectUserGroup: '项目用户组', projectUserGroup: '项目用户组',