|
@@ -4,6 +4,7 @@ import { Modal, message as Message, notification } from 'ant-design-vue';
|
|
|
import { InfoCircleFilled, CheckCircleFilled, CloseCircleFilled } from '@ant-design/icons-vue';
|
|
|
|
|
|
import { ArgsProps, ConfigProps } from 'ant-design-vue/lib/notification';
|
|
|
+import { useI18n } from './useI18n';
|
|
|
|
|
|
export interface NotifyApi {
|
|
|
info(config: ArgsProps): void;
|
|
@@ -62,14 +63,17 @@ function createConfirm(options: ModalOptionsEx): ConfirmOptions {
|
|
|
return (Modal.confirm(opt) as unknown) as ConfirmOptions;
|
|
|
}
|
|
|
|
|
|
-const baseOptions = {
|
|
|
- okText: '确定',
|
|
|
- centered: true,
|
|
|
+const getBaseOptions = () => {
|
|
|
+ const { t } = useI18n();
|
|
|
+ return {
|
|
|
+ okText: t('common.okText'),
|
|
|
+ centered: true,
|
|
|
+ };
|
|
|
};
|
|
|
|
|
|
function createModalOptions(options: ModalOptionsPartial, icon: string): ModalOptionsPartial {
|
|
|
return {
|
|
|
- ...baseOptions,
|
|
|
+ ...getBaseOptions(),
|
|
|
...options,
|
|
|
content: renderContent(options),
|
|
|
icon: getIcon(icon),
|