Commit 16b708a810bdbbf4e78688a9eddd34348a4bca87
1 parent
da5a20a7
1.补充操作按钮翻译
Showing
3 changed files
with
136 additions
and
18 deletions
src/mes/scheduledTasks/machineTasks/index.js
| @@ -508,6 +508,9 @@ | @@ -508,6 +508,9 @@ | ||
| 508 | slave0Config?.gdsconfigformslave?.find( | 508 | slave0Config?.gdsconfigformslave?.find( |
| 509 | item => item.sControlName === "BtnTableCopyTo.pauseWork" | 509 | item => item.sControlName === "BtnTableCopyTo.pauseWork" |
| 510 | ) || {}; | 510 | ) || {}; |
| 511 | + const beginConstruction = commonFunc.showLocalMessage(props, 'beginConstruction', '开工'); | ||
| 512 | + const finishConstruction = commonFunc.showLocalMessage(props, 'finishConstruction', '完工'); | ||
| 513 | + const pause = commonFunc.showLocalMessage(props, 'pause', '暂停'); | ||
| 511 | 514 | ||
| 512 | // 表格业务 | 515 | // 表格业务 |
| 513 | const [sSrcNo, setSSrcNo] = useState(""); | 516 | const [sSrcNo, setSSrcNo] = useState(""); |
| @@ -533,13 +536,13 @@ | @@ -533,13 +536,13 @@ | ||
| 533 | 536 | ||
| 534 | let showName, btnBgColor, sDefault; | 537 | let showName, btnBgColor, sDefault; |
| 535 | if (iStar === 1) { | 538 | if (iStar === 1) { |
| 536 | - showName = "暂停"; | 539 | + showName = pause; |
| 537 | btnBgColor = "#FAAD14"; | 540 | btnBgColor = "#FAAD14"; |
| 538 | } else if (iStar === 2 || iStar === 3) { | 541 | } else if (iStar === 2 || iStar === 3) { |
| 539 | - showName = "开工"; | 542 | + showName = beginConstruction; |
| 540 | btnBgColor = "#1890FF"; | 543 | btnBgColor = "#1890FF"; |
| 541 | } else { | 544 | } else { |
| 542 | - showName = "完工"; | 545 | + showName = finishConstruction; |
| 543 | btnBgColor = "#AAA"; | 546 | btnBgColor = "#AAA"; |
| 544 | sDefault = "${false}"; | 547 | sDefault = "${false}"; |
| 545 | } | 548 | } |
src/mes/scheduledTasks/prenatalReminderInfo/index.js
| @@ -5,7 +5,41 @@ import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; | @@ -5,7 +5,41 @@ import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; | ||
| 5 | import ShowType from "@/components/Common/CommonComponent"; | 5 | import ShowType from "@/components/Common/CommonComponent"; |
| 6 | 6 | ||
| 7 | import styles from "./index.less"; | 7 | import styles from "./index.less"; |
| 8 | - | 8 | +const titleTranslations = { |
| 9 | + sChinese: { | ||
| 10 | + '技术评审汇签': '技术评审汇签', | ||
| 11 | + '客户投诉': '客户投诉', | ||
| 12 | + '本批生产注意事项': '本批生产注意事项', | ||
| 13 | + '不合格报告': '不合格报告', | ||
| 14 | + '车间产前提醒(品管)': '车间产前提醒(品管)', | ||
| 15 | + '制程异常': '制程异常', | ||
| 16 | + '质检反馈': '质检反馈', | ||
| 17 | + '二维码提醒': '二维码提醒', | ||
| 18 | + '车间产前提醒': '车间产前提醒' | ||
| 19 | + }, | ||
| 20 | + sEnglish: { | ||
| 21 | + '技术评审汇签': 'Technical Review', | ||
| 22 | + '客户投诉': 'Customer Complaint', | ||
| 23 | + '本批生产注意事项': 'Production Notes', | ||
| 24 | + '不合格报告': 'Nonconformance Report', | ||
| 25 | + '车间产前提醒(品管)': 'Pre-production Reminder(QC)', | ||
| 26 | + '制程异常': 'Process Exception', | ||
| 27 | + '质检反馈': 'Quality Feedback', | ||
| 28 | + '二维码提醒': 'QR Code Reminder', | ||
| 29 | + '车间产前提醒': 'Pre-production Reminder' | ||
| 30 | + }, | ||
| 31 | + sBig5: { | ||
| 32 | + '技术评审汇签': '技術評審匯簽', | ||
| 33 | + '客户投诉': '客戶投訴', | ||
| 34 | + '本批生产注意事项': '本批生產注意事項', | ||
| 35 | + '不合格报告': '不合格報告', | ||
| 36 | + '车间产前提醒(品管)': '車間產前提醒(品管)', | ||
| 37 | + '制程异常': '製程異常', | ||
| 38 | + '质检反馈': '質檢反饋', | ||
| 39 | + '二维码提醒': '二維碼提醒', | ||
| 40 | + '车间产前提醒': '車間產前提醒' | ||
| 41 | + } | ||
| 42 | +}; | ||
| 9 | const usePrenatalReminderInfoEvent = props => { | 43 | const usePrenatalReminderInfoEvent = props => { |
| 10 | const { formData } = props; | 44 | const { formData } = props; |
| 11 | 45 | ||
| @@ -60,7 +94,11 @@ const usePrenatalReminderInfoEvent = props => { | @@ -60,7 +94,11 @@ const usePrenatalReminderInfoEvent = props => { | ||
| 60 | ...props | 94 | ...props |
| 61 | }; | 95 | }; |
| 62 | }; | 96 | }; |
| 63 | - | 97 | +// 封装多语言处理方法 |
| 98 | +const getTranslatedTitle = (app, originalTitle) => { | ||
| 99 | + const language = app?.userinfo?.sLanguage || 'sChinese'; | ||
| 100 | + return titleTranslations[language]?.[originalTitle] || originalTitle; | ||
| 101 | +}; | ||
| 64 | const PrenatalReminderInfo = baseProps => { | 102 | const PrenatalReminderInfo = baseProps => { |
| 65 | const props = usePrenatalReminderInfoEvent(useCommonBase(baseProps)); | 103 | const props = usePrenatalReminderInfoEvent(useCommonBase(baseProps)); |
| 66 | const { bFinish } = props; | 104 | const { bFinish } = props; |
| @@ -97,6 +135,8 @@ const PrenatalReminderInfo = baseProps => { | @@ -97,6 +135,8 @@ const PrenatalReminderInfo = baseProps => { | ||
| 97 | "二维码提醒", | 135 | "二维码提醒", |
| 98 | "车间产前提醒" | 136 | "车间产前提醒" |
| 99 | ].map((title, index) => { | 137 | ].map((title, index) => { |
| 138 | + const translatedTitle = getTranslatedTitle(app, title); | ||
| 139 | + | ||
| 100 | let dataValueNew = ""; | 140 | let dataValueNew = ""; |
| 101 | const child = { | 141 | const child = { |
| 102 | sId: commonUtils.createSid(), | 142 | sId: commonUtils.createSid(), |
| @@ -192,7 +232,7 @@ const PrenatalReminderInfo = baseProps => { | @@ -192,7 +232,7 @@ const PrenatalReminderInfo = baseProps => { | ||
| 192 | 232 | ||
| 193 | return ( | 233 | return ( |
| 194 | <div> | 234 | <div> |
| 195 | - <div className={styles.title}>{title}</div> | 235 | + <div className={styles.title}>{translatedTitle}</div> |
| 196 | <div className={styles.content1}> | 236 | <div className={styles.content1}> |
| 197 | <ShowType {...showTypeProps1} /> | 237 | <ShowType {...showTypeProps1} /> |
| 198 | <ShowType {...showTypeProps2} /> | 238 | <ShowType {...showTypeProps2} /> |
| @@ -232,7 +272,7 @@ const PrenatalReminderInfo = baseProps => { | @@ -232,7 +272,7 @@ const PrenatalReminderInfo = baseProps => { | ||
| 232 | 272 | ||
| 233 | return ( | 273 | return ( |
| 234 | <div> | 274 | <div> |
| 235 | - <div className={styles.title}>{title}</div> | 275 | + <div className={styles.title}>{translatedTitle}</div> |
| 236 | <div className={styles.content}> | 276 | <div className={styles.content}> |
| 237 | <ShowType {...showTypeProps} /> | 277 | <ShowType {...showTypeProps} /> |
| 238 | </div> | 278 | </div> |
src/mes/serviceUpkeep/equipmentRepair/index.js
| @@ -10,12 +10,75 @@ const EquipmentRepair = props => { | @@ -10,12 +10,75 @@ const EquipmentRepair = props => { | ||
| 10 | </div> | 10 | </div> |
| 11 | ); | 11 | ); |
| 12 | }; | 12 | }; |
| 13 | +// 在组件外部定义多语言映射 | ||
| 14 | +const tabTranslations = { | ||
| 15 | + sChinese: { | ||
| 16 | + "设备维修记录": "设备维修记录", | ||
| 17 | + "设备点检明细": "设备点检明细", | ||
| 18 | + "设备故障分析图表": "设备故障分析图表", | ||
| 19 | + "点检故障分析图表": "点检故障分析图表", | ||
| 20 | + "暂无数据": "暂无数据" | ||
| 21 | + }, | ||
| 22 | + sEnglish: { | ||
| 23 | + "设备维修记录": "Equipment Repair Records", | ||
| 24 | + "设备点检明细": "Equipment Inspection Details", | ||
| 25 | + "设备故障分析图表": "Equipment Fault Analysis Chart", | ||
| 26 | + "点检故障分析图表": "Inspection Fault Analysis Chart", | ||
| 27 | + "暂无数据": "No Data" | ||
| 28 | + }, | ||
| 29 | + sBig5: { | ||
| 30 | + "设备维修记录": "設備維修記錄", | ||
| 31 | + "设备点检明细": "設備點檢明細", | ||
| 32 | + "设备故障分析图表": "設備故障分析圖表", | ||
| 33 | + "点检故障分析图表": "點檢故障分析圖表", | ||
| 34 | + "暂无数据": "暫無數據" | ||
| 35 | + } | ||
| 36 | +}; | ||
| 37 | +// 获取翻译后的文本 | ||
| 38 | +const getTranslation = (app, text) => { | ||
| 39 | + const language = app?.userinfo?.sLanguage || 'sChinese'; | ||
| 40 | + return tabTranslations[language]?.[text] || text; | ||
| 41 | +}; | ||
| 42 | +// 在组件外部定义多语言映射 | ||
| 43 | +const equipmentTranslations = { | ||
| 44 | + sChinese: { | ||
| 45 | + "维修申请记录": "维修申请记录", | ||
| 46 | + "设备点检记录": "设备点检记录", | ||
| 47 | + "设备资料": "设备资料", | ||
| 48 | + "设备信息": "设备信息", | ||
| 49 | + "设备编号": "设备编号", | ||
| 50 | + "设备名称": "设备名称" | ||
| 51 | + }, | ||
| 52 | + sEnglish: { | ||
| 53 | + "维修申请记录": "Repair Request Records", | ||
| 54 | + "设备点检记录": "Equipment Inspection Records", | ||
| 55 | + "设备资料": "Equipment Information", | ||
| 56 | + "设备信息": "Equipment Info", | ||
| 57 | + "设备编号": "Equipment No.", | ||
| 58 | + "设备名称": "Equipment Name" | ||
| 59 | + }, | ||
| 60 | + sBig5: { | ||
| 61 | + "维修申请记录": "維修申請記錄", | ||
| 62 | + "设备点检记录": "設備點檢記錄", | ||
| 63 | + "设备资料": "設備資料", | ||
| 64 | + "设备信息": "設備信息", | ||
| 65 | + "设备编号": "設備編號", | ||
| 66 | + "设备名称": "設備名稱" | ||
| 67 | + } | ||
| 68 | +}; | ||
| 13 | 69 | ||
| 70 | +// 获取翻译后的文本 | ||
| 71 | +const getEquipmentTranslation = (app, text) => { | ||
| 72 | + const language = app?.userinfo?.sLanguage || 'sChinese'; | ||
| 73 | + return equipmentTranslations[language]?.[text] || text; | ||
| 74 | +}; | ||
| 14 | // 设备信息 | 75 | // 设备信息 |
| 15 | const EquipmentInfo = props => { | 76 | const EquipmentInfo = props => { |
| 16 | - const { sTabName = "" } = props; | ||
| 17 | - if (!["维修申请记录", "设备点检记录", "设备资料"].includes(sTabName)) | ||
| 18 | - return ""; | 77 | + const { sTabName = "", app } = props; |
| 78 | + | ||
| 79 | + // 仍然使用中文进行逻辑判断 | ||
| 80 | + const chineseTabs = ["维修申请记录", "设备点检记录", "设备资料"]; | ||
| 81 | + if (!chineseTabs.includes(sTabName)) return ""; | ||
| 19 | 82 | ||
| 20 | const tableName = | 83 | const tableName = |
| 21 | sTabName === "维修申请记录" | 84 | sTabName === "维修申请记录" |
| @@ -29,13 +92,13 @@ const EquipmentInfo = props => { | @@ -29,13 +92,13 @@ const EquipmentInfo = props => { | ||
| 29 | const { sMachineNo, sMachineName } = viewRow; | 92 | const { sMachineNo, sMachineName } = viewRow; |
| 30 | return ( | 93 | return ( |
| 31 | <div className={styles.equipmentInfo}> | 94 | <div className={styles.equipmentInfo}> |
| 32 | - <div className={styles.title}>设备信息</div> | 95 | + <div className={styles.title}>{getEquipmentTranslation(app, "设备信息")}</div> |
| 33 | <div className={styles.image} /> | 96 | <div className={styles.image} /> |
| 34 | <div className={styles.info}> | 97 | <div className={styles.info}> |
| 35 | <div className={styles.content}> | 98 | <div className={styles.content}> |
| 36 | - <div>设备编号:</div> | 99 | + <div>{getEquipmentTranslation(app, "设备编号")}:</div> |
| 37 | <div>{sMachineNo}</div> | 100 | <div>{sMachineNo}</div> |
| 38 | - <div>设备名称:</div> | 101 | + <div>{getEquipmentTranslation(app, "设备名称")}:</div> |
| 39 | <div>{sMachineName}</div> | 102 | <div>{sMachineName}</div> |
| 40 | </div> | 103 | </div> |
| 41 | </div> | 104 | </div> |
| @@ -45,15 +108,27 @@ const EquipmentInfo = props => { | @@ -45,15 +108,27 @@ const EquipmentInfo = props => { | ||
| 45 | 108 | ||
| 46 | // 设备故障分析图表 | 109 | // 设备故障分析图表 |
| 47 | const EquipmentFaultAnalysis = props => { | 110 | const EquipmentFaultAnalysis = props => { |
| 48 | - const { sTabName = "" } = props; | ||
| 49 | - if (!["设备维修记录", "设备点检明细"].includes(sTabName)) return ""; | 111 | + const { sTabName = "", app } = props; |
| 112 | + | ||
| 113 | + // 获取当前语言的tab名称 | ||
| 114 | + const chineseTabs = ["设备维修记录", "设备点检明细"]; | ||
| 115 | + const currentTabs = chineseTabs.map(tab => getTranslation(app, tab)); | ||
| 116 | + | ||
| 117 | + // 仍然使用中文进行逻辑判断 | ||
| 118 | + if (!chineseTabs.includes(sTabName)) return ""; | ||
| 50 | 119 | ||
| 51 | const tableName = sTabName === "设备维修记录" ? "table3" : "spotcheckanalyze"; | 120 | const tableName = sTabName === "设备维修记录" ? "table3" : "spotcheckanalyze"; |
| 52 | 121 | ||
| 53 | const xName = sTabName === "设备维修记录" ? "sFaultType" : "sIntervaltype"; | 122 | const xName = sTabName === "设备维修记录" ? "sFaultType" : "sIntervaltype"; |
| 54 | 123 | ||
| 55 | - const title = | ||
| 56 | - sTabName === "设备维修记录" ? "设备故障分析图表" : "点检故障分析图表"; | 124 | + // 使用currentTabs中的翻译后文本进行界面显示 |
| 125 | + const displayTabName = currentTabs[chineseTabs.indexOf(sTabName)]; | ||
| 126 | + | ||
| 127 | + // 获取翻译后的标题 | ||
| 128 | + const chineseTitle = sTabName === "设备维修记录" | ||
| 129 | + ? "设备故障分析图表" | ||
| 130 | + : "点检故障分析图表"; | ||
| 131 | + const title = getTranslation(app, chineseTitle); | ||
| 57 | 132 | ||
| 58 | const { [`${tableName}Data`]: tableData = [] } = props; | 133 | const { [`${tableName}Data`]: tableData = [] } = props; |
| 59 | 134 | ||
| @@ -89,7 +164,7 @@ const EquipmentFaultAnalysis = props => { | @@ -89,7 +164,7 @@ const EquipmentFaultAnalysis = props => { | ||
| 89 | {pieProps.data.length ? ( | 164 | {pieProps.data.length ? ( |
| 90 | <Pie {...pieProps} /> | 165 | <Pie {...pieProps} /> |
| 91 | ) : ( | 166 | ) : ( |
| 92 | - <div className={styles.noData}>暂无数据</div> | 167 | + <div className={styles.noData}>{getTranslation(app, "暂无数据")}</div> |
| 93 | )} | 168 | )} |
| 94 | </div> | 169 | </div> |
| 95 | </div> | 170 | </div> |