diff --git a/src/mes/productionExec/quickSwitchTabComponent/index.js b/src/mes/productionExec/quickSwitchTabComponent/index.js index 64cf822..930bd90 100644 --- a/src/mes/productionExec/quickSwitchTabComponent/index.js +++ b/src/mes/productionExec/quickSwitchTabComponent/index.js @@ -72,28 +72,31 @@ const QuickSwitchTabComponent = baseProps => { "", "12710101117087404588200" ]; + + // 定义多语言映射 + const translations = { + sEnglish: { + "生产执行": "Production Execution", + "质量巡检": "Quality Inspection", + "拼版图": "Assembly Drawing", + "产品图": "Product Drawing", + "报工任务": "Work Reporting ïTask", + "班组报工": "Team Production Reporting" + }, + sBig5: { + "生产执行": "生產執行", + "质量巡检": "質量巡檢", + "拼版图": "拼版圖", + "产品图": "產品圖", + "报工任务": "報工任務", + "班组报工": "班組報工", + } + }; + function translateList(language) { // 原始中文列表 const list = ["生产执行", "质量巡检", "拼版图", "产品图", "报工任务"]; - // 定义多语言映射 - const translations = { - sEnglish: { - "生产执行": "Production Execution", - "质量巡检": "Quality Inspection", - "拼版图": "Assembly Drawing", - "产品图": "Product Drawing", - "报工任务": "Work Reporting Task" - }, - sBig5: { - "生产执行": "生產執行", - "质量巡检": "質量巡檢", - "拼版图": "拼版圖", - "产品图": "產品圖", - "报工任务": "報工任務" - } - }; - // 根据语言设置进行转换 if (translations[language]) { return list.map(item => translations[language][item] || item); @@ -132,8 +135,8 @@ const QuickSwitchTabComponent = baseProps => { return list; } const sLanguage = props.app.userinfo.sLanguage || 'sChinese'; - list = translateList(sLanguage); - const tipList = translateTipList(sLanguage); + list = translateList(sLanguage); + const tipList = translateTipList(sLanguage); const no = commonFunc.showLocalMessage(props, 'No', '暂无'); return (
@@ -145,6 +148,11 @@ const QuickSwitchTabComponent = baseProps => { const { sModelsId } = currentMesPane; const tip = tipList[index]; + const getPath = (path) => { + if (sLanguage === "sChinese") return path; + return translations[sLanguage][path]; + } + return (
{ if (currentId) { props.onChangeRouter({ type: "name", - path: ["生产执行", title === "报工任务" ? "班组报工" : title] + path: [getPath("生产执行"), title === getPath("报工任务") ? getPath("班组报工") : title] }); } else { props.onGetFileUrl(title, url => {