Commit 9e90294786f533c5ab341da9e39fb1c342b166b2
1 parent
a7340844
1.翻译mes按钮
Showing
5 changed files
with
57 additions
and
15 deletions
src/components/Common/CommonComponent/index.js
| @@ -754,6 +754,7 @@ export default class CommonComponent extends Component { | @@ -754,6 +754,7 @@ export default class CommonComponent extends Component { | ||
| 754 | const { userinfo } = app; | 754 | const { userinfo } = app; |
| 755 | let { sTableTitleSql } = showConfig; | 755 | let { sTableTitleSql } = showConfig; |
| 756 | /* 根据用户配置语言 设置表格标题 */ | 756 | /* 根据用户配置语言 设置表格标题 */ |
| 757 | + console.log('2122', showConfig); | ||
| 757 | if (commonUtils.isJSON(sTableTitleSql) && sTableTitleSql.includes('Chinese')) { | 758 | if (commonUtils.isJSON(sTableTitleSql) && sTableTitleSql.includes('Chinese')) { |
| 758 | sTableTitleSql = this.getLocalizedString(sTableTitleSql, userinfo.sLanguage); | 759 | sTableTitleSql = this.getLocalizedString(sTableTitleSql, userinfo.sLanguage); |
| 759 | } | 760 | } |
src/mes/common/commonOperationBarComponent/index.js
| @@ -10,7 +10,7 @@ import costomPageFun from "@/mes/costomPageFun"; | @@ -10,7 +10,7 @@ import costomPageFun from "@/mes/costomPageFun"; | ||
| 10 | import * as commonConfig from "@/utils/config"; | 10 | import * as commonConfig from "@/utils/config"; |
| 11 | 11 | ||
| 12 | import styles from "./index.less"; | 12 | import styles from "./index.less"; |
| 13 | -import { Button, Space, Input, Modal, Dropdown } from "antd"; | 13 | +import {Button, Space, Input, Modal, Dropdown, Tooltip} from "antd"; |
| 14 | import { ScanOutlined } from "@ant-design/icons"; | 14 | import { ScanOutlined } from "@ant-design/icons"; |
| 15 | 15 | ||
| 16 | const useCommonOperationBarComponentEvent = props => { | 16 | const useCommonOperationBarComponentEvent = props => { |
| @@ -1021,8 +1021,17 @@ const CommonOperationBarComponent = basProps => { | @@ -1021,8 +1021,17 @@ const CommonOperationBarComponent = basProps => { | ||
| 1021 | <div className="leftBar"> | 1021 | <div className="leftBar"> |
| 1022 | <Space> | 1022 | <Space> |
| 1023 | {btnLeftConfig.map(item => { | 1023 | {btnLeftConfig.map(item => { |
| 1024 | + console.log('ssss', item); | ||
| 1025 | + let sTooltip = item.showName +'-'+ item.sChinese || item.showName ; | ||
| 1026 | + if(item.showName === 'Proofreading/revision Complete'){ | ||
| 1027 | + sTooltip = item.showName + '-装校版结束'; | ||
| 1028 | + } else if(item.showName === 'All'){ | ||
| 1029 | + sTooltip = item.showName + '-全部'; | ||
| 1030 | + } | ||
| 1031 | + | ||
| 1024 | if (item.showName === "扫码上料") { | 1032 | if (item.showName === "扫码上料") { |
| 1025 | return ( | 1033 | return ( |
| 1034 | + <Tooltip title='扫码上料'> | ||
| 1026 | <Button | 1035 | <Button |
| 1027 | {...props.onGetBtnPropps(item, searchField)} | 1036 | {...props.onGetBtnPropps(item, searchField)} |
| 1028 | type="link" | 1037 | type="link" |
| @@ -1034,6 +1043,7 @@ const CommonOperationBarComponent = basProps => { | @@ -1034,6 +1043,7 @@ const CommonOperationBarComponent = basProps => { | ||
| 1034 | /> | 1043 | /> |
| 1035 | } | 1044 | } |
| 1036 | /> | 1045 | /> |
| 1046 | + </Tooltip> | ||
| 1037 | ); | 1047 | ); |
| 1038 | } else if (item.showName === "重新发版" && item.iTag === 100) { | 1048 | } else if (item.showName === "重新发版" && item.iTag === 100) { |
| 1039 | return ( | 1049 | return ( |
| @@ -1060,9 +1070,11 @@ const CommonOperationBarComponent = basProps => { | @@ -1060,9 +1070,11 @@ const CommonOperationBarComponent = basProps => { | ||
| 1060 | ); | 1070 | ); |
| 1061 | } | 1071 | } |
| 1062 | return ( | 1072 | return ( |
| 1063 | - <Button {...props.onGetBtnPropps(item, searchField)}> | 1073 | + <Tooltip title={sTooltip}> |
| 1074 | + <Button {...props.onGetBtnPropps(item, searchField)}> | ||
| 1064 | {item.showName} | 1075 | {item.showName} |
| 1065 | - </Button> | 1076 | + </Button> |
| 1077 | + </Tooltip> | ||
| 1066 | ); | 1078 | ); |
| 1067 | })} | 1079 | })} |
| 1068 | <BarcodeComponent {...props} /> | 1080 | <BarcodeComponent {...props} /> |
| @@ -1076,19 +1088,29 @@ const CommonOperationBarComponent = basProps => { | @@ -1076,19 +1088,29 @@ const CommonOperationBarComponent = basProps => { | ||
| 1076 | "" | 1088 | "" |
| 1077 | )} | 1089 | )} |
| 1078 | {btnRightConfig.map(item => { | 1090 | {btnRightConfig.map(item => { |
| 1091 | + let sTooltip = item.showName +'-'+ item.sChinese || item.showName ; | ||
| 1092 | + if(item.showName === 'Proofreading/revision Complete'){ | ||
| 1093 | + sTooltip = item.showName + '-装校版结束'; | ||
| 1094 | + } else if(item.showName === 'All'){ | ||
| 1095 | + sTooltip = item.showName + '-全部'; | ||
| 1096 | + } | ||
| 1079 | return ( | 1097 | return ( |
| 1080 | - <Button {...props.onGetBtnPropps(item, searchField)}> | ||
| 1081 | - {item.showName} | ||
| 1082 | - </Button> | 1098 | + <Tooltip title={sTooltip}> |
| 1099 | + <Button {...props.onGetBtnPropps(item, searchField)}> | ||
| 1100 | + {item.showName} | ||
| 1101 | + </Button> | ||
| 1102 | + </Tooltip> | ||
| 1083 | ); | 1103 | ); |
| 1084 | })} | 1104 | })} |
| 1085 | {!belongsToForm && | 1105 | {!belongsToForm && |
| 1086 | commonUtils.isNotEmptyObject(searchField) && ( | 1106 | commonUtils.isNotEmptyObject(searchField) && ( |
| 1087 | <> | 1107 | <> |
| 1088 | <ShowType {...showTypeProps} /> | 1108 | <ShowType {...showTypeProps} /> |
| 1089 | - <Button type="primary" size="large" onClick={handleBtnSearch}> | 1109 | + <Tooltip title='搜索'> |
| 1110 | + <Button type="primary" size="large" onClick={handleBtnSearch} > | ||
| 1090 | {btnSearch} | 1111 | {btnSearch} |
| 1091 | - </Button> | 1112 | + </Button> |
| 1113 | + </Tooltip> | ||
| 1092 | </> | 1114 | </> |
| 1093 | )} | 1115 | )} |
| 1094 | </Space> | 1116 | </Space> |
src/mes/productionExec/noticeModal/index.js
| @@ -269,7 +269,7 @@ const firstNoticeModal = _props => { | @@ -269,7 +269,7 @@ const firstNoticeModal = _props => { | ||
| 269 | const firstNotice = commonFunc.showLocalMessage(props, 'firstNotice', '首签样通知'); | 269 | const firstNotice = commonFunc.showLocalMessage(props, 'firstNotice', '首签样通知'); |
| 270 | const firstNoticeList = commonFunc.showLocalMessage(props, 'firstNoticeList', '版材消耗登记'); | 270 | const firstNoticeList = commonFunc.showLocalMessage(props, 'firstNoticeList', '版材消耗登记'); |
| 271 | const employeeNameIdTitle = commonFunc.showLocalMessage(props, 'employeeName', '员工名称/工号'); | 271 | const employeeNameIdTitle = commonFunc.showLocalMessage(props, 'employeeName', '员工名称/工号'); |
| 272 | - const btnAll = commonFunc.showLocalMessage(props, 'btnAll', '全部'); | 272 | + const btnAll = 22222; |
| 273 | const btnSearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询'); | 273 | const btnSearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询'); |
| 274 | const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); | 274 | const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); |
| 275 | const selectRecipient = commonFunc.showLocalMessage(props, 'selectRecipient', '请先选择接收人!'); | 275 | const selectRecipient = commonFunc.showLocalMessage(props, 'selectRecipient', '请先选择接收人!'); |
src/mes/productionExec/productionExecMain/index.js
| 1 | import React, { useEffect, useState, useRef, useMemo } from "react"; | 1 | import React, { useEffect, useState, useRef, useMemo } from "react"; |
| 2 | -import { Button, Spin, Row, Col } from "antd"; | 2 | +import { Button, Spin, Row, Col, Tooltip } from "antd"; |
| 3 | import { operationFetch } from "./operationFetch"; | 3 | import { operationFetch } from "./operationFetch"; |
| 4 | 4 | ||
| 5 | import * as commonUtils from "@/utils/utils"; | 5 | import * as commonUtils from "@/utils/utils"; |
| @@ -685,13 +685,19 @@ const ProductionExecContent = props => { | @@ -685,13 +685,19 @@ const ProductionExecContent = props => { | ||
| 685 | config.gdsconfigformslave.find( | 685 | config.gdsconfigformslave.find( |
| 686 | item => item.sControlName === sControlName | 686 | item => item.sControlName === sControlName |
| 687 | ) || {}; | 687 | ) || {}; |
| 688 | + | ||
| 689 | + // 从配置中解构出 tooltip(如果有) | ||
| 690 | + const { tooltip, ...restConfig } = btnConfig; | ||
| 691 | + console.log('btnConfig', btnConfig); | ||
| 692 | + | ||
| 688 | return { | 693 | return { |
| 689 | - ...btnConfig, | 694 | + ...restConfig, |
| 690 | disabled: props.onGetBtnStatus(tableName, btnConfig), | 695 | disabled: props.onGetBtnStatus(tableName, btnConfig), |
| 691 | onClick: async () => { | 696 | onClick: async () => { |
| 692 | if (!props.onGetBtnContinue()) return; | 697 | if (!props.onGetBtnContinue()) return; |
| 693 | await props.awaitPromiseReturn(); | 698 | await props.awaitPromiseReturn(); |
| 694 | const { sButtonParam, sInstruct } = btnConfig; | 699 | const { sButtonParam, sInstruct } = btnConfig; |
| 700 | + | ||
| 695 | // 调用指令集 | 701 | // 调用指令集 |
| 696 | if (sInstruct) { | 702 | if (sInstruct) { |
| 697 | props.onExecInstructSet({ | 703 | props.onExecInstructSet({ |
| @@ -705,6 +711,7 @@ const ProductionExecContent = props => { | @@ -705,6 +711,7 @@ const ProductionExecContent = props => { | ||
| 705 | }); | 711 | }); |
| 706 | return; | 712 | return; |
| 707 | } | 713 | } |
| 714 | + | ||
| 708 | // 调用存储过程 | 715 | // 调用存储过程 |
| 709 | if (sButtonParam) { | 716 | if (sButtonParam) { |
| 710 | props.onProcedureCall({ | 717 | props.onProcedureCall({ |
| @@ -717,7 +724,11 @@ const ProductionExecContent = props => { | @@ -717,7 +724,11 @@ const ProductionExecContent = props => { | ||
| 717 | }); | 724 | }); |
| 718 | return; | 725 | return; |
| 719 | } | 726 | } |
| 720 | - } | 727 | + }, |
| 728 | + // 如果有 tooltip,返回一个带 Tooltip 的按钮渲染函数 | ||
| 729 | + ...(tooltip ? { | ||
| 730 | + children: (button) => <Tooltip title={tooltip}>{button}</Tooltip> | ||
| 731 | + } : {}) | ||
| 721 | }; | 732 | }; |
| 722 | }; | 733 | }; |
| 723 | 734 | ||
| @@ -864,6 +875,7 @@ const ProductionExecContent = props => { | @@ -864,6 +875,7 @@ const ProductionExecContent = props => { | ||
| 864 | </div> | 875 | </div> |
| 865 | <div className="btnPart"> | 876 | <div className="btnPart"> |
| 866 | <Space> | 877 | <Space> |
| 878 | + <Tooltip title='物料消耗登记'> | ||
| 867 | <Button | 879 | <Button |
| 868 | type="primary" | 880 | type="primary" |
| 869 | size="large" | 881 | size="large" |
| @@ -871,13 +883,16 @@ const ProductionExecContent = props => { | @@ -871,13 +883,16 @@ const ProductionExecContent = props => { | ||
| 871 | > | 883 | > |
| 872 | {MCR} | 884 | {MCR} |
| 873 | </Button> | 885 | </Button> |
| 874 | - <Button | 886 | + </Tooltip> |
| 887 | + <Tooltip title='版材消耗登记'> | ||
| 888 | + <Button | ||
| 875 | type="primary" | 889 | type="primary" |
| 876 | size="large" | 890 | size="large" |
| 877 | onClick={changeTab.bind(this, 2)} | 891 | onClick={changeTab.bind(this, 2)} |
| 878 | > | 892 | > |
| 879 | {PMCR} | 893 | {PMCR} |
| 880 | </Button> | 894 | </Button> |
| 895 | + </Tooltip> | ||
| 881 | </Space> | 896 | </Space> |
| 882 | </div> | 897 | </div> |
| 883 | </div> | 898 | </div> |
| @@ -1135,13 +1150,16 @@ const ProductionExecContent0 = props => { | @@ -1135,13 +1150,16 @@ const ProductionExecContent0 = props => { | ||
| 1135 | </div> | 1150 | </div> |
| 1136 | <div className="btnPart"> | 1151 | <div className="btnPart"> |
| 1137 | <Space> | 1152 | <Space> |
| 1138 | - <Button | 1153 | + <Tooltip title='Material Consumption Registration-物料消耗登记'> |
| 1154 | + <Button | ||
| 1139 | type="primary" | 1155 | type="primary" |
| 1140 | size="large" | 1156 | size="large" |
| 1141 | onClick={changeTab.bind(this, 0)} | 1157 | onClick={changeTab.bind(this, 0)} |
| 1142 | > | 1158 | > |
| 1143 | {MCR} | 1159 | {MCR} |
| 1144 | </Button> | 1160 | </Button> |
| 1161 | + </Tooltip> | ||
| 1162 | + <Tooltip title='Plate Material Consumption Registration-版材消耗登记'> | ||
| 1145 | <Button | 1163 | <Button |
| 1146 | type="primary" | 1164 | type="primary" |
| 1147 | size="large" | 1165 | size="large" |
| @@ -1149,6 +1167,7 @@ const ProductionExecContent0 = props => { | @@ -1149,6 +1167,7 @@ const ProductionExecContent0 = props => { | ||
| 1149 | > | 1167 | > |
| 1150 | {PMCR} | 1168 | {PMCR} |
| 1151 | </Button> | 1169 | </Button> |
| 1170 | + </Tooltip> | ||
| 1152 | </Space> | 1171 | </Space> |
| 1153 | </div> | 1172 | </div> |
| 1154 | </div> | 1173 | </div> |
src/mes/scheduledTasks/machineTasks/index.js
| @@ -706,7 +706,7 @@ | @@ -706,7 +706,7 @@ | ||
| 706 | }); | 706 | }); |
| 707 | const feedbackIssues = commonFunc.showLocalMessage(props, 'feedbackIssues', '前期生产或反馈问题'); | 707 | const feedbackIssues = commonFunc.showLocalMessage(props, 'feedbackIssues', '前期生产或反馈问题'); |
| 708 | const btnsearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询'); | 708 | const btnsearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询'); |
| 709 | - const btnAll = commonFunc.showLocalMessage(props, 'btnAll', '全部'); | 709 | + const btnAll = 111111; |
| 710 | const sWorkOrderNo = commonFunc.showLocalMessage(props, 'sWorkOrderNo', '工单编号'); | 710 | const sWorkOrderNo = commonFunc.showLocalMessage(props, 'sWorkOrderNo', '工单编号'); |
| 711 | const deviceInfo = commonFunc.showLocalMessage(props, 'deviceInfo', '设备信息'); | 711 | const deviceInfo = commonFunc.showLocalMessage(props, 'deviceInfo', '设备信息'); |
| 712 | const TasksQty = commonFunc.showLocalMessage(props, 'TasksQty', '今日完成任务批次/产量(个)'); | 712 | const TasksQty = commonFunc.showLocalMessage(props, 'TasksQty', '今日完成任务批次/产量(个)'); |