openFuyao is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN 'AS IS' BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details. */
import { Modal, Button, Checkbox } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import '@/styles/deleteInfoModal.less';
import { Fragment } from 'openinula';
*
* @param title 对话框标题
* @param open 控制对话框打开
* @param cancelFn 取消函数回调
* @param content 对话框内容 数组!
* @param confirmFn 确认回调
* @param confirmText 确认按钮文本 默认可不填
* @param showCheck 是否展示检查框(默认不展示)
* @param isCheck 是否选中(默认不展示)
* @param checkFn 选中回调(默认不展示)
* @returns
*/
export default function DeleteInfoModal({
title,
open,
cancelFn,
content,
confirmFn,
confirmText = '删除',
showCheck = false,
isCheck = false,
checkFn = () => { },
}) {
return <Modal className='modal_flex_delete' open={open} title={title} onCancel={cancelFn} destroyOnClose
footer={[
<Fragment>
<Button className={`${!isCheck && showCheck ? 'disabled_btn_log' : 'delete_btn_log'}`} onClick={confirmFn} disabled={!isCheck && showCheck}>{confirmText}</Button>
<Button className='cancel_btn_log' onClick={cancelFn}>取消</Button>
</Fragment>,
]}>
<div className='modal_delete_content'>
<ExclamationCircleOutlined className='warn_icon' />
<div className='word_tograry'>
<div className='word_tograry_alarm'>
{content.map(item => (
<p>{item}</p>
))}
</div>
{!!showCheck && <Checkbox className='multi_checkbox' checked={isCheck} onChange={e => {
checkFn(e);
}}>已了解删除操作无法恢复</Checkbox>}
</div>
</div>
</Modal>;
}