Commit ca2c115497c7bb45566a47667d254465a16614d0

Authored by Min
1 parent e5fd2b6f

1.完善MES按钮类,弹窗类英文翻译

src/components/Common/CommonBillEvent.js
... ... @@ -5038,6 +5038,7 @@ export default (ChildComponent) => {
5038 5038 this.handleGetData(masterConfig, slaveConfig, checkConfig);
5039 5039 } else if(name && name.includes('BtnTempSql')) { /* 通过BtnTempSql按钮 自定义调用Sql 并将数据回填到界面上 */
5040 5040 const { masterConfig, slaveConfig, sModelsId, token } = this.props;
  5041 + const sOperaSuccess = commonFunc.showLocalMessage(props, 'sOperaSuccess', '操作成功');
5041 5042 let { masterData,slaveData } = this.props;
5042 5043 const slave0Data = [];
5043 5044 const slave1Data = [];
... ... @@ -5211,7 +5212,7 @@ export default (ChildComponent) => {
5211 5212 const dataReturn = (await commonServices.postValueService(this.props.app.token, value, url)).data;
5212 5213 if (dataReturn.code === 1) {
5213 5214 /* 数据操作 数据回传页面 */
5214   - message.success('操作成功!');
  5215 + message.success(sOperaSuccess);
5215 5216 const returnData = dataReturn.dataset.rows[0];
5216 5217 if (commonUtils.isNotEmptyArr(slaveNameList) && commonUtils.isNotEmptyObject(returnData)) {
5217 5218 slaveNameList.forEach((name, index) => {
... ...
src/components/Common/CommonComponent/index.js
... ... @@ -2,6 +2,7 @@ import moment from 'moment';
2 2 import React, { Component, createRef } from 'react';
3 3 import reactComponentDebounce from '@/components/Common/ReactDebounce';
4 4 import '@ant-design/compatible/assets/index.css';
  5 +import * as commonFunc from '@/components/Common/commonFunc';
5 6 import {
6 7 InputNumber,
7 8 Checkbox,
... ... @@ -558,6 +559,7 @@ export default class CommonComponent extends Component {
558 559 }
559 560 /** 获取selectprops对象 */
560 561 getSelectProps = () => {
  562 + const noData = commonFunc.showLocalMessage(this.props, 'noData', '暂无数据');
561 563 /* 返回值声明 */
562 564 const obj = {
563 565 showSearch: true, /* 是否有查找功能 */
... ... @@ -567,7 +569,7 @@ export default class CommonComponent extends Component {
567 569 onDropdownVisibleChange: this.onDropdownVisibleChange,
568 570 onPopupScroll: this.handlePopupScroll,
569 571 onSearch: this.handleSearch,
570   - notFoundContent: this.state.spinState ? <Spin /> : '暂无数据',
  572 + notFoundContent: this.state.spinState ? <Spin /> : noData,
571 573 // getPopupContainer: this.props.name === 'slave' || this.props.name === 'searchColumnShow' ? this.getPopupContainer : null,/*解决下拉框不随浏览器滚动问题 */
572 574 onFocus: this.onFocus,
573 575 onBlur: this.onBlur,
... ... @@ -825,6 +827,7 @@ export default class CommonComponent extends Component {
825 827 /** 获取complete对象 */
826 828 getCompleteProps = () => {
827 829 /* 返回值声明 */
  830 + const noData = commonFunc.showLocalMessage(this.props, 'noData', '暂无数据');
828 831 const obj = {
829 832 // disabled: !this.state.enabled /* 修改的时候传过来的数据 */
830 833 onChange: this.handleCompleteInputEvent, /* 选择触发事件 */
... ... @@ -857,7 +860,7 @@ export default class CommonComponent extends Component {
857 860 /* 区分Oee设置字体与其他系统设置字体 */
858 861 dropdownClassName: commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf('oee') > -1 ? (location.pathname.toLowerCase().indexOf('loginoee') > -1 ? 'loginOeeDropDown' : 'oeeDropDown') : '',
859 862 onSearch: this.handleSearch,
860   - notFoundContent: this.state.spinState ? <Spin /> : '暂无数据',
  863 + notFoundContent: this.state.spinState ? <Spin /> : noData,
861 864 onFocus: this.onFocus,
862 865 onBlur: this.onBlur,
863 866 };
... ... @@ -1406,7 +1409,7 @@ export default class CommonComponent extends Component {
1406 1409 obj.title = obj.value;
1407 1410 }
1408 1411 obj.placeholder = this.props.showConfig.placeholder;
1409   -
  1412 +
1410 1413 if (this.props.name === "tableS0" && this.props.showConfig.sName === "sStatus") {
1411 1414 if (this.state.dataValue === "已提交") {
1412 1415 obj.className = "sStatusSubmit";
... ... @@ -2716,7 +2719,7 @@ export default class CommonComponent extends Component {
2716 2719  
2717 2720 // 登记取样特殊处理
2718 2721 if(slaveConfig.sId=='12710101117346647176280'){
2719   -
  2722 +
2720 2723 if(innerInputProps.id.includes('bReturn')){
2721 2724 window.$xlyStorage = this.props.dataValue;
2722 2725 }
... ... @@ -2725,7 +2728,7 @@ export default class CommonComponent extends Component {
2725 2728  
2726 2729 this.myRef.current.querySelector('input').addEventListener('keydown',(event)=>{
2727 2730 if (event.code === 'NumpadEnter' || event.code === 'Enter') { // 或者使用 event.keyCode === 13
2728   -
  2731 +
2729 2732 event.preventDefault(); // 阻止默认行为
2730 2733 // console.log(this.value)
2731 2734 // const inputValue = this.value;
... ... @@ -2767,7 +2770,7 @@ export default class CommonComponent extends Component {
2767 2770 })
2768 2771  
2769 2772  
2770   -
  2773 +
2771 2774 // debugger
2772 2775 // innerInputProps.onPressEnter = (event2)=>{
2773 2776 // setTimeout(()=>{
... ... @@ -3065,7 +3068,7 @@ export default class CommonComponent extends Component {
3065 3068 const fieldDecoratorProps = this.getFieldDecoratorProps();
3066 3069 /* 通用组件(主表存在getFieldDecorator表单验证,而从表则不需要) */
3067 3070  
3068   -
  3071 +
3069 3072 // 班组报工,产量上报信息,label文字颜色特殊处理
3070 3073 if(slaveConfig.sId=='17087428780006438414984564455000'){
3071 3074 // 计件
... ...
src/components/Common/CommonListSelect/index.js
... ... @@ -276,11 +276,12 @@ const CommonListComponent = Form.create({
276 276 const bPadPop =
277 277 props.sModelsId === "12710101117211852461310" ||
278 278 props.sModelsId === "12710101117218031681520";
279   -
  279 +
280 280 if (bPadPop) {
281 281 tableProps.fixedHeight = "325px";
282 282 }
283   -
  283 + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认');
  284 + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');
284 285 return (
285 286 <Form >
286 287 <Layout>
... ... @@ -326,8 +327,8 @@ const CommonListComponent = Form.create({
326 327 }
327 328 </div>
328 329 <div style={{ textAlign: 'right', marginRight: '9px', marginBottom: '9px' }}>
329   - <Button key="back" style={{ marginRight: '8px' }} size='large' onClick={props.onCancel}>取消</Button>
330   - <Button type="primary" size='large' onClick={props.onSelect}>确认</Button>
  330 + <Button key="back" style={{ marginRight: '8px' }} size='large' onClick={props.onCancel}>{BtnCancel}</Button>
  331 + <Button type="primary" size='large' onClick={props.onSelect}>{BtnSure}</Button>
331 332 </div>
332 333 </div> : ''
333 334 }
... ...
src/components/Common/CommonListSelectTree/index.js
... ... @@ -450,6 +450,8 @@ const CommonListComponent = Form.create({
450 450 }
451 451 }
452 452 };
  453 + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');
  454 + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认');
453 455 return (
454 456 <div className="modalChooseProcessContent">
455 457 <Form >
... ... @@ -505,8 +507,8 @@ const CommonListComponent = Form.create({
505 507 width: '50%', textAlign: 'right', marginRight: '9px', marginBottom: '9px',
506 508 }}
507 509 >
508   - <Button key="back" style={{ marginRight: '8px' }} onClick={props.onCancel}>取消</Button>
509   - <Button type="primary" onClick={props.onSelect}>确认</Button>
  510 + <Button key="back" style={{ marginRight: '8px' }} onClick={props.onCancel}>{BtnCancel}</Button>
  511 + <Button type="primary" onClick={props.onSelect}>{BtnSure}</Button>
510 512 </div>
511 513 </div>
512 514 </Layout>
... ...
src/components/Common/CommonListTreeSelect/index.js
... ... @@ -564,7 +564,8 @@ const CommonListComponent = Form.create({
564 564 }
565 565 }
566 566 };
567   -
  567 + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认');
  568 + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');
568 569 return (
569 570 <Form >
570 571 <Layout>
... ... @@ -609,8 +610,8 @@ const CommonListComponent = Form.create({
609 610 }
610 611 </div>
611 612 <div style={{ textAlign: 'right', marginRight: '9px', marginBottom: '9px' }}>
612   - <Button key="back" style={{ marginRight: '8px' }} onClick={props.onCancel}>取消</Button>
613   - <Button type="primary" onClick={props.onSelect}>确认</Button>
  613 + <Button key="back" style={{ marginRight: '8px' }} onClick={props.onCancel}>{BtnCancel}</Button>
  614 + <Button type="primary" onClick={props.onSelect}>{BtnSure}</Button>
614 615 </div>
615 616 </div> : ''
616 617 }
... ...
src/components/Common/CommonTable/index.js
... ... @@ -12004,10 +12004,11 @@ const useCommonTableEvent = props =&gt; {
12004 12004 if (props.onGetTotalDiv) {
12005 12005 addState.getTotalDiv = props.onGetTotalDiv;
12006 12006 }
12007   -
  12007 + const sDetailTitle = commonFunc.showLocalMessage(props, 'sDetailTitle', '详细');
  12008 + const BtnClose = commonFunc.showLocalMessage(props, 'BtnClose', '关闭');
12008 12009 const handleShowSimpleModal = htmlString => {
12009 12010 Modal.info({
12010   - title: <span style={{ color: "#1890FF" }}>详细</span>,
  12011 + title: <span style={{ color: "#1890FF" }}>{sDetailTitle}</span>,
12011 12012 width: "70%",
12012 12013 content: (
12013 12014 <div
... ... @@ -12022,7 +12023,7 @@ const useCommonTableEvent = props =&gt; {
12022 12023 dangerouslySetInnerHTML={{ __html: htmlString }}
12023 12024 />
12024 12025 ),
12025   - okText: "关闭"
  12026 + okText: BtnClose
12026 12027 });
12027 12028 };
12028 12029  
... ...
src/components/Common/CommonViewDragable/index.js
... ... @@ -135,6 +135,7 @@ const ParamTableComponent = childProps =&gt; {
135 135 const RGLComponent = childProps => {
136 136 const { props, hooksProps } = useContext(myContext);
137 137 const { tableName } = props;
  138 +
138 139 const { selectedData } = hooksProps;
139 140 const { sParamType } = childProps;
140 141 const xlyRGLRef = useRef(null);
... ... @@ -216,12 +217,13 @@ const RGLComponent = childProps =&gt; {
216 217 </ReactGridLayout>
217 218 </div>
218 219 ) : (
219   - <EmptyComponent />
  220 + <EmptyComponent props ={props} />
220 221 );
221 222 };
222 223  
223 224 const EmptyComponent = () => {
224   - return <div className="emptyComponent">暂无数据</div>;
  225 + const noData = commonFunc.showLocalMessage(this.props, 'noData', '暂无数据');
  226 + return <div className="emptyComponent">{noData}</div>;
225 227 };
226 228  
227 229 // 获取选中数据
... ...
src/components/Common/SearchComponent/index.js
... ... @@ -1179,6 +1179,8 @@ export default class SearchComponent extends Component {
1179 1179 const btnSaveAndSearch = commonFunc.showMessage(app.commonConst, 'btnSaveAndSearch') || "保存并查询";/* 保存并查询 */
1180 1180 const solutionFilterSave = commonFunc.showMessage(app.commonConst, 'solutionFilterSave');
1181 1181 const solutionFilterNameUpd = commonFunc.showMessage(app.commonConst, 'solutionFilterNameUpd');
  1182 + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认');
  1183 + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');
1182 1184  
1183 1185 const modalCom = (
1184 1186 <AntdDraggableModal
... ... @@ -1188,8 +1190,8 @@ export default class SearchComponent extends Component {
1188 1190 this.handleOk(e);
1189 1191 }, 300)}
1190 1192 onCancel={this.handleCancel.bind(this, 'modalVisible')}
1191   - okText="确认"
1192   - cancelText="取消"
  1193 + okText={BtnSure}
  1194 + cancelText={BtnCancel}
1193 1195 confirmLoading={confirmLoading}
1194 1196 maskClosable={false}
1195 1197 >
... ...
src/components/Common/SlaveMemo.js
... ... @@ -218,7 +218,8 @@ class SlaveMemoRc extends Component {
218 218 let bVisibleMemo;
219 219 let sMemoField;
220 220 let btnName = "";
221   - const title = "详细";
  221 + const sDetailTitle = commonFunc.showLocalMessage(props, 'sDetailTitle', '详细');
  222 + const title = sDetailTitle;
222 223 let bEnabledTextArea = false; /* 多行文本默认可输入 非编辑状态多行文本禁止输入 */
223 224 if (commonUtils.isNotEmptyObject(sCurrMemoProps)) {
224 225 bVisibleMemo = sCurrMemoProps.bVisibleMemo;
... ...
src/components/Common/commonBusiness.js
... ... @@ -1267,8 +1267,9 @@ export async function clearSocketData(param) {
1267 1267 * */
1268 1268 export function createMemoProps(name, props) {
1269 1269 const { sCurrMemoProps } = props;
  1270 + const sDetailTitle = commonFunc.showLocalMessage(props, 'sDetailTitle', '详细');
1270 1271 if (commonUtils.isNotEmptyObject(sCurrMemoProps) && commonUtils.isEmptyStr(sCurrMemoProps.title)) {
1271   - sCurrMemoProps.title = '详细';
  1272 + sCurrMemoProps.title = sDetailTitle;
1272 1273 sCurrMemoProps.name = name;
1273 1274 }
1274 1275 const sMemoProps = {
... ...
src/components/Draggable/index.js
... ... @@ -37,6 +37,8 @@ export const DraggableConfirmModal = ({
37 37 });
38 38 const draggleRef = useRef(null);
39 39  
  40 + // const FriendlyReminder = commonFunc.showLocalMessage(this.props, 'FriendlyReminder', '温馨提示');
  41 +
40 42 const showModal = () => {
41 43 setOpen(true);
42 44 };
... ...
src/mes/common/commonModalComponent/index.js
1 1 import React, { useEffect, useState } from "react";
2 2 import { Button, Modal, Space } from "antd";
  3 +import * as commonFunc from '@/components/Common//commonFunc';
3 4 import RouterComponent from "@/routes/mes/routerComponent";
4 5  
5 6 // 通用方法
... ... @@ -57,7 +58,7 @@ const CommonModalComponent = props =&gt; {
57 58 window.deviceTargetInfoModalAutoShow = false;
58 59 };
59 60 }, []);
60   -
  61 + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');
61 62 return (
62 63 <Modal
63 64 title={titleNew}
... ... @@ -79,7 +80,7 @@ const CommonModalComponent = props =&gt; {
79 80 props.onCancel && props.onCancel();
80 81 }}
81 82 >
82   - 取消
  83 + {BtnCancel}
83 84 </Button>
84 85 </Space>
85 86 }
... ...
src/mes/common/commonModelComponent/index.js
... ... @@ -1288,7 +1288,7 @@ const CommonModelComponent = props =&gt; {
1288 1288 width = "100%",
1289 1289 height = "100%"
1290 1290 } = item;
1291   - console.log('ssconfigLists', configList, sEntireTabName );
  1291 + console.log('ssconfigLists', configList, sEntireTabName, item);
1292 1292 const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName :
1293 1293 sLanguage === 'sBig5EntireTabName' ? sBig5EntireTabName : sEntireTabName;
1294 1294 console.log('sEntireTabNameNew', sEntireTabNameNew);
... ... @@ -2022,10 +2022,10 @@ const CommonRepairComponent = props =&gt; {
2022 2022 bReturn: false
2023 2023 })
2024 2024 }
2025   -
  2025 + const titleNew = title === '异常信息' ? 'Abnormal Info' : title;
2026 2026 return (
2027 2027 <Modal
2028   - title={title}
  2028 + title={titleNew}
2029 2029 open={visible}
2030 2030 width={width}
2031 2031 height={height}
... ... @@ -2606,10 +2606,10 @@ const TaskConfirmModal = props =&gt; {
2606 2606 props.itemClickRef.current = null;
2607 2607 props.onSaveState({ taskConfirmModalVisible: false });
2608 2608 };
2609   -
  2609 + const prompt = commonFunc.showLocalMessage(props, 'prompt', '提示');
2610 2610 return (
2611 2611 <Modal
2612   - title="提示!"
  2612 + title={prompt}
2613 2613 open={taskConfirmModalVisible}
2614 2614 width={500}
2615 2615 height={250}
... ...
src/mes/common/commonOperationBarComponent/index.js
... ... @@ -1469,7 +1469,8 @@ const ScanCodeToLoadMaterials = props =&gt; {
1469 1469 },
1470 1470 [valueNew]
1471 1471 );
1472   -
  1472 + const BtnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确认');
  1473 + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');
1473 1474 return (
1474 1475 <Modal
1475 1476 title="扫码上料"
... ... @@ -1480,10 +1481,10 @@ const ScanCodeToLoadMaterials = props =&gt; {
1480 1481 footer={
1481 1482 <Space>
1482 1483 <Button size="large" onClick={handleCancel}>
1483   - 取消
  1484 + {BtnCancel}
1484 1485 </Button>
1485 1486 <Button type="primary" size="large" onClick={handleOk}>
1486   - 确认
  1487 + {BtnSure}
1487 1488 </Button>
1488 1489 </Space>
1489 1490 }
... ...
src/mes/indexMes/index.js
... ... @@ -453,7 +453,7 @@ const IndexMes = baseProps =&gt; {
453 453 }
454 454 };
455 455 const bExsitLogin = commonFunc.showLocalMessage(props, 'bExsitLogin', '是否退出登录');
456   -
  456 + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示');
457 457 return (
458 458 <ConfigProvider locale={getLocale()}>
459 459 <myContext.Provider
... ... @@ -476,7 +476,9 @@ const IndexMes = baseProps =&gt; {
476 476 {logoutShow && (
477 477 <DraggableConfirmModal
478 478 btnShow={false}
  479 + title ={FriendlyReminder}
479 480 content={bExsitLogin}
  481 + props={props}
480 482 onOk={() => {
481 483 handleColseOee();
482 484 setLogoutShow(false);
... ... @@ -772,7 +774,7 @@ const SiderComponent = () =&gt; {
772 774 const { currentContent, menuMap } = hooksProps;
773 775  
774 776 const teamInformation= commonFunc.showLocalMessage(props, 'teamInformation', '班组信息');
775   - console.log('2222', teamInformation);
  777 +
776 778  
777 779 const scheduledTask= commonFunc.showLocalMessage(props, 'scheduledTask', '计划任务');
778 780  
... ... @@ -929,7 +931,7 @@ const SystemFunComponent = () =&gt; {
929 931 const handleProcedureCall = async (params, iFlag) => {
930 932 const { onSuccess } = params;
931 933 const { app } = props;
932   - const FriendlyReminder = commonFunc.showLocalMessage(this.props, 'FriendlyReminder', '温馨提示');
  934 + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示');
933 935 const { sMachineNameSId, sTeamNameSId, sShift, token, sModelsId } = app;
934 936  
935 937 const value = {
... ...
src/mes/productionExec/quickSwitchTabComponent/index.js
1 1 import React, { useEffect, useRef } from "react";
2 2 import * as commonUtils from "@/utils/utils";
3 3 import useCommonBase from "@/components/Common/CommonHooks/useCommonBase";
  4 +import * as commonFunc from '@/components/Common/commonFunc';
4 5 import styles from "./index.less";
5 6 import { message } from "antd";
6 7  
... ... @@ -102,7 +103,7 @@ const QuickSwitchTabComponent = baseProps =&gt; {
102 103 }
103 104 const sLanguage = props.app.userinfo.sLanguage || 'sChinese';
104 105 list = translateList(sLanguage);
105   -
  106 + const no = commonFunc.showLocalMessage(props, 'No', '暂无');
106 107 return (
107 108 <div className={styles.quickSwitchTabComponent} ref={ref}>
108 109 {list.map((title, index) => {
... ... @@ -124,7 +125,7 @@ const QuickSwitchTabComponent = baseProps =&gt; {
124 125 } else {
125 126 props.onGetFileUrl(title, url => {
126 127 if (!url) {
127   - message.info(`暂无${title}`);
  128 + message.info(`${no}${title}`);
128 129 return;
129 130 }
130 131 props.onOpenCommonModal({
... ...
src/mes/scheduledTasks/machineTasks/index.js
... ... @@ -863,10 +863,13 @@
863 863 setPauseValue(args[2].sPausereason);
864 864 }
865 865 };
866   -
  866 + const prompt = commonFunc.showLocalMessage(props, 'prompt', '提示');
  867 + const pause = commonFunc.showLocalMessage(props, 'pause', '提示');
  868 + const finishConstruction = commonFunc.showLocalMessage(props, 'finishConstruction', '完工');
  869 + const choosePauseReason = commonFunc.showLocalMessage(props, 'choosePauseReason', '请先选择暂停原因');
867 870 return (
868 871 <Modal
869   - title={<span style={{ fontSize: 22 }}>提示!</span>}
  872 + title={<span style={{ fontSize: 22 }}>{prompt}</span>}
870 873 open={taskConfirmModalVisible}
871 874 width={500}
872 875 height={320}
... ... @@ -881,13 +884,13 @@
881 884 className={styles.btnZt}
882 885 onClick={() => {
883 886 if (!pauseValue.trim()) {
884   - message.warning("请先选择暂停原因!");
  887 + message.warning(choosePauseReason);
885 888 return;
886 889 }
887 890 props.pauseCallback(pauseValue.trim());
888 891 }}
889 892 >
890   - 暂停
  893 + {pause}
891 894 </Button>
892 895 </Space>
893 896 ) : (
... ... @@ -905,7 +908,7 @@
905 908 // handleClose();
906 909 }}
907 910 >
908   - 完工
  911 + {finishConstruction}
909 912 </Button>
910 913 <Button
911 914 size="large"
... ... @@ -913,7 +916,7 @@
913 916 className={styles.btnZt}
914 917 onClick={() => {
915 918 if (!pauseValue.trim()) {
916   - message.warning("请先选择暂停原因!");
  919 + message.warning(choosePauseReason);
917 920 return;
918 921 }
919 922 if (props.itemClickRef.current?.data)
... ... @@ -925,7 +928,7 @@
925 928 // handleClose();
926 929 }}
927 930 >
928   - 暂停
  931 + {pause}
929 932 </Button>
930 933 </Space>
931 934 )}
... ...