From edd93ea6c019a8ae12390374599133e3a4d337c1 Mon Sep 17 00:00:00 2001 From: pengm <674192343@qq.com> Date: Wed, 27 Aug 2025 17:01:51 +0800 Subject: [PATCH] 1.完善MES翻译,处理上班,下班不调用指令集bug --- src/mes/common/commonModelComponent/index.js | 7 ++++++- src/mes/serviceUpkeep/equipmentRepair/index.js | 4 ++-- src/mes/teamInfo/index.js | 47 ++++++++++++++++++++++++++++++----------------- src/utils/utils.js | 2 +- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/mes/common/commonModelComponent/index.js b/src/mes/common/commonModelComponent/index.js index 72d742d..68acd9f 100644 --- a/src/mes/common/commonModelComponent/index.js +++ b/src/mes/common/commonModelComponent/index.js @@ -1219,6 +1219,7 @@ const CommonModelComponent = props => { const { sName, sTabName, + sEnglishTabName, showType, defaultEnabled, bHideTitle, @@ -1252,6 +1253,7 @@ const CommonModelComponent = props => { sName, // 配置对应的sGrd bHideTitle, //隐藏标题 tableBtnsConfig, // 表格按钮配置 + sEnglishTabName, bFirstComponent: level === 0 && index === -1 }; @@ -1651,6 +1653,7 @@ const CommonTableComponent = props => { sTabName, showType, sName, + sEnglishTabName, tableBtnsConfig: tableBtnsConfigOld = [] } = props; if (showType !== "table") return ""; @@ -1864,10 +1867,12 @@ const CommonTableComponent = props => { ...props, sName }; + const sLanguage = props.app.userinfo?.sLanguage; + const sTabLocalName = sLanguage === 'sEnglish' ? sEnglishTabName : sTabName; return ( <> - + { }; return ( ); }; + 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 请选择验证方式 const getFaceResult = async () => { let faceResult = false; 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); }, @@ -209,7 +221,7 @@ const useTeamInfoEvent = props => { // 人脸识别 faceResult = await new Promise(resolve => { const modal = Modal.info({ - title: "人脸识别", + title: faceRecognition, keyboard: false, content: ( { /> ), wrapClassName: "xlyFaceAuthModal", - okText: "取消", + okText: btnCancel, onOk() { resolve(false); } @@ -257,24 +269,24 @@ const useTeamInfoEvent = 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; } @@ -411,7 +423,8 @@ const TeamInfo = baseProps => { ); const { formData = [] } = props; if (!formData.length) return ""; - + const inWorking = commonFunc.showLocalMessage(props, 'inWorking', '当前正在上班中..."!'); + const workFirst = commonFunc.showLocalMessage(props, 'workFirst', '当前正在上班中..."!'); const tableBaseProps = commonBusiness.getTableTypes("slave0", props); const { config: slave0Config } = tableBaseProps; @@ -460,15 +473,15 @@ const TeamInfo = baseProps => { // ], onTableBtnClick: item => { const { record, config } = item; - if (config.showName === "上班") { + if (config.sChinese === "上班" || config.sControlName === 'BtnEnventStartWork') { if (record.sActualEmployeeName) { - message.info("当前正在上班中...", 3); + message.info(inWorking, 3); return; } props.onChangeWorkState(item, "on"); - } else if (config.showName === "下班") { + } else if (config.sChinese === "下班" || config.sControlName === 'BtnEnventOfftWork') { if (!record.sActualEmployeeName) { - message.info("请先上班", 3); + message.info(workFirst, 3); return; } props.onChangeWorkState(item, "off"); diff --git a/src/utils/utils.js b/src/utils/utils.js index 2c759a5..7138496 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -587,4 +587,4 @@ export function getAppData(name, key) { export function setAppData(name, value) { localStorage.setItem(`${config.prefix}${name}`, typeof value === "string" ? value : JSON.stringify(value)); -} \ No newline at end of file +} -- libgit2 0.22.2