瀏覽代碼

feat (1.59.1 -> 1.60.0): 实现检查退出反馈组件多语言支持

为 ExamExitFeedback 组件添加完整的多语言支持,包括按钮文本和默认标题/消息内容

- 在多语言文件中添加检查退出反馈相关的翻译键
- 修改 ExamExitFeedback 组件使用 FormattedMessage 显示按钮文本
- 实现默认标题和消息内容的动态多语言支持,保持组件接口的向后兼容性

改动文件:
- src/assets/i18n/messages/zh.js
- src/assets/i18n/messages/en.js
- src/pages/exam/components/ExamExitFeedback.tsx
dengdx 6 天之前
父節點
當前提交
cd14661620

+ 15 - 0
CHANGELOG.md

@@ -3,6 +3,21 @@
 本项目的所有重要变更都将记录在此文件中.
 
 
+## [1.60.0] - 2026-01-07 15:20
+
+### 新增 (Added)
+
+- **实现检查退出反馈组件多语言支持** - 为 ExamExitFeedback 组件添加完整的多语言支持,包括按钮文本和默认标题/消息内容
+  - 在多语言文件中添加检查退出反馈相关的翻译键
+  - 修改 ExamExitFeedback 组件使用 FormattedMessage 显示按钮文本
+  - 实现默认标题和消息内容的动态多语言支持,保持组件接口的向后兼容性
+
+**改动文件:**
+
+- src/assets/i18n/messages/zh.js
+- src/assets/i18n/messages/en.js
+- src/pages/exam/components/ExamExitFeedback.tsx
+
 ## [1.59.1] - 2026-01-07 14:57
 
 ### 修复 (Fixed)

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "zsis",
-  "version": "1.59.1",
+  "version": "1.60.0",
   "private": true,
   "description": "医学成像系统",
   "main": "main.js",

+ 6 - 1
scripts/output/i18n/en.js

@@ -386,5 +386,10 @@
   "rectCropPanel.undoMask": "Undo Mask",
   "rectCropPanel.addMask": "Add Mask",
   "rectCropPanel.deleteMask": "Delete Mask",
-  "rectCropPanel.recalculateEXI": "Recalculate EXI"
+  "rectCropPanel.recalculateEXI": "Recalculate EXI",
+  "exam.exitFeedback.title": "Examination Incomplete",
+  "exam.exitFeedback.message": "The current examination exposure steps have not been completed. Progress will not be saved after cancellation.",
+  "exam.exitFeedback.suspend": "Suspend",
+  "exam.exitFeedback.complete": "Complete",
+  "exam.exitFeedback.cancel": "Cancel"
 }

+ 6 - 1
scripts/output/i18n/zh.js

@@ -386,5 +386,10 @@
   "rectCropPanel.undoMask": "撤销遮线框",
   "rectCropPanel.addMask": "添加Mask",
   "rectCropPanel.deleteMask": "删除Mask",
-  "rectCropPanel.recalculateEXI": "重新计算EXI"
+  "rectCropPanel.recalculateEXI": "重新计算EXI",
+  "exam.exitFeedback.title": "检查未完成",
+  "exam.exitFeedback.message": "当前检查的曝光步骤尚未完成。中止后,本次检查的进度将不会保存。",
+  "exam.exitFeedback.suspend": "挂起",
+  "exam.exitFeedback.complete": "完成",
+  "exam.exitFeedback.cancel": "取消"
 }

+ 5 - 0
src/assets/i18n/messages/en.js

@@ -389,4 +389,9 @@ export default {
   "rectCropPanel.addMask": "Add Mask",
   "rectCropPanel.deleteMask": "Delete Mask",
   "rectCropPanel.recalculateEXI": "Recalculate EXI",
+  "exam.exitFeedback.title": "Examination Incomplete",
+  "exam.exitFeedback.message": "The current examination exposure steps have not been completed. Progress will not be saved after cancellation.",
+  "exam.exitFeedback.suspend": "Suspend",
+  "exam.exitFeedback.complete": "Complete",
+  "exam.exitFeedback.cancel": "Cancel",
 };

+ 5 - 0
src/assets/i18n/messages/zh.js

@@ -389,5 +389,10 @@ export default {
   "rectCropPanel.addMask": "添加Mask",
   "rectCropPanel.deleteMask": "删除Mask",
   "rectCropPanel.recalculateEXI": "重新计算EXI",
+  "exam.exitFeedback.title": "检查未完成",
+  "exam.exitFeedback.message": "当前检查的曝光步骤尚未完成。中止后,本次检查的进度将不会保存。",
+  "exam.exitFeedback.suspend": "挂起",
+  "exam.exitFeedback.complete": "完成",
+  "exam.exitFeedback.cancel": "取消",
 
 };

+ 19 - 7
src/pages/exam/components/ExamExitFeedback.tsx

@@ -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>
   );
 };