diff --git a/src/mes/scheduledTasks/machineTasks/index.js b/src/mes/scheduledTasks/machineTasks/index.js index 8384324..d7e2ecb 100644 --- a/src/mes/scheduledTasks/machineTasks/index.js +++ b/src/mes/scheduledTasks/machineTasks/index.js @@ -508,6 +508,9 @@ slave0Config?.gdsconfigformslave?.find( item => item.sControlName === "BtnTableCopyTo.pauseWork" ) || {}; + const beginConstruction = commonFunc.showLocalMessage(props, 'beginConstruction', '开工'); + const finishConstruction = commonFunc.showLocalMessage(props, 'finishConstruction', '完工'); + const pause = commonFunc.showLocalMessage(props, 'pause', '暂停'); // 表格业务 const [sSrcNo, setSSrcNo] = useState(""); @@ -533,13 +536,13 @@ let showName, btnBgColor, sDefault; if (iStar === 1) { - showName = "暂停"; + showName = pause; btnBgColor = "#FAAD14"; } else if (iStar === 2 || iStar === 3) { - showName = "开工"; + showName = beginConstruction; btnBgColor = "#1890FF"; } else { - showName = "完工"; + showName = finishConstruction; btnBgColor = "#AAA"; sDefault = "${false}"; } diff --git a/src/mes/scheduledTasks/prenatalReminderInfo/index.js b/src/mes/scheduledTasks/prenatalReminderInfo/index.js index 97aaed4..d79e424 100644 --- a/src/mes/scheduledTasks/prenatalReminderInfo/index.js +++ b/src/mes/scheduledTasks/prenatalReminderInfo/index.js @@ -5,7 +5,41 @@ import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; import ShowType from "@/components/Common/CommonComponent"; import styles from "./index.less"; - +const titleTranslations = { + sChinese: { + '技术评审汇签': '技术评审汇签', + '客户投诉': '客户投诉', + '本批生产注意事项': '本批生产注意事项', + '不合格报告': '不合格报告', + '车间产前提醒(品管)': '车间产前提醒(品管)', + '制程异常': '制程异常', + '质检反馈': '质检反馈', + '二维码提醒': '二维码提醒', + '车间产前提醒': '车间产前提醒' + }, + sEnglish: { + '技术评审汇签': 'Technical Review', + '客户投诉': 'Customer Complaint', + '本批生产注意事项': 'Production Notes', + '不合格报告': 'Nonconformance Report', + '车间产前提醒(品管)': 'Pre-production Reminder(QC)', + '制程异常': 'Process Exception', + '质检反馈': 'Quality Feedback', + '二维码提醒': 'QR Code Reminder', + '车间产前提醒': 'Pre-production Reminder' + }, + sBig5: { + '技术评审汇签': '技術評審匯簽', + '客户投诉': '客戶投訴', + '本批生产注意事项': '本批生產注意事項', + '不合格报告': '不合格報告', + '车间产前提醒(品管)': '車間產前提醒(品管)', + '制程异常': '製程異常', + '质检反馈': '質檢反饋', + '二维码提醒': '二維碼提醒', + '车间产前提醒': '車間產前提醒' + } +}; const usePrenatalReminderInfoEvent = props => { const { formData } = props; @@ -60,7 +94,11 @@ const usePrenatalReminderInfoEvent = props => { ...props }; }; - +// 封装多语言处理方法 +const getTranslatedTitle = (app, originalTitle) => { + const language = app?.userinfo?.sLanguage || 'sChinese'; + return titleTranslations[language]?.[originalTitle] || originalTitle; +}; const PrenatalReminderInfo = baseProps => { const props = usePrenatalReminderInfoEvent(useCommonBase(baseProps)); const { bFinish } = props; @@ -97,6 +135,8 @@ const PrenatalReminderInfo = baseProps => { "二维码提醒", "车间产前提醒" ].map((title, index) => { + const translatedTitle = getTranslatedTitle(app, title); + let dataValueNew = ""; const child = { sId: commonUtils.createSid(), @@ -192,7 +232,7 @@ const PrenatalReminderInfo = baseProps => { return (
-
{title}
+
{translatedTitle}
@@ -232,7 +272,7 @@ const PrenatalReminderInfo = baseProps => { return (
-
{title}
+
{translatedTitle}
diff --git a/src/mes/serviceUpkeep/equipmentRepair/index.js b/src/mes/serviceUpkeep/equipmentRepair/index.js index 0b1c408..ce8df27 100644 --- a/src/mes/serviceUpkeep/equipmentRepair/index.js +++ b/src/mes/serviceUpkeep/equipmentRepair/index.js @@ -10,12 +10,75 @@ const EquipmentRepair = props => {
); }; +// 在组件外部定义多语言映射 +const tabTranslations = { + sChinese: { + "设备维修记录": "设备维修记录", + "设备点检明细": "设备点检明细", + "设备故障分析图表": "设备故障分析图表", + "点检故障分析图表": "点检故障分析图表", + "暂无数据": "暂无数据" + }, + sEnglish: { + "设备维修记录": "Equipment Repair Records", + "设备点检明细": "Equipment Inspection Details", + "设备故障分析图表": "Equipment Fault Analysis Chart", + "点检故障分析图表": "Inspection Fault Analysis Chart", + "暂无数据": "No Data" + }, + sBig5: { + "设备维修记录": "設備維修記錄", + "设备点检明细": "設備點檢明細", + "设备故障分析图表": "設備故障分析圖表", + "点检故障分析图表": "點檢故障分析圖表", + "暂无数据": "暫無數據" + } +}; +// 获取翻译后的文本 +const getTranslation = (app, text) => { + const language = app?.userinfo?.sLanguage || 'sChinese'; + return tabTranslations[language]?.[text] || text; +}; +// 在组件外部定义多语言映射 +const equipmentTranslations = { + sChinese: { + "维修申请记录": "维修申请记录", + "设备点检记录": "设备点检记录", + "设备资料": "设备资料", + "设备信息": "设备信息", + "设备编号": "设备编号", + "设备名称": "设备名称" + }, + sEnglish: { + "维修申请记录": "Repair Request Records", + "设备点检记录": "Equipment Inspection Records", + "设备资料": "Equipment Information", + "设备信息": "Equipment Info", + "设备编号": "Equipment No.", + "设备名称": "Equipment Name" + }, + sBig5: { + "维修申请记录": "維修申請記錄", + "设备点检记录": "設備點檢記錄", + "设备资料": "設備資料", + "设备信息": "設備信息", + "设备编号": "設備編號", + "设备名称": "設備名稱" + } +}; +// 获取翻译后的文本 +const getEquipmentTranslation = (app, text) => { + const language = app?.userinfo?.sLanguage || 'sChinese'; + return equipmentTranslations[language]?.[text] || text; +}; // 设备信息 const EquipmentInfo = props => { - const { sTabName = "" } = props; - if (!["维修申请记录", "设备点检记录", "设备资料"].includes(sTabName)) - return ""; + const { sTabName = "", app } = props; + + // 仍然使用中文进行逻辑判断 + const chineseTabs = ["维修申请记录", "设备点检记录", "设备资料"]; + if (!chineseTabs.includes(sTabName)) return ""; const tableName = sTabName === "维修申请记录" @@ -29,13 +92,13 @@ const EquipmentInfo = props => { const { sMachineNo, sMachineName } = viewRow; return (
-
设备信息
+
{getEquipmentTranslation(app, "设备信息")}
-
设备编号:
+
{getEquipmentTranslation(app, "设备编号")}:
{sMachineNo}
-
设备名称:
+
{getEquipmentTranslation(app, "设备名称")}:
{sMachineName}
@@ -45,15 +108,27 @@ const EquipmentInfo = props => { // 设备故障分析图表 const EquipmentFaultAnalysis = props => { - const { sTabName = "" } = props; - if (!["设备维修记录", "设备点检明细"].includes(sTabName)) return ""; + const { sTabName = "", app } = props; + + // 获取当前语言的tab名称 + const chineseTabs = ["设备维修记录", "设备点检明细"]; + const currentTabs = chineseTabs.map(tab => getTranslation(app, tab)); + + // 仍然使用中文进行逻辑判断 + if (!chineseTabs.includes(sTabName)) return ""; const tableName = sTabName === "设备维修记录" ? "table3" : "spotcheckanalyze"; const xName = sTabName === "设备维修记录" ? "sFaultType" : "sIntervaltype"; - const title = - sTabName === "设备维修记录" ? "设备故障分析图表" : "点检故障分析图表"; + // 使用currentTabs中的翻译后文本进行界面显示 + const displayTabName = currentTabs[chineseTabs.indexOf(sTabName)]; + + // 获取翻译后的标题 + const chineseTitle = sTabName === "设备维修记录" + ? "设备故障分析图表" + : "点检故障分析图表"; + const title = getTranslation(app, chineseTitle); const { [`${tableName}Data`]: tableData = [] } = props; @@ -89,7 +164,7 @@ const EquipmentFaultAnalysis = props => { {pieProps.data.length ? ( ) : ( -
暂无数据
+
{getTranslation(app, "暂无数据")}
)}