From ca2c115497c7bb45566a47667d254465a16614d0 Mon Sep 17 00:00:00 2001 From: pengm <674192343@qq.com> Date: Mon, 1 Sep 2025 14:51:09 +0800 Subject: [PATCH] 1.完善MES按钮类,弹窗类英文翻译 --- src/components/Common/CommonBillEvent.js | 3 ++- src/components/Common/CommonComponent/index.js | 17 ++++++++++------- src/components/Common/CommonListSelect/index.js | 9 +++++---- src/components/Common/CommonListSelectTree/index.js | 6 ++++-- src/components/Common/CommonListTreeSelect/index.js | 7 ++++--- src/components/Common/CommonTable/index.js | 7 ++++--- src/components/Common/CommonViewDragable/index.js | 6 ++++-- src/components/Common/SearchComponent/index.js | 6 ++++-- src/components/Common/SlaveMemo.js | 3 ++- src/components/Common/commonBusiness.js | 3 ++- src/components/Draggable/index.js | 2 ++ src/mes/common/commonModalComponent/index.js | 5 +++-- src/mes/common/commonModelComponent/index.js | 10 +++++----- src/mes/common/commonOperationBarComponent/index.js | 7 ++++--- src/mes/indexMes/index.js | 8 +++++--- src/mes/productionExec/quickSwitchTabComponent/index.js | 5 +++-- src/mes/scheduledTasks/machineTasks/index.js | 17 ++++++++++------- 17 files changed, 73 insertions(+), 48 deletions(-) diff --git a/src/components/Common/CommonBillEvent.js b/src/components/Common/CommonBillEvent.js index 1e8d9cc..8fbdf21 100644 --- a/src/components/Common/CommonBillEvent.js +++ b/src/components/Common/CommonBillEvent.js @@ -5038,6 +5038,7 @@ export default (ChildComponent) => { this.handleGetData(masterConfig, slaveConfig, checkConfig); } else if(name && name.includes('BtnTempSql')) { /* 通过BtnTempSql按钮 自定义调用Sql 并将数据回填到界面上 */ const { masterConfig, slaveConfig, sModelsId, token } = this.props; + const sOperaSuccess = commonFunc.showLocalMessage(props, 'sOperaSuccess', '操作成功'); let { masterData,slaveData } = this.props; const slave0Data = []; const slave1Data = []; @@ -5211,7 +5212,7 @@ export default (ChildComponent) => { const dataReturn = (await commonServices.postValueService(this.props.app.token, value, url)).data; if (dataReturn.code === 1) { /* 数据操作 数据回传页面 */ - message.success('操作成功!'); + message.success(sOperaSuccess); const returnData = dataReturn.dataset.rows[0]; if (commonUtils.isNotEmptyArr(slaveNameList) && commonUtils.isNotEmptyObject(returnData)) { slaveNameList.forEach((name, index) => { diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index e55b4cd..e87edf7 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -2,6 +2,7 @@ import moment from 'moment'; import React, { Component, createRef } from 'react'; import reactComponentDebounce from '@/components/Common/ReactDebounce'; import '@ant-design/compatible/assets/index.css'; +import * as commonFunc from '@/components/Common/commonFunc'; import { InputNumber, Checkbox, @@ -558,6 +559,7 @@ export default class CommonComponent extends Component { } /** 获取selectprops对象 */ getSelectProps = () => { + const noData = commonFunc.showLocalMessage(this.props, 'noData', '暂无数据'); /* 返回值声明 */ const obj = { showSearch: true, /* 是否有查找功能 */ @@ -567,7 +569,7 @@ export default class CommonComponent extends Component { onDropdownVisibleChange: this.onDropdownVisibleChange, onPopupScroll: this.handlePopupScroll, onSearch: this.handleSearch, - notFoundContent: this.state.spinState ? : '暂无数据', + notFoundContent: this.state.spinState ? : noData, // getPopupContainer: this.props.name === 'slave' || this.props.name === 'searchColumnShow' ? this.getPopupContainer : null,/*解决下拉框不随浏览器滚动问题 */ onFocus: this.onFocus, onBlur: this.onBlur, @@ -825,6 +827,7 @@ export default class CommonComponent extends Component { /** 获取complete对象 */ getCompleteProps = () => { /* 返回值声明 */ + const noData = commonFunc.showLocalMessage(this.props, 'noData', '暂无数据'); const obj = { // disabled: !this.state.enabled /* 修改的时候传过来的数据 */ onChange: this.handleCompleteInputEvent, /* 选择触发事件 */ @@ -857,7 +860,7 @@ export default class CommonComponent extends Component { /* 区分Oee设置字体与其他系统设置字体 */ dropdownClassName: commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf('oee') > -1 ? (location.pathname.toLowerCase().indexOf('loginoee') > -1 ? 'loginOeeDropDown' : 'oeeDropDown') : '', onSearch: this.handleSearch, - notFoundContent: this.state.spinState ? : '暂无数据', + notFoundContent: this.state.spinState ? : noData, onFocus: this.onFocus, onBlur: this.onBlur, }; @@ -1406,7 +1409,7 @@ export default class CommonComponent extends Component { obj.title = obj.value; } obj.placeholder = this.props.showConfig.placeholder; - + if (this.props.name === "tableS0" && this.props.showConfig.sName === "sStatus") { if (this.state.dataValue === "已提交") { obj.className = "sStatusSubmit"; @@ -2716,7 +2719,7 @@ export default class CommonComponent extends Component { // 登记取样特殊处理 if(slaveConfig.sId=='12710101117346647176280'){ - + if(innerInputProps.id.includes('bReturn')){ window.$xlyStorage = this.props.dataValue; } @@ -2725,7 +2728,7 @@ export default class CommonComponent extends Component { this.myRef.current.querySelector('input').addEventListener('keydown',(event)=>{ if (event.code === 'NumpadEnter' || event.code === 'Enter') { // 或者使用 event.keyCode === 13 - + event.preventDefault(); // 阻止默认行为 // console.log(this.value) // const inputValue = this.value; @@ -2767,7 +2770,7 @@ export default class CommonComponent extends Component { }) - + // debugger // innerInputProps.onPressEnter = (event2)=>{ // setTimeout(()=>{ @@ -3065,7 +3068,7 @@ export default class CommonComponent extends Component { const fieldDecoratorProps = this.getFieldDecoratorProps(); /* 通用组件(主表存在getFieldDecorator表单验证,而从表则不需要) */ - + // 班组报工,产量上报信息,label文字颜色特殊处理 if(slaveConfig.sId=='17087428780006438414984564455000'){ // 计件 diff --git a/src/components/Common/CommonListSelect/index.js b/src/components/Common/CommonListSelect/index.js index c52e706..715a0ac 100644 --- a/src/components/Common/CommonListSelect/index.js +++ b/src/components/Common/CommonListSelect/index.js @@ -276,11 +276,12 @@ const CommonListComponent = Form.create({ const bPadPop = props.sModelsId === "12710101117211852461310" || props.sModelsId === "12710101117218031681520"; - + if (bPadPop) { tableProps.fixedHeight = "325px"; } - + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); return (
@@ -326,8 +327,8 @@ const CommonListComponent = Form.create({ }
- - + +
: '' } diff --git a/src/components/Common/CommonListSelectTree/index.js b/src/components/Common/CommonListSelectTree/index.js index 8049c3b..caf73dc 100644 --- a/src/components/Common/CommonListSelectTree/index.js +++ b/src/components/Common/CommonListSelectTree/index.js @@ -450,6 +450,8 @@ const CommonListComponent = Form.create({ } } }; + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); return (
@@ -505,8 +507,8 @@ const CommonListComponent = Form.create({ width: '50%', textAlign: 'right', marginRight: '9px', marginBottom: '9px', }} > - - + +
diff --git a/src/components/Common/CommonListTreeSelect/index.js b/src/components/Common/CommonListTreeSelect/index.js index e1d3c9d..420d549 100644 --- a/src/components/Common/CommonListTreeSelect/index.js +++ b/src/components/Common/CommonListTreeSelect/index.js @@ -564,7 +564,8 @@ const CommonListComponent = Form.create({ } } }; - + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); return ( @@ -609,8 +610,8 @@ const CommonListComponent = Form.create({ }
- - + +
: '' } diff --git a/src/components/Common/CommonTable/index.js b/src/components/Common/CommonTable/index.js index 2460303..1f0f7fd 100644 --- a/src/components/Common/CommonTable/index.js +++ b/src/components/Common/CommonTable/index.js @@ -12004,10 +12004,11 @@ const useCommonTableEvent = props => { if (props.onGetTotalDiv) { addState.getTotalDiv = props.onGetTotalDiv; } - + const sDetailTitle = commonFunc.showLocalMessage(props, 'sDetailTitle', '详细'); + const BtnClose = commonFunc.showLocalMessage(props, 'BtnClose', '关闭'); const handleShowSimpleModal = htmlString => { Modal.info({ - title: 详细, + title: {sDetailTitle}, width: "70%", content: (
{ dangerouslySetInnerHTML={{ __html: htmlString }} /> ), - okText: "关闭" + okText: BtnClose }); }; diff --git a/src/components/Common/CommonViewDragable/index.js b/src/components/Common/CommonViewDragable/index.js index 97ae18e..ed03713 100644 --- a/src/components/Common/CommonViewDragable/index.js +++ b/src/components/Common/CommonViewDragable/index.js @@ -135,6 +135,7 @@ const ParamTableComponent = childProps => { const RGLComponent = childProps => { const { props, hooksProps } = useContext(myContext); const { tableName } = props; + const { selectedData } = hooksProps; const { sParamType } = childProps; const xlyRGLRef = useRef(null); @@ -216,12 +217,13 @@ const RGLComponent = childProps => {
) : ( - + ); }; const EmptyComponent = () => { - return
暂无数据
; + const noData = commonFunc.showLocalMessage(this.props, 'noData', '暂无数据'); + return
{noData}
; }; // 获取选中数据 diff --git a/src/components/Common/SearchComponent/index.js b/src/components/Common/SearchComponent/index.js index 43b041a..d5d809a 100644 --- a/src/components/Common/SearchComponent/index.js +++ b/src/components/Common/SearchComponent/index.js @@ -1179,6 +1179,8 @@ export default class SearchComponent extends Component { const btnSaveAndSearch = commonFunc.showMessage(app.commonConst, 'btnSaveAndSearch') || "保存并查询";/* 保存并查询 */ const solutionFilterSave = commonFunc.showMessage(app.commonConst, 'solutionFilterSave'); const solutionFilterNameUpd = commonFunc.showMessage(app.commonConst, 'solutionFilterNameUpd'); + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); const modalCom = ( diff --git a/src/components/Common/SlaveMemo.js b/src/components/Common/SlaveMemo.js index 18a2086..c0657e5 100644 --- a/src/components/Common/SlaveMemo.js +++ b/src/components/Common/SlaveMemo.js @@ -218,7 +218,8 @@ class SlaveMemoRc extends Component { let bVisibleMemo; let sMemoField; let btnName = ""; - const title = "详细"; + const sDetailTitle = commonFunc.showLocalMessage(props, 'sDetailTitle', '详细'); + const title = sDetailTitle; let bEnabledTextArea = false; /* 多行文本默认可输入 非编辑状态多行文本禁止输入 */ if (commonUtils.isNotEmptyObject(sCurrMemoProps)) { bVisibleMemo = sCurrMemoProps.bVisibleMemo; diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js index d61d7fe..68ea31b 100644 --- a/src/components/Common/commonBusiness.js +++ b/src/components/Common/commonBusiness.js @@ -1267,8 +1267,9 @@ export async function clearSocketData(param) { * */ export function createMemoProps(name, props) { const { sCurrMemoProps } = props; + const sDetailTitle = commonFunc.showLocalMessage(props, 'sDetailTitle', '详细'); if (commonUtils.isNotEmptyObject(sCurrMemoProps) && commonUtils.isEmptyStr(sCurrMemoProps.title)) { - sCurrMemoProps.title = '详细'; + sCurrMemoProps.title = sDetailTitle; sCurrMemoProps.name = name; } const sMemoProps = { diff --git a/src/components/Draggable/index.js b/src/components/Draggable/index.js index e978e3c..289a512 100644 --- a/src/components/Draggable/index.js +++ b/src/components/Draggable/index.js @@ -37,6 +37,8 @@ export const DraggableConfirmModal = ({ }); const draggleRef = useRef(null); + // const FriendlyReminder = commonFunc.showLocalMessage(this.props, 'FriendlyReminder', '温馨提示'); + const showModal = () => { setOpen(true); }; diff --git a/src/mes/common/commonModalComponent/index.js b/src/mes/common/commonModalComponent/index.js index 1948ef6..278a10d 100644 --- a/src/mes/common/commonModalComponent/index.js +++ b/src/mes/common/commonModalComponent/index.js @@ -1,5 +1,6 @@ import React, { useEffect, useState } from "react"; import { Button, Modal, Space } from "antd"; +import * as commonFunc from '@/components/Common//commonFunc'; import RouterComponent from "@/routes/mes/routerComponent"; // 通用方法 @@ -57,7 +58,7 @@ const CommonModalComponent = props => { window.deviceTargetInfoModalAutoShow = false; }; }, []); - + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); return ( { props.onCancel && props.onCancel(); }} > - 取消 + {BtnCancel} } diff --git a/src/mes/common/commonModelComponent/index.js b/src/mes/common/commonModelComponent/index.js index 85e1a05..b2de772 100644 --- a/src/mes/common/commonModelComponent/index.js +++ b/src/mes/common/commonModelComponent/index.js @@ -1288,7 +1288,7 @@ const CommonModelComponent = props => { width = "100%", height = "100%" } = item; - console.log('ssconfigLists', configList, sEntireTabName ); + console.log('ssconfigLists', configList, sEntireTabName, item); const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName : sLanguage === 'sBig5EntireTabName' ? sBig5EntireTabName : sEntireTabName; console.log('sEntireTabNameNew', sEntireTabNameNew); @@ -2022,10 +2022,10 @@ const CommonRepairComponent = props => { bReturn: false }) } - + const titleNew = title === '异常信息' ? 'Abnormal Info' : title; return ( { props.itemClickRef.current = null; props.onSaveState({ taskConfirmModalVisible: false }); }; - + const prompt = commonFunc.showLocalMessage(props, 'prompt', '提示'); return ( { }, [valueNew] ); - + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认'); + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); return ( { footer={ } diff --git a/src/mes/indexMes/index.js b/src/mes/indexMes/index.js index 66c0870..b292818 100644 --- a/src/mes/indexMes/index.js +++ b/src/mes/indexMes/index.js @@ -453,7 +453,7 @@ const IndexMes = baseProps => { } }; const bExsitLogin = commonFunc.showLocalMessage(props, 'bExsitLogin', '是否退出登录'); - + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); return ( { {logoutShow && ( { handleColseOee(); setLogoutShow(false); @@ -772,7 +774,7 @@ const SiderComponent = () => { const { currentContent, menuMap } = hooksProps; const teamInformation= commonFunc.showLocalMessage(props, 'teamInformation', '班组信息'); - console.log('2222', teamInformation); + const scheduledTask= commonFunc.showLocalMessage(props, 'scheduledTask', '计划任务'); @@ -929,7 +931,7 @@ const SystemFunComponent = () => { const handleProcedureCall = async (params, iFlag) => { const { onSuccess } = params; const { app } = props; - const FriendlyReminder = commonFunc.showLocalMessage(this.props, 'FriendlyReminder', '温馨提示'); + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); const { sMachineNameSId, sTeamNameSId, sShift, token, sModelsId } = app; const value = { diff --git a/src/mes/productionExec/quickSwitchTabComponent/index.js b/src/mes/productionExec/quickSwitchTabComponent/index.js index b3020ad..8f79b6c 100644 --- a/src/mes/productionExec/quickSwitchTabComponent/index.js +++ b/src/mes/productionExec/quickSwitchTabComponent/index.js @@ -1,6 +1,7 @@ import React, { useEffect, useRef } from "react"; import * as commonUtils from "@/utils/utils"; import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; +import * as commonFunc from '@/components/Common/commonFunc'; import styles from "./index.less"; import { message } from "antd"; @@ -102,7 +103,7 @@ const QuickSwitchTabComponent = baseProps => { } const sLanguage = props.app.userinfo.sLanguage || 'sChinese'; list = translateList(sLanguage); - + const no = commonFunc.showLocalMessage(props, 'No', '暂无'); return (
{list.map((title, index) => { @@ -124,7 +125,7 @@ const QuickSwitchTabComponent = baseProps => { } else { props.onGetFileUrl(title, url => { if (!url) { - message.info(`暂无${title}`); + message.info(`${no}${title}`); return; } props.onOpenCommonModal({ diff --git a/src/mes/scheduledTasks/machineTasks/index.js b/src/mes/scheduledTasks/machineTasks/index.js index 727281d..2b2512a 100644 --- a/src/mes/scheduledTasks/machineTasks/index.js +++ b/src/mes/scheduledTasks/machineTasks/index.js @@ -863,10 +863,13 @@ setPauseValue(args[2].sPausereason); } }; - + const prompt = commonFunc.showLocalMessage(props, 'prompt', '提示'); + const pause = commonFunc.showLocalMessage(props, 'pause', '提示'); + const finishConstruction = commonFunc.showLocalMessage(props, 'finishConstruction', '完工'); + const choosePauseReason = commonFunc.showLocalMessage(props, 'choosePauseReason', '请先选择暂停原因'); return ( 提示!} + title={{prompt}} open={taskConfirmModalVisible} width={500} height={320} @@ -881,13 +884,13 @@ className={styles.btnZt} onClick={() => { if (!pauseValue.trim()) { - message.warning("请先选择暂停原因!"); + message.warning(choosePauseReason); return; } props.pauseCallback(pauseValue.trim()); }} > - 暂停 + {pause} ) : ( @@ -905,7 +908,7 @@ // handleClose(); }} > - 完工 + {finishConstruction} )} -- libgit2 0.22.2