|
|
@@ -1,6 +1,7 @@
|
|
|
import React from 'react';
|
|
|
import { Modal, Button, Space } from 'antd';
|
|
|
import { ExclamationCircleFilled } from '@ant-design/icons';
|
|
|
+import { FormattedMessage, useIntl } from 'react-intl';
|
|
|
|
|
|
export interface ExamExitFeedbackProps {
|
|
|
/** 是否显示组件 */
|
|
|
@@ -22,34 +23,45 @@ const ExamExitFeedback: React.FC<ExamExitFeedbackProps> = ({
|
|
|
onContinue,
|
|
|
onSave,
|
|
|
onAbort,
|
|
|
- title = '检查未完成',
|
|
|
- message = '当前检查的曝光步骤尚未完成。中止后,本次检查的进度将不会保存。',
|
|
|
+ title,
|
|
|
+ message,
|
|
|
}) => {
|
|
|
+ const intl = useIntl();
|
|
|
+
|
|
|
+ // 使用多语言版本作为默认值
|
|
|
+ const defaultTitle = intl.formatMessage({ id: 'exam.exitFeedback.title' });
|
|
|
+ const defaultMessage = intl.formatMessage({ id: 'exam.exitFeedback.message' });
|
|
|
+
|
|
|
+ const displayTitle = title ?? defaultTitle;
|
|
|
+ const displayMessage = message ?? defaultMessage;
|
|
|
+
|
|
|
return (
|
|
|
<Modal
|
|
|
title={
|
|
|
<Space>
|
|
|
<ExclamationCircleFilled style={{ color: '#faad14' }} />
|
|
|
- <span>{title}</span>
|
|
|
+ <span>{displayTitle}</span>
|
|
|
</Space>
|
|
|
}
|
|
|
open={open}
|
|
|
onCancel={onContinue}
|
|
|
footer={
|
|
|
<Space>
|
|
|
- <Button onClick={onContinue}>挂起检查</Button>
|
|
|
+ <Button onClick={onContinue}>
|
|
|
+ <FormattedMessage id="exam.exitFeedback.suspend" />
|
|
|
+ </Button>
|
|
|
<Button type="primary" onClick={onSave}>
|
|
|
- 完成检查
|
|
|
+ <FormattedMessage id="exam.exitFeedback.complete" />
|
|
|
</Button>
|
|
|
<Button type="primary" danger onClick={onAbort}>
|
|
|
- 留在检查
|
|
|
+ <FormattedMessage id="exam.exitFeedback.cancel" />
|
|
|
</Button>
|
|
|
</Space>
|
|
|
}
|
|
|
centered
|
|
|
closable={false}
|
|
|
>
|
|
|
- <p>{message}</p>
|
|
|
+ <p>{displayMessage}</p>
|
|
|
</Modal>
|
|
|
);
|
|
|
};
|