|
@@ -46,6 +46,7 @@ function getIcon(iconType: string) {
|
|
|
return <CloseCircleFilled class="modal-icon-error" />;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
function renderContent({ content }: Pick<ModalOptionsEx, 'content'>) {
|
|
|
return <div innerHTML={`<div>${content as string}</div>`}></div>;
|
|
|
}
|
|
@@ -64,6 +65,7 @@ function createConfirm(options: ModalOptionsEx): ConfirmOptions {
|
|
|
};
|
|
|
return Modal.confirm(opt) as any;
|
|
|
}
|
|
|
+
|
|
|
const baseOptions = {
|
|
|
okText: '确定',
|
|
|
centered: true,
|
|
@@ -77,15 +79,19 @@ function createModalOptions(options: ModalOptionsPartial, icon: string): ModalOp
|
|
|
icon: getIcon(icon),
|
|
|
};
|
|
|
}
|
|
|
+
|
|
|
function createSuccessModal(options: ModalOptionsPartial) {
|
|
|
return Modal.success(createModalOptions(options, 'success'));
|
|
|
}
|
|
|
+
|
|
|
function createErrorModal(options: ModalOptionsPartial) {
|
|
|
return Modal.error(createModalOptions(options, 'close'));
|
|
|
}
|
|
|
+
|
|
|
function createInfoModal(options: ModalOptionsPartial) {
|
|
|
return Modal.info(createModalOptions(options, 'info'));
|
|
|
}
|
|
|
+
|
|
|
function createWarningModal(options: ModalOptionsPartial) {
|
|
|
return Modal.warning(createModalOptions(options, 'warning'));
|
|
|
}
|
|
@@ -94,6 +100,7 @@ notification.config({
|
|
|
placement: 'topRight',
|
|
|
duration: 3,
|
|
|
});
|
|
|
+
|
|
|
/**
|
|
|
* @description: message
|
|
|
*/
|