You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
/*
|
|
* @Author: zhoux zhouxia@supervision.ltd
|
|
* @Date: 2023-12-27 10:30:10
|
|
* @LastEditors: donghao donghao@supervision.ltd
|
|
* @LastEditTime: 2024-05-17 13:19:01
|
|
* @FilePath: \general-ai-platform-web\src\components\TableActionCard\isConfirmModal.tsx
|
|
* @Description: 确认操作弹框
|
|
*/
|
|
import { useIntl } from '@umijs/max';
|
|
import modal from 'antd/es/modal';
|
|
import './isConfirmModal.less';
|
|
import { ReactComponent as QuestionIcon } from '/public/icons/questionIcon.svg';
|
|
type IsConfirmModalProps = {
|
|
modalProps: ModalType;
|
|
confirmButton: string | React.ReactNode;
|
|
};
|
|
|
|
const IsConfirmModal: React.FC<IsConfirmModalProps> = (props) => {
|
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
const intl = useIntl();
|
|
const confirm = () => {
|
|
modal.confirm({
|
|
width: 560,
|
|
title: '确认删除吗?',
|
|
content: '确认删除吗?删除后将无法找回,请谨慎操作。',
|
|
okText: intl.formatMessage({ id: 'common.okText', defaultMessage: '$$$' }),
|
|
cancelText: intl.formatMessage({ id: 'common.cancelText', defaultMessage: '$$$' }),
|
|
icon: (
|
|
<span>
|
|
<QuestionIcon></QuestionIcon>
|
|
</span>
|
|
),
|
|
// onCancel() {
|
|
// console.log('Cancel');
|
|
// },
|
|
...props?.modalProps,
|
|
});
|
|
};
|
|
|
|
return (
|
|
<div className="isConfirmModal_wrap">
|
|
<span
|
|
onClick={(e) => {
|
|
e.stopPropagation();
|
|
confirm();
|
|
}}
|
|
>
|
|
{props.confirmButton}
|
|
</span>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default IsConfirmModal;
|