From e5fd2b6f9ad242e020f14538958437865ad389ea Mon Sep 17 00:00:00 2001 From: pengm <674192343@qq.com> Date: Fri, 29 Aug 2025 16:03:28 +0800 Subject: [PATCH] 1.处理MES所有提示类的英文翻译 --- package.json | 4 ++-- src/components/Common/CommonHooks/useCommonBase.js | 6 +++--- src/components/Common/CommonInstructSet.js | 76 +++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- src/components/Common/commonBusiness.js | 2 +- src/mes/common/buttonComponent/index.js | 4 ++-- src/mes/common/commonModelComponent/index.js | 3 ++- src/mes/common/commonOperationBarComponent/index.js | 13 ++++++++----- src/mes/costomPageFun/index.js | 37 +++++++++++++++++++++++++------------ src/mes/indexMes/index.js | 17 +++++++++++------ src/mes/scheduledTasks/machineTasks/index.js | 6 ++++-- src/pad/verifyScrapBill/index.js | 55 ++++++++++++++++++++++++------------------------------- 11 files changed, 131 insertions(+), 92 deletions(-) diff --git a/package.json b/package.json index cadc844..7e3b747 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.5", "private": true, "scripts": { - "start": "set port=8543&roadhog server --progress --watch --colors --profile", + "start": "set port=9543&roadhog server --progress --watch --colors --profile", "build": "roadhog build", "lint": "eslint --ext .js src test", "precommit": "npm run lint" @@ -27,7 +27,7 @@ "babel-runtime": "6.26.0", "classnames": "^2.2.6", "copy-to-clipboard": "^3.3.1", - "core-js": "2.5.7", + "core-js": "^3.44.0", "dhtmlx-gantt": "^7.1.6", "dva": "^2.4.1", "dva-router-config": "^1.1.0", diff --git a/src/components/Common/CommonHooks/useCommonBase.js b/src/components/Common/CommonHooks/useCommonBase.js index 569d8cf..e12bdea 100644 --- a/src/components/Common/CommonHooks/useCommonBase.js +++ b/src/components/Common/CommonHooks/useCommonBase.js @@ -1952,7 +1952,7 @@ const useCommonBase = props => { const currentState = nextProps || state; const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); - const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); // 加入mes通用参数 const { app } = props; const { tableNameCompareJson = {} } = currentState; @@ -2144,9 +2144,9 @@ const useCommonBase = props => { }); } else if (code === -8) { Modal.info({ - title: "温馨提示:", + title: FriendlyReminder, content:
{handleGetMsg(msg)}
, - okText: "确认", + okText: BtnSure, onOk() { onConfirm && onConfirm(); }, diff --git a/src/components/Common/CommonInstructSet.js b/src/components/Common/CommonInstructSet.js index 65d97d1..0265795 100644 --- a/src/components/Common/CommonInstructSet.js +++ b/src/components/Common/CommonInstructSet.js @@ -251,7 +251,7 @@ const instructSetInit = async props => { ...resultData }; } - + } catch (error) { props.btnConfig.error? props.btnConfig.error(error) : ''; throw new Error(error); @@ -1099,6 +1099,10 @@ const handleMsg = async (props, instruct) => { ...utils.getDatasetDataList(props, instruct).dataOneObj }); } + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); + const errorPrompt = commonFunc.showLocalMessage(props, 'errorPrompt', '错误提示'); message.destroy(); if (code === 1) { @@ -1110,18 +1114,18 @@ const handleMsg = async (props, instruct) => { throw new Error(msg); } else if (code === 2) { Modal.info({ - title: "温馨提示:", + title: FriendlyReminder, content:
{msg}
, - okText: "确认", + okText: BtnSure, onOk() {} }); } else if (code === -7) { const result = await new Promise(resolve => { Modal.confirm({ - title: "温馨提示:", + title: FriendlyReminder, content:
{msg}
, - okText: "确认", - cancelText: "取消", + okText: BtnSure, + cancelText: BtnCancel, onOk() { resolve(true); }, @@ -1135,9 +1139,9 @@ const handleMsg = async (props, instruct) => { } } else if (code === -8) { Modal.error({ - title: "错误提示:", + title: errorPrompt, content:
{msg}
, - okText: "确认", + okText: BtnSure, onOk() {} }); throw new Error(msg); @@ -1280,6 +1284,19 @@ const handleFaceAuth = async (props, instruct) => { const mesSysbrands = commonUtils.convertStrToObj( localStorage.getItem("mesSysbrands") ); + const selectMethod = commonFunc.showLocalMessage(props, 'selectMethod', '请选择验证方式'); + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); + const accountPwd = commonFunc.showLocalMessage(props, 'account', '账号密码'); + const faceRecognition = commonFunc.showLocalMessage(props, 'faceRecognition', '人脸识别'); + const btnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); + const btnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确定'); + const enterAccountPwd = commonFunc.showLocalMessage(props, 'enterAccountPwd', '请输入账号密码'); + const nameNotEmpty = commonFunc.showLocalMessage(props, 'NameNotEmpty', '账号/姓名不能为空!'); + const passwordNotEmpty = commonFunc.showLocalMessage(props, 'PasswordNotEmpty', '密码不能为空!'); + const account = commonFunc.showLocalMessage(props, 'account', '账号'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); + const { tempMasterData = {} } = props; // 遍历登录文本组件 @@ -1325,13 +1342,13 @@ const handleFaceAuth = async (props, instruct) => { const loginType = await new Promise(resolve => { Modal.confirm({ - title: "温馨提示:", - content: "请选择验证方式", + title: FriendlyReminder, + content: selectMethod, closable: true, maskClosable: true, wrapClassName: "mesCommonModal", - cancelText: "账号密码", - okText: "人脸识别", + cancelText: accountPwd, + okText: faceRecognition, onOk() { resolve(1); }, @@ -1350,7 +1367,7 @@ const handleFaceAuth = async (props, instruct) => { // 人脸识别 result = await new Promise(resolve => { const modal = Modal.info({ - title: "人脸识别", + title: faceRecognition, keyboard: false, content: ( { /> ), wrapClassName: "xlyFaceAuthModal", - okText: "取消", + okText: btnCancel, onOk() { resolve({ stop: true @@ -1408,24 +1425,24 @@ const handleFaceAuth = async (props, instruct) => { result = await new Promise(resolve => { loginInfo = {}; Modal.confirm({ - title: "请输入账号密码:", + title: enterAccountPwd, content: (
{loginConfig.map(item => handleGetFormItem(props, item))}
), wrapClassName: "mesCommonModal mesLoginForm", - cancelText: "取消", - okText: "确定", + cancelText: BtnCancel, + okText: BtnSure, onOk(e) { if (e.name) { if (!loginInfo.sUserNo && !loginInfo.sUserName) { - message.error("账号/姓名不能为空!"); + message.error(nameNotEmpty); return; } if (!loginInfo.sPassWord) { - message.error("密码不能为空!"); + message.error(passwordNotEmpty); return; } @@ -2122,6 +2139,11 @@ const handleCalcprocedure = async (props, instruct) => { const { dataset = "*", sButtonParam, sProName } = instruct; const datasetList = dataset.split(","); + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); + const errorPrompt = commonFunc.showLocalMessage(props, 'errorPrompt', '错误提示'); + // 获取页面所有tableName const tableNameList = Object.keys(props) .filter(key => { @@ -2177,18 +2199,18 @@ const handleCalcprocedure = async (props, instruct) => { throw new Error(msg); } else if (code === 2) { Modal.info({ - title: "温馨提示:", + title: FriendlyReminder, content:
{msg}
, - okText: "确认", + okText: BtnSure, onOk() {} }); } else if (code === -7) { const result = await new Promise(resolve => { Modal.confirm({ - title: "温馨提示:", + title: FriendlyReminder, content:
{msg}
, - okText: "确认", - cancelText: "取消", + okText: BtnSure, + cancelText: BtnCancel, onOk() { resolve(true); }, @@ -2202,9 +2224,9 @@ const handleCalcprocedure = async (props, instruct) => { } } else if (code === -8) { Modal.error({ - title: "错误提示:", + title: errorPrompt, content:
{msg}
, - okText: "确认", + okText: BtnCancel, onOk() {} }); throw new Error(msg); @@ -2502,7 +2524,7 @@ const utils = { return tableData[0]; } else if (filterType === "last") { return tableData[tableData.length - 1]; - } + } return tableData; }, diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js index e194cc9..d61d7fe 100644 --- a/src/components/Common/commonBusiness.js +++ b/src/components/Common/commonBusiness.js @@ -188,7 +188,7 @@ export async function saveData(param) { return dataReturn; } else if (dataReturn.code === 2) { Modal.info({ - title: '温馨提示', + // title: '温馨提示', content: ( // eslint-disable-next-line react/react-in-jsx-scope
diff --git a/src/mes/common/buttonComponent/index.js b/src/mes/common/buttonComponent/index.js index 16cd59b..3ba3970 100644 --- a/src/mes/common/buttonComponent/index.js +++ b/src/mes/common/buttonComponent/index.js @@ -228,14 +228,14 @@ const ButtonComponent = props => { const menuOrderList3 = [ ["设备保养", 21], - ["设备点检", 22], + // ["设备点检", 22], ["设备维修", 23], ["设备资料", 24] ]; const menuOrderListEnglish3 = [ ["Equipment Maintenance", 21], - ["Equipment Check", 22], + // ["Equipment Check", 22], ["Equipment Repair", 23], ["Equipment Documentation", 24] ]; diff --git a/src/mes/common/commonModelComponent/index.js b/src/mes/common/commonModelComponent/index.js index 5ab4d0c..85e1a05 100644 --- a/src/mes/common/commonModelComponent/index.js +++ b/src/mes/common/commonModelComponent/index.js @@ -1289,8 +1289,9 @@ const CommonModelComponent = props => { height = "100%" } = item; console.log('ssconfigLists', configList, sEntireTabName ); - const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName + '1111' : + const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName : sLanguage === 'sBig5EntireTabName' ? sBig5EntireTabName : sEntireTabName; + console.log('sEntireTabNameNew', sEntireTabNameNew); const advancedStyle = mode === "advanced" ? { diff --git a/src/mes/common/commonOperationBarComponent/index.js b/src/mes/common/commonOperationBarComponent/index.js index 5cbc6da..06781c3 100644 --- a/src/mes/common/commonOperationBarComponent/index.js +++ b/src/mes/common/commonOperationBarComponent/index.js @@ -74,17 +74,20 @@ const useCommonOperationBarComponentEvent = props => { return returnData; }; - + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); + const confirmOperation = commonFunc.showLocalMessage(props, 'confirmOperation', '是否确认此操作'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); // 按钮点击事件 const clickRef = useRef(null); const handleBtnClick = async (config, searchField) => { if (config?.sMinValue === "99") { // 二次确认 const result = await new Promise(resolve => { Modal.confirm({ - title: "温馨提示:", - content: "是否确认此操作?", - okText: "确认", - cancelText: "取消", + title: FriendlyReminder, + content: confirmOperation, + okText: BtnSure, + cancelText: BtnCancel, onOk() { setTimeout(() => { resolve(true); diff --git a/src/mes/costomPageFun/index.js b/src/mes/costomPageFun/index.js index 4b611cc..a1f667a 100644 --- a/src/mes/costomPageFun/index.js +++ b/src/mes/costomPageFun/index.js @@ -4,6 +4,7 @@ import { message, Form, Modal } from "antd"; import * as commonUtils from "@/utils/utils"; import * as commonConfig from "@/utils/config"; import * as commonServices from "@/services/services"; +import * as commonFunc from "@/components/Common/commonFunc"; import FaceDetect from "@/components/FaceDetect"; import ShowType from "@/components/Common/CommonComponent"; const costomPageFun = ({ props, tableName, sFieldName, actionName }) => { @@ -1317,7 +1318,7 @@ const handleZlxjCheck = async (props, btnName) => { message.warning('人脸信息获取失败,请重新尝试!'); return; } - + const table0DataNew = cloneDeep(table0Data); const table1DataNew = cloneDeep(table1Data); table0DataNew[0].sCurRole = sCurRole; @@ -1388,15 +1389,27 @@ const handleGetFormItem = (props, item) => { const getFaceResult = async (props) => { let faceResult = false; + + + const selectMethod = commonFunc.showLocalMessage(props, 'selectMethod', '请选择验证方式'); + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); + const accountPwd = commonFunc.showLocalMessage(props, 'account', '账号密码'); + const faceRecognition = commonFunc.showLocalMessage(props, 'faceRecognition', '人脸识别'); + const btnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); + const btnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确定'); + const enterAccountPwd = commonFunc.showLocalMessage(props, 'enterAccountPwd', '请输入账号密码'); + const nameNotEmpty = commonFunc.showLocalMessage(props, 'NameNotEmpty', '账号/姓名不能为空!'); + const passwordNotEmpty = commonFunc.showLocalMessage(props, 'PasswordNotEmpty', '密码不能为空!'); + const account = commonFunc.showLocalMessage(props, 'account', '账号'); const loginType = await new Promise(resolve => { Modal.confirm({ - title: "温馨提示:", - content: "请选择验证方式", + title: FriendlyReminder, + content: selectMethod, closable: true, maskClosable: true, wrapClassName: "mesCommonModal", - cancelText: "账号密码", - okText: "人脸识别", + cancelText:accountPwd, + okText: faceRecognition, onOk() { resolve(1); }, @@ -1415,7 +1428,7 @@ const getFaceResult = async (props) => { // 人脸识别 faceResult = await new Promise(resolve => { const modal = Modal.info({ - title: "人脸识别", + title: faceRecognition, keyboard: false, content: ( { /> ), wrapClassName: "xlyFaceAuthModal", - okText: "取消", + okText: btnCancel, onOk() { resolve(false); } @@ -1463,24 +1476,24 @@ const getFaceResult = async (props) => { faceResult = await new Promise(resolve => { loginInfo = {}; Modal.confirm({ - title: "请输入账号密码:", + title: enterAccountPwd, content: (
{loginConfig.map(item => handleGetFormItem(props, item))}
), wrapClassName: "mesCommonModal mesLoginForm", - cancelText: "取消", - okText: "确定", + cancelText: btnCancel, + okText: btnSure, onOk(e) { if (e.name) { if (!loginInfo.sUserNo && !loginInfo.sUserName) { - message.error("账号/姓名不能为空!"); + message.error(nameNotEmpty); return; } if (!loginInfo.sPassWord) { - message.error("密码不能为空!"); + message.error(passwordNotEmpty); return; } diff --git a/src/mes/indexMes/index.js b/src/mes/indexMes/index.js index a8629c1..66c0870 100644 --- a/src/mes/indexMes/index.js +++ b/src/mes/indexMes/index.js @@ -630,7 +630,7 @@ const HeaderConponent = () => { destroyOnClose={true} maskClosable={false} wrapClassName={ styles.ztwwwww }> - +
@@ -639,7 +639,7 @@ const HeaderConponent = () => { // 停机状态栏 -const MachineMessageComponent = ({ e , shutDown }) => { +const MachineMessageComponent = ({ e , shutDown, props }) => { const value = e.item?.props?.value || {}; const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss")); const { backgroundColor, conent2, fontSize } = value; @@ -675,12 +675,17 @@ const MachineMessageComponent = ({ e , shutDown }) => { }; }, []); + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); + const confirmState = commonFunc.showLocalMessage(props, 'confirmState', '确认退出该状态?'); + const handleMenuClose = () => { Modal.confirm({ - title: "温馨提示:", - content:
确认退出该状态?
, - okText: "确认", - cancelText: "取消", + title: FriendlyReminder, + content:
{confirmState}
, + okText: BtnSure, + cancelText: BtnCancel, zIndex: 2000, onOk() { shutDown() diff --git a/src/mes/scheduledTasks/machineTasks/index.js b/src/mes/scheduledTasks/machineTasks/index.js index 462c390..727281d 100644 --- a/src/mes/scheduledTasks/machineTasks/index.js +++ b/src/mes/scheduledTasks/machineTasks/index.js @@ -699,6 +699,8 @@ const btnsearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询'); const btnAll = commonFunc.showLocalMessage(props, 'btnAll', '全部'); const sWorkOrderNo = commonFunc.showLocalMessage(props, 'sWorkOrderNo', '工单编号'); + const deviceInfo = commonFunc.showLocalMessage(props, 'deviceInfo', '设备信息'); + const TasksQty = commonFunc.showLocalMessage(props, 'TasksQty', '今日完成任务批次/产量(个)'); return (
@@ -756,7 +758,7 @@ -

设备信息

+

{deviceInfo}

{taskInfoData.sMachineNameTitle} @@ -809,7 +811,7 @@
{taskInfoData.tStartingUpTimeTitle}
-

今日完成任务批次/产量(个):

+

{TasksQty}:

{taskInfoData.iFinishTaskBatchConent} /{" "} {taskInfoData.iFinishProductionNumConent} diff --git a/src/pad/verifyScrapBill/index.js b/src/pad/verifyScrapBill/index.js index 9215b54..26fd1f4 100644 --- a/src/pad/verifyScrapBill/index.js +++ b/src/pad/verifyScrapBill/index.js @@ -287,7 +287,10 @@ const useVerifyScrapBillEvent = props => { props.onBackList(); } }; - + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); + const confirmDelete = commonFunc.showLocalMessage(props, 'confirmDelete', '确定删除'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); // 删除 const handleBtnDel = () => { const handleOkDel = async () => { @@ -299,24 +302,6 @@ const useVerifyScrapBillEvent = props => { masterData, slaveConfig } = props; - // const { userinfo, systemData } = app; - // const { sMakePerson } = masterData; /* 本单据制单人 */ - // const { sUserName, sType } = userinfo; /* 登录用户 */ - // const iIndex = systemData.findIndex( - // item => item.sName === "CkxModifyBillNoMakePerson" - // ); - // if (iIndex > -1) { - // const sValue = systemData[iIndex].sValue; - // if (sValue === "0") { - // /* 系统未启用非制单人修改单据,普通用户非制单人不可以修改制单人的单据 */ - // if (sType !== "sysadmin" && sUserName !== sMakePerson) { - // message.error( - // commonFunc.showMessage(app.commonConst, "NoDelByNoMakePerson") - // ); - // return; - // } - // } - // } const value = { sClientType: "1", @@ -349,10 +334,10 @@ const useVerifyScrapBillEvent = props => { }; Modal.confirm({ - title: "温馨提示:", - content:

确认删除?
, - okText: "确认", - cancelText: "取消", + title: FriendlyReminder, + content:
{confirmDelete}
, + okText: BtnSure, + cancelText: BtnCancel, onOk() { handleOkDel(); } @@ -485,7 +470,9 @@ const VerifyScrapBill = baseProps => { sProcessParentId: currentProcessParentId } }; - + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');4 + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); return (
@@ -498,10 +485,10 @@ const VerifyScrapBill = baseProps => { onClick={() => { if (enabled) { Modal.confirm({ - title: "温馨提示:", + title: FriendlyReminder, content: "单据未保存,是否保存后返回?", - okText: "确认", - cancelText: "取消", + okText: BtnSure, + cancelText: BtnCancel, onOk() { props.onBtnSave(() => { props.onBackList(); @@ -640,8 +627,14 @@ const FormComponent = props => { return ; }; + // 表格 const TableComponent = props => { + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); + const confirmDelRow = commonFunc.showLocalMessage(props, 'confirmDelRow', '确认删除行?'); + const baseProps = commonBusiness.getTableTypes("slave", { ...props, noStorageColumn: true @@ -655,10 +648,10 @@ const TableComponent = props => { bAddFirst: true, onMesTableLineDel: (...args) => { Modal.confirm({ - title: "温馨提示:", - content:
确认删除行?
, - okText: "确认", - cancelText: "取消", + title: FriendlyReminder, + content:
{confirmDelRow}
, + okText: BtnSure, + cancelText: BtnCancel, onOk() { props.onMesTableLineDel(...args); } -- libgit2 0.22.2