Commit d1fbb993455b9ce7e820f3eb10a77bfe74e9d7ad

Authored by Min
1 parent 198ee074

1.MES增加多语言翻译

src/components/Common/CommonTable/index.js
... ... @@ -4719,7 +4719,7 @@ class CommonTableRc extends React.Component {
4719 4719 }
4720 4720 tableBtnsWidth += "px";
4721 4721 }
4722   -
  4722 + const setOperation = commonFunc.showMessage(props.app.commonConst, 'operation') || '操作';
4723 4723 const operationCol = {
4724 4724 dataIndex: "operation",
4725 4725 render: (text, record, index) => {
... ... @@ -4826,7 +4826,7 @@ class CommonTableRc extends React.Component {
4826 4826 },
4827 4827 title: () => (
4828 4828 <div>
4829   - 操作
  4829 + {setOperation}
4830 4830 <div className={styles.mesOpr}>
4831 4831 {/* 班组报工行车记录 */}
4832 4832 {["12710101117087404588200", "12710101117260270570210"].includes(
... ... @@ -5061,6 +5061,7 @@ class CommonTableRc extends React.Component {
5061 5061 const delIcon = props.tableProps.setDelete; /* 删除操作 */
5062 5062 const materialIcon = props.tableProps.setMaterial; /* 材料操作 */
5063 5063 const processIcon = props.tableProps.setProcess; /* 工序操作 */
  5064 + const setOperation = commonFunc.showMessage(props.app.commonConst, 'operation') || '操作';
5064 5065 const materailremarkIcon =
5065 5066 props.tableProps.setMaterialRemark; /* 材料备注 */
5066 5067 let uploadIcon = props.tableProps.setUpload; /* 上传 */
... ... @@ -5935,7 +5936,7 @@ class CommonTableRc extends React.Component {
5935 5936 textDecoration: "none"
5936 5937 }}
5937 5938 >
5938   - 操作{" "}
  5939 + {setOperation}{" "}
5939 5940 {uploadIcon ? (
5940 5941 <Upload {...divProps} disabled={!this.props.enabled}>
5941 5942 <a
... ... @@ -6062,7 +6063,7 @@ class CommonTableRc extends React.Component {
6062 6063 ) : (
6063 6064 <span>
6064 6065 {" "}
6065   - 操作{" "}
  6066 + {setOperation}{" "}
6066 6067 {headPopup ? (
6067 6068 <a
6068 6069 {...headProps}
... ... @@ -6942,7 +6943,7 @@ class CommonTableRc extends React.Component {
6942 6943 if ( this.props.parentProps.slaveConfig.sId == "12710101117056272345580" && tbName === "slave" ) {
6943 6944 let newTableData = tableData.filter(e => e.sBoardName) || [];
6944 6945  
6945   -
  6946 +
6946 6947 // 如果版号已存在则过滤
6947 6948 // const result = selectData.filter(item1 =>!newTableData.some(item2 => item2.sBoardName === item1.sBoardName));
6948 6949 let newSelectData = selectData.map((item, index) => {
... ... @@ -6974,7 +6975,7 @@ class CommonTableRc extends React.Component {
6974 6975  
6975 6976  
6976 6977  
6977   -
  6978 +
6978 6979  
6979 6980 selectData.forEach((item, index) => {
6980 6981 const newCopyTo = {};
... ...
src/components/Common/commonFunc.js
... ... @@ -509,7 +509,19 @@ export function showMessage(gdsformconst, sName) {
509 509 }
510 510 return '';
511 511 }
512   -
  512 +export function showLocalMessage(props, sName, sChineseName) {
  513 + let sTitle = '';
  514 + if(commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) && commonUtils.isNotEmptyArr(props.app.commonConst)) {
  515 + const gdsformconst = props.app.commonConst;
  516 + sTitle = showMessage(gdsformconst, sName)
  517 + } else {
  518 + sTitle = sChineseName;
  519 + }
  520 + if (sTitle === '') {
  521 + sTitle = sChineseName
  522 + }
  523 + return sTitle;
  524 +}
513 525 /** 获取配置showName */
514 526 export function getConfigShowName(config, sName) {
515 527 const iIndex = config.gdsconfigformslave.findIndex(item => item.sName === sName);
... ...
src/mes/common/buttonComponent/index.js
... ... @@ -3,6 +3,7 @@ import { Image, Badge, Modal } from &quot;antd&quot;;
3 3 import termClass from "classnames/bind";
4 4 import { DoubleRightOutlined } from "@ant-design/icons";
5 5 import styles from "./index.less";
  6 +import * as commonFunc from "@/components/Common/commonFunc";
6 7 // 通用方法
7 8 import * as commonUtils from "@/utils/utils";
8 9 // 菜单图标
... ... @@ -14,6 +15,7 @@ const getNavIcon = (bActive, iconName = 2) =&gt; {
14 15 const ButtonComponent = props => {
15 16 const { app, sModelsId, currentContent, menuMap } = props;
16 17 const { managementData, userinfo = {} } = app;
  18 + console.log('3managementData3', managementData);
17 19 const { iTeamType, sWorkshopId } = userinfo;
18 20  
19 21 if ([3, 4, 5, 6].includes(iTeamType)) {
... ... @@ -126,7 +128,7 @@ const ButtonComponent = props =&gt; {
126 128 // 是否为维修保养模块和查询追踪模块
127 129 setProcessReport(
128 130 props.currentContent === 'queryTracking' ||
129   - props.currentContent === "serviceUpkeep" ||
  131 + props.currentContent === "serviceUpkeep" ||
130 132 (props.currentContent === "productionExec" && [3, 4, 5, 6].includes(iTeamType))
131 133 );
132 134 },
... ... @@ -272,7 +274,7 @@ const ButtonComponent = props =&gt; {
272 274 } else if (e.name === "其它机台日报") {
273 275 count = table3;
274 276 }
275   -
  277 + const workFirst = commonFunc.showLocalMessage(props, 'workFirst!', '请先上班后再操作');
276 278 return (
277 279 <div
278 280 key={e.id}
... ... @@ -280,7 +282,7 @@ const ButtonComponent = props =&gt; {
280 282 if (bStartWorkLimit) {
281 283 Modal.warning({
282 284 title: "温馨提示:",
283   - content: <div>请先上班后再操作!</div>,
  285 + content: <div>{workFirst}</div>,
284 286 okText: "确认"
285 287 });
286 288 return;
... ... @@ -321,7 +323,7 @@ const ButtonComponent = props =&gt; {
321 323 </div>
322 324 );
323 325 };
324   -
  326 + console.log(menuList, '1menuList ');
325 327 return (
326 328 <div
327 329 className={`${styles.buttonComponent} ${
... ...
src/mes/common/commonModelComponent/index.js
... ... @@ -276,6 +276,7 @@ const useCommonModelEvent = props =&gt; {
276 276 const pageLayoutConfig = gdsconfigformslave.find(
277 277 item => item.sControlName === "pageLayout"
278 278 );
  279 + console.log('pageLayoutConfig', pageLayoutConfig);
279 280 if (pageLayoutConfig) {
280 281 pageLayout = commonUtils.convertStrToObj(
281 282 pageLayoutConfig.sDefault,
... ... @@ -677,7 +678,6 @@ const useCommonModelEvent = props =&gt; {
677 678 const { refreshTableListCount = 0 } = props;
678 679 let addState = {
679 680 refreshTableList: [],
680   - refreshTableListCount: refreshTableListCount + 1,
681 681 ...(await handleGetData(refreshTableList, true))
682 682 };
683 683  
... ... @@ -1211,7 +1211,9 @@ const CommonModel = baseProps =&gt; {
1211 1211 };
1212 1212  
1213 1213 const CommonModelComponent = props => {
1214   - const { tabConfig = [], level, modelStyle } = props;
  1214 + const { tabConfig = [], level, modelStyle, app } = props;
  1215 + const { userinfo } = app;
  1216 + const sLanguage = userinfo.sLanguage;
1215 1217 const getComponent = (config, index = 0) => {
1216 1218 const {
1217 1219 sName,
... ... @@ -1273,10 +1275,14 @@ const CommonModelComponent = props =&gt; {
1273 1275 const {
1274 1276 configList = [],
1275 1277 sEntireTabName,
  1278 + sEnglishEntireTabName,
  1279 + sBig5EntireTabName,
1276 1280 mode,
1277 1281 width = "100%",
1278 1282 height = "100%"
1279 1283 } = item;
  1284 + const sEntireTabNameNew = sLanguage === 'sEnglish' ? sEnglishEntireTabName :
  1285 + sLanguage === 'sBig5EntireTabName' ? sBig5EntireTabName : sEntireTabName;
1280 1286 const advancedStyle =
1281 1287 mode === "advanced"
1282 1288 ? {
... ... @@ -1345,7 +1351,7 @@ const CommonModelComponent = props =&gt; {
1345 1351 style={advancedStyle}
1346 1352 >
1347 1353 {sEntireTabName && (
1348   - <TabTitleComponent {...props} sTabName={sEntireTabName} />
  1354 + <TabTitleComponent {...props} sTabName={sEntireTabNameNew} />
1349 1355 )}
1350 1356 <Tabs
1351 1357 destroyInactiveTabPane
... ... @@ -1371,7 +1377,9 @@ const CommonModelComponent = props =&gt; {
1371 1377 !props.hideTabList.includes(item.sName)
1372 1378 )
1373 1379 .map((config, index) => {
1374   - const { sName, sTabName } = config;
  1380 + const { sName, sEnglishTabName, sBig5TabName, sTabName } = config;
  1381 + const sTabNewName = sLanguage ==='sEnglish' ? sEnglishTabName : sLanguage ==='sBig5' ?
  1382 + sBig5TabName : sTabName;
1375 1383 let disabled = false;
1376 1384  
1377 1385 if (sTabName === "拼接列表" && sName === "slaveWypj3") {
... ... @@ -1419,7 +1427,7 @@ const CommonModelComponent = props =&gt; {
1419 1427  
1420 1428 return (
1421 1429 <TabPane
1422   - tab={tabName}
  1430 + tab={sTabNewName}
1423 1431 key={`${sName}_${sTabName}`}
1424 1432 disabled={disabled}
1425 1433 >
... ... @@ -1576,7 +1584,7 @@ const CommonViewTableComponent = props =&gt; {
1576 1584 const handleReportInfo = (config = null) => {
1577 1585 reportRef.current = config;
1578 1586 setReportInfoVisible(!reportInfoVisible);
1579   - };
  1587 + };
1580 1588  
1581 1589 return (
1582 1590 <>
... ...
src/mes/common/commonOperationBarComponent/index.js
... ... @@ -78,26 +78,6 @@ const useCommonOperationBarComponentEvent = props =&gt; {
78 78 // 按钮点击事件
79 79 const clickRef = useRef(null);
80 80 const handleBtnClick = async (config, searchField) => {
81   - if (config?.sMinValue === "99") { // 二次确认
82   - const result = await new Promise(resolve => {
83   - Modal.confirm({
84   - title: "温馨提示:",
85   - content: "是否确认此操作?",
86   - okText: "确认",
87   - cancelText: "取消",
88   - onOk() {
89   - setTimeout(() => {
90   - resolve(true);
91   - }, 500);
92   - },
93   - onCancel() {
94   - resolve(false);
95   - }
96   - });
97   - });
98   - if (!result) return;
99   - }
100   -
101 81 // 限制半秒内只能点一次
102 82 if (clickRef.current) return;
103 83 clickRef.current = true;
... ... @@ -109,6 +89,9 @@ const useCommonOperationBarComponentEvent = props =&gt; {
109 89 const { sName } = props;
110 90 const { sActiveId, sButtonParam, sInstruct, sControlName } = config;
111 91  
  92 + const delayedOvertime = commonFunc.showLocalMessage(props, 'delayedOvertime', '延迟加班');
  93 + const cancelDelayedOvertime = commonFunc.showLocalMessage(props, 'cancelDelayedOvertime', '取消延迟加班');
  94 +
112 95 // 自定义按钮事件
113 96 if (
114 97 costomPageFun({
... ... @@ -254,7 +237,7 @@ const useCommonOperationBarComponentEvent = props =&gt; {
254 237 },
255 238 btnConfig: {
256 239 sId: config.sId,
257   - showName: !bDelayedOvertime ? "延迟加班" : "取消延迟加班",
  240 + showName: !bDelayedOvertime ? delayedOvertime : cancelDelayedOvertime,
258 241 sInstruct: JSON.stringify([
259 242 {
260 243 opr: "procedure",
... ... @@ -491,6 +474,10 @@ const useCommonOperationBarComponentEvent = props =&gt; {
491 474  
492 475 const { sDefault } = config;
493 476  
  477 + const delayedOvertime = commonFunc.showLocalMessage(props, 'delayedOvertime', '延迟加班');
  478 + const cancelDelayedOvertime = commonFunc.showLocalMessage(props, 'cancelDelayedOvertime', '取消延迟加班');
  479 +
  480 +
494 481 // 根据sDefault配置控制按钮是否可以操作
495 482 if (sDefault && sDefault.includes("${")) {
496 483 // 当前页面全部数据
... ... @@ -617,7 +604,6 @@ const useCommonOperationBarComponentEvent = props =&gt; {
617 604 }
618 605 defaultProps.style = style;
619 606 }
620   -
621 607 // 隐藏salveWydm2表的新增托盘
622 608 if (props.sName === "salveWydm2" && config.sControlName === "BtnLeft.Add") {
623 609 defaultProps.style = defaultProps.style || {};
... ... @@ -651,7 +637,7 @@ const useCommonOperationBarComponentEvent = props =&gt; {
651 637 defaultProps.id = "salveWybz2Print1";
652 638 } else if (config.sControlName === "BtnRight.DelayWork") {
653 639 const { bDelayedOvertime } = commonUtils.getAppData("userinfo");
654   - config.showName = bDelayedOvertime ? "取消延迟加班" : "延迟加班";
  640 + config.showName = bDelayedOvertime ? cancelDelayedOvertime : delayedOvertime;
655 641 let style = { width: "150px" };
656 642 defaultProps.style = style;
657 643 }
... ... @@ -1007,8 +993,9 @@ const CommonOperationBarComponent = basProps =&gt; {
1007 993 return "";
1008 994 }
1009 995  
  996 + const btnSearch = commonFunc.showLocalMessage(props, 'btnSearch', '查询');
1010 997 return (
1011   - <div className={`${styles.commonOperationBar} commonOperationBar2`}>
  998 + <div className={styles.commonOperationBar}>
1012 999 <div className="leftBar">
1013 1000 <Space>
1014 1001 {btnLeftConfig.map(item => {
... ... @@ -1078,7 +1065,7 @@ const CommonOperationBarComponent = basProps =&gt; {
1078 1065 <>
1079 1066 <ShowType {...showTypeProps} />
1080 1067 <Button type="primary" size="large" onClick={handleBtnSearch}>
1081   - 查询
  1068 + {btnSearch}
1082 1069 </Button>
1083 1070 </>
1084 1071 )}
... ...
src/mes/common/faceCollectionComponent/index.js
... ... @@ -4,6 +4,7 @@ import * as commonUtils from &quot;@/utils/utils&quot;;
4 4 import FaceDetect from "@/components/FaceDetect";
5 5 import ShowType from "@/components/Common/CommonComponent";
6 6 import useCommonBase from "@/components/Common/CommonHooks/useCommonBase";
  7 +import * as commonFunc from "@/components/Common/commonFunc";
7 8  
8 9 import styles from "./index.less";
9 10  
... ... @@ -50,6 +51,15 @@ const FaceCollectionComponent = baseProps =&gt; {
50 51 );
51 52  
52 53 const { faceCollectionData = [] } = props;
  54 + const faceCollection = commonFunc.showLocalMessage(props, 'faceCollection', '人脸采集');
  55 +
  56 + const faceCollectionSucess = commonFunc.showLocalMessage(props, 'faceCollectionSucess', '人脸采集成功');
  57 +
  58 + const selectUser = commonFunc.showLocalMessage(props, 'selectUser', '请选择用户');
  59 +
  60 + const BtnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消');
  61 + const BtnNext = commonFunc.showLocalMessage(props, 'BtnNext', '下一步');
  62 +
53 63  
54 64 const showDropDown = faceCollectionData.reduce((pre, item) => {
55 65 return {
... ... @@ -94,7 +104,7 @@ const FaceCollectionComponent = baseProps =&gt; {
94 104  
95 105 const handleNexStep = async () => {
96 106 if (!dataValue) {
97   - message.error("请先选择用户!");
  107 + message.error({selectUser});
98 108 return;
99 109 }
100 110  
... ... @@ -104,7 +114,7 @@ const FaceCollectionComponent = baseProps =&gt; {
104 114 );
105 115  
106 116 const modal = Modal.info({
107   - title: "人脸识别",
  117 + title: faceCollection,
108 118 keyboard: false,
109 119 content: (
110 120 <FaceDetect
... ... @@ -116,7 +126,7 @@ const FaceCollectionComponent = baseProps =&gt; {
116 126 }}
117 127 loginAfterInit
118 128 onSaveFaceSuccess={() => {
119   - message.success("人脸采集成功!");
  129 + message.success(faceCollectionSucess);
120 130 modal.destroy();
121 131 onCancel();
122 132 }}
... ... @@ -124,7 +134,7 @@ const FaceCollectionComponent = baseProps =&gt; {
124 134 />
125 135 ),
126 136 wrapClassName: "xlyFaceAuthModal",
127   - okText: "取消",
  137 + okText: BtnCancel,
128 138 onOk() {
129 139 modal.destroy();
130 140 }
... ... @@ -134,20 +144,20 @@ const FaceCollectionComponent = baseProps =&gt; {
134 144 return (
135 145 <Modal
136 146 open={visible}
137   - title="人脸采集"
  147 + title={faceCollection}
138 148 width={400}
139 149 height={250}
140 150 className="mesCommonModal mesLoginForm"
141 151 footer={
142 152 <Button type="primary" size="large" onClick={handleNexStep}>
143   - 下一步
  153 + {BtnNext}
144 154 </Button>
145 155 }
146 156 onCancel={onCancel}
147 157 >
148 158 <div className={styles.faceCollection}>
149 159 <Form layout="vertical" size="large">
150   - <Form.Item label={"请选择用户"}>
  160 + <Form.Item label={selectUser}>
151 161 <ShowType {...showTypeProps} />
152 162 </Form.Item>
153 163 </Form>
... ...
src/mes/common/siderInfoComponent/index.js
... ... @@ -239,6 +239,8 @@ const useSiderInfoComponentEvent = props =&gt; {
239 239  
240 240 const SiderInfoComponent = baseProps => {
241 241 const props = useSiderInfoComponentEvent(baseProps);
  242 + const workLoading = commonFunc.showLocalMessage(props, 'workLoading', '工单数据加载中...');
  243 + const waitWorkLoading = commonFunc.showLocalMessage(props, 'waitWorkLoading', '工单数据加载中...');
242 244 const leftClass = cx({
243 245 siderInfoComponent: true
244 246 });
... ... @@ -255,7 +257,7 @@ const SiderInfoComponent = baseProps =&gt; {
255 257 <Spin
256 258 spinning={props.pageloading1}
257 259 size="large"
258   - tip="工单数据加载中..."
  260 + tip={workLoading}
259 261 />
260 262 </div>
261 263 ) : (
... ... @@ -350,12 +352,14 @@ const WorkOrderTypeComponent = () =&gt; {
350 352 const [productionDivId] = useState(
351 353 `productionDivId_${commonUtils.createSid()}`
352 354 );
  355 + const task= commonFunc.showLocalMessage(props, 'task', '任务:工单信息');
  356 + const specialFocus= commonFunc.showLocalMessage(props, 'specialFocus', '任务:工单信息');
353 357  
354 358 return (
355 359 <div className={styles.workOrdertype} ref={ref}>
356 360 <div className="mesTitle">
357 361 <img src={iocnObj.taskIcon} />
358   - 任务:工单信息
  362 + {task}
359 363 </div>
360 364 <Carousel ref={carouselRef}>
361 365 {/* {
... ... @@ -488,7 +492,7 @@ const WorkOrderTypeComponent = () =&gt; {
488 492 flex={"160px"}
489 493 className={styles.productionTitle}
490 494 >
491   - 特别关注:
  495 + {specialFocus}
492 496 </Col>
493 497 <Col
494 498 flex={1}
... ... @@ -633,12 +637,13 @@ const DeviceTargetInfoComponent = () =&gt; {
633 637 enabled: false
634 638 };
635 639 };
  640 + const equipmentTargetInformation = commonFunc.showLocalMessage(props, 'equipmentTargetInformation', '设备及目标信息');
636 641  
637 642 return (
638 643 <div className={styles.deviceTargetInfo}>
639 644 <div className="mesTitle" style={{ padding: "10px 10px 5px" }}>
640 645 <img src={iocnObj.facilityIcon} />
641   - 设备及目标信息
  646 + {equipmentTargetInformation}
642 647 </div>
643 648 {showConfig.map((config, index) => {
644 649 if (index > 4) return "";
... ... @@ -756,6 +761,13 @@ const TeamInfoComponent = () =&gt; {
756 761 const teamShiftInfo = props.teamShiftInfoData?.[0] || {};
757 762 const { sEmployeeName = "", sEmployeeNo = "" } = teamShiftInfo;
758 763  
  764 + const teamInformation= commonFunc.showLocalMessage(props, 'teamInformation', '班组信息');
  765 +
  766 + const captain = commonFunc.showLocalMessage(props, 'captain', '机长');
  767 +
  768 + const shift = commonFunc.showLocalMessage(props, 'shift', '班次');
  769 +
  770 + const classGroup = commonFunc.showLocalMessage(props, 'classGroup', '班组');
759 771 // 当前上班机长人员
760 772 const { sActualEmployeeName, sActualEmployeeNo } = tableProps.data[0] || {};
761 773  
... ... @@ -765,7 +777,7 @@ const TeamInfoComponent = () =&gt; {
765 777 <div className={styles.teamInfo}>
766 778 <div className="mesTitle">
767 779 <img src={iocnObj.groupIcon} />
768   - 班组信息
  780 + {teamInformation}
769 781 </div>
770 782 <Row gutter="5" wrap={false}>
771 783 <Col flex={"160px"}>
... ... @@ -784,15 +796,15 @@ const TeamInfoComponent = () =&gt; {
784 796 <img src={iocnObj.userImg} />
785 797 )}
786 798 <div className="user">
787   - <span>机长:</span>
  799 + <span>{captain}:</span>
788 800 <span>{sActualEmployeeName || sEmployeeName}</span>
789 801 </div>
790 802 <div>
791   - <span>班组:</span>
  803 + <span>{classGroup}:</span>
792 804 <span>{sTeamNo}</span>
793 805 </div>
794 806 <div>
795   - <span>班次:</span>
  807 + <span>{shift}:</span>
796 808 <span>{sShift == 1 ? "白班" : "夜班"}</span>
797 809 </div>
798 810 </Col>
... ...
src/mes/indexMes/index.js
... ... @@ -30,7 +30,10 @@ import {
30 30 SwapOutlined,
31 31 AppstoreOutlined
32 32 } from "@ant-design/icons";
  33 +import * as commonFunc from "@/components/Common/commonFunc";
33 34 import zhCN from "antd/lib/locale-provider/zh_CN";
  35 +import enUS from 'antd/lib/locale-provider/en_US'; // 导入英文语言包
  36 +import zhTW from 'antd/lib/locale-provider/zh_TW'; // 导入繁体中文语言包
34 37 import Draggable from 'react-draggable';
35 38  
36 39  
... ... @@ -100,6 +103,10 @@ const OpenModalEditPwd = props =&gt; {
100 103 sUserPwdAgain: "",
101 104 sId: props.app.userinfo.sId
102 105 });
  106 + const oldPassword = commonFunc.showLocalMessage(props, 'oldPassword', '请输入原密码');
  107 + const newPassword = commonFunc.showLocalMessage(props, 'newPassword', '请输入新密码');
  108 + const passswordAgain = commonFunc.showLocalMessage(props, 'passswordAgain', '请再次输入密码');
  109 + const ModifyPassword = commonFunc.showLocalMessage(props, 'ModifyPassword','修改密码');/* 修改 */
103 110 // 确认修改密码
104 111 const handleOk = () => {
105 112 const url = `${
... ... @@ -127,24 +134,24 @@ const OpenModalEditPwd = props =&gt; {
127 134 return (
128 135 <Modal
129 136 className="mesCommonModal mesComfirm"
130   - title="修改密码"
  137 + title={ModifyPassword}
131 138 open={hooksProps.isEditPwd}
132 139 onOk={handleOk}
133 140 onCancel={() => dispatch(["saveState", { isEditPwd: false }])}
134 141 >
135 142 <Input
136 143 style={{ ...inputStyle, marginTop: 0 }}
137   - placeholder="请输入原密码"
  144 + placeholder={oldPassword}
138 145 onChange={e => setPwdForm({ ...pwdForm, sOldPwd: e.target.value })}
139 146 />
140 147 <Input
141 148 style={inputStyle}
142   - placeholder="请输入新密码"
  149 + placeholder={newPassword}
143 150 onChange={e => setPwdForm({ ...pwdForm, sUserPwd: e.target.value })}
144 151 />
145 152 <Input
146 153 style={inputStyle}
147   - placeholder="请再次确认密码"
  154 + placeholder={passswordAgain}
148 155 onChange={e =>
149 156 setPwdForm({ ...pwdForm, sUserPwdAgain: e.target.value })
150 157 }
... ... @@ -431,9 +438,24 @@ const IndexMes = baseProps =&gt; {
431 438 const getServiceError = async returnData => {
432 439 props.dispatch({ type: "app/throwErrorMes", payload: returnData });
433 440 };
  441 + const currentLanguage = props?.app?.userinfo?.sLanguage || 'zhCN'; // 默认为中文
  442 + const getLocale = () => {
  443 + switch(currentLanguage) {
  444 + case 'sEnglish':
  445 + return enUS;
  446 + case 'sBig5':
  447 + return zhTW;
  448 + default:
  449 + {
  450 + moment.locale('zh-cn');
  451 + return zhCN;
  452 + }
  453 + }
  454 + };
  455 + const bExsitLogin = commonFunc.showLocalMessage(props, 'bExsitLogin', '是否退出登录');
434 456  
435 457 return (
436   - <ConfigProvider locale={zhCN}>
  458 + <ConfigProvider locale={getLocale()}>
437 459 <myContext.Provider
438 460 value={{
439 461 props,
... ... @@ -454,7 +476,7 @@ const IndexMes = baseProps =&gt; {
454 476 {logoutShow && (
455 477 <DraggableConfirmModal
456 478 btnShow={false}
457   - content={"是否退出登录"}
  479 + content={bExsitLogin}
458 480 onOk={() => {
459 481 handleColseOee();
460 482 setLogoutShow(false);
... ... @@ -474,15 +496,20 @@ const IndexMes = baseProps =&gt; {
474 496 // 头部
475 497 const HeaderConponent = () => {
476 498 const { props } = useContext(myContext);
  499 + const { app } = props;
  500 + const { userinfo, sMachineNameStr, sTeamNameSName } = app;
  501 + const { sUserNameBak: sUserName, sShift } = userinfo;
477 502  
478   - const weekday = ["日", "一", "二", "三", "四", "五", "六"];
  503 + const sLanguage = userinfo.sLanguage;
  504 + let weekday = ["日", "一", "二", "三", "四", "五", "六"];
  505 + const sunTitle = sLanguage ==='sChinese' ? '星期' : '';
479 506 const [time, setTime] = useState("0000-00-00 00:00:00");
480 507 const { logout } = useContext(myContext);
481 508 useEffect(() => {
482 509 const getTime = () => {
483 510 const currentTime = moment().format("YYYY-MM-DD HH:mm:ss");
484 511 const currentWeek = moment().weekday();
485   - setTime(`${currentTime}${" "}${" "}星期${weekday[currentWeek]}`);
  512 + setTime(`${currentTime}${" "}${" "}${sunTitle}${weekday[currentWeek]}`);
486 513 };
487 514  
488 515 getTime();
... ... @@ -495,9 +522,50 @@ const HeaderConponent = () =&gt; {
495 522 };
496 523 }, []);
497 524  
498   - const { app } = props;
499   - const { userinfo, sMachineNameStr, sTeamNameSName } = app;
500   - const { sUserNameBak: sUserName, sShift } = userinfo;
  525 +
  526 + const logoTitle = commonFunc.showLocalMessage(props, 'EBC-MES', '小羚羊生产执行系统');
  527 + const account= commonFunc.showLocalMessage(props, 'account', '账号');
  528 + const machine= commonFunc.showLocalMessage(props, 'machine', '机台');
  529 + const classGroup = commonFunc.showLocalMessage(props, 'classGroup', '班组');
  530 + const dayShift = commonFunc.showLocalMessage(props, 'dayShift', '白班');
  531 + const nightShift = commonFunc.showLocalMessage(props, 'nightShift', '夜班');
  532 + const delayedOvertime = commonFunc.showLocalMessage(props, 'delayedOvertime', '延迟加班');
  533 +
  534 + function translateWeekdays() {
  535 + // 中文星期数组
  536 + let weekday = ["日", "一", "二", "三", "四", "五", "六"];
  537 +
  538 + // 定义中英文和繁体中文星期的映射关系
  539 + const translations = {
  540 + sEnglish: {
  541 + "日": "Sunday",
  542 + "一": "Monday",
  543 + "二": "Tuesday",
  544 + "三": "Wednesday",
  545 + "四": "Thursday",
  546 + "五": "Friday",
  547 + "六": "Saturday"
  548 + },
  549 + sBig5: {
  550 + "日": "日",
  551 + "一": "一",
  552 + "二": "二",
  553 + "三": "三",
  554 + "四": "四",
  555 + "五": "五",
  556 + "六": "六"
  557 + }
  558 + };
  559 +
  560 + // 根据用户语言设置进行转换(默认为中文)
  561 + if (userinfo.sLanguage === 'sEnglish' || userinfo.sLanguage === 'sBig5') {
  562 + return weekday.map(day => translations[userinfo.sLanguage][day] || day);
  563 + }
  564 +
  565 + return weekday;
  566 + }
  567 + weekday = translateWeekdays(sLanguage);
  568 +
501 569  
502 570  
503 571  
... ... @@ -521,25 +589,25 @@ const HeaderConponent = () =&gt; {
521 589 <img src={logo} alt="logo" />
522 590 </div>
523 591 <div className="title">
524   - <span>劲嘉生产执行系统(EBC-MES)</span>
  592 + <span>{logoTitle}</span>
525 593 </div>
526 594 <div className="userInfo">
527 595 <Space size={30}>
528 596 <div>
529   - <span>账号:</span>
  597 + <span>{account}:</span>
530 598 <span>{sUserName}</span>
531 599 </div>
532 600 <div>
533   - <span>机台:</span>
  601 + <span>{machine}:</span>
534 602 <span>{sMachineNameStr}</span>
535 603 </div>
536 604 <div>
537   - <span>班组:</span>
  605 + <span>{classGroup}:</span>
538 606 <span>{sTeamNameSName}</span>
539   - <span>({sShift == 1 ? "白班" : "夜班"})</span>
  607 + <span>({sShift == 1 ? dayShift : nightShift})</span>
540 608 </div>
541 609 <div>
542   - <span>{userinfo.bDelayedOvertime ? "延时加班" : ""}</span>
  610 + <span>{userinfo.bDelayedOvertime ? delayedOvertime : ""}</span>
543 611 </div>
544 612 </Space>
545 613 </div>
... ... @@ -550,17 +618,17 @@ const HeaderConponent = () =&gt; {
550 618 <div className="logout" onClick={logout} />
551 619 </div>
552 620  
553   - <Modal
554   - title="Basic Modal"
555   - open={isModalOpen}
  621 + <Modal
  622 + title="Basic Modal"
  623 + open={isModalOpen}
556 624 width={'100vw'}
557 625 height={'100vh'}
558   - onCancel={handleCancel}
559   - footer={null}
  626 + onCancel={handleCancel}
  627 + footer={null}
560 628 mask={false}
561 629 closable={false}
562 630 destroyOnClose={true}
563   - maskClosable={false}
  631 + maskClosable={false}
564 632 wrapClassName={ styles.ztwwwww }>
565 633 <MachineMessageComponent e={objRef.current} shutDown={handleCancel} />
566 634 </Modal>
... ... @@ -583,30 +651,30 @@ const MachineMessageComponent = ({ e , shutDown }) =&gt; {
583 651 const getTime = () => {
584 652 const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss");
585 653 setCurrentTime(currentTimeNew);
586   -
  654 +
587 655 const duration = moment.duration(
588 656 moment(currentTimeNew).diff(moment(startTime))
589 657 );
590 658 const hours = duration.asHours().toString().split(".")[0];
591 659 const minutes = (duration.asMinutes() % 60).toString().split(".")[0];
592 660 const seconds = duration.asSeconds() % 60;
593   -
  661 +
594 662 setDiffHours(hours<=9? `0${hours}`: hours);
595 663 setDiffMins(minutes<=9? `0${minutes}`: minutes );
596 664 setDiffSecs(seconds<=9? `0${seconds}`: seconds);
597 665 };
598   -
  666 +
599 667 getTime();
600 668 const timer = setInterval(() => {
601 669 console.log('定时器状态')
602 670 getTime();
603 671 }, 1000);
604   -
  672 +
605 673 return () => {
606 674 clearInterval(timer);
607 675 };
608 676 }, []);
609   -
  677 +
610 678 const handleMenuClose = () => {
611 679 Modal.confirm({
612 680 title: "温馨提示:",
... ... @@ -621,7 +689,7 @@ const MachineMessageComponent = ({ e , shutDown }) =&gt; {
621 689 });
622 690 };
623 691  
624   -
  692 +
625 693 const isMinMax = useRef('max');
626 694 const draggleRef = useRef(null);
627 695 const [bounds, setBounds] = useState({ left: 0, top: 0, bottom: 0, right: 0 });
... ... @@ -639,7 +707,7 @@ const MachineMessageComponent = ({ e , shutDown }) =&gt; {
639 707 });
640 708 };
641 709  
642   -
  710 +
643 711 return (
644 712 <div className={`${styles.modalBoxStyle} ${isMinMax.current}`}>
645 713  
... ... @@ -689,53 +757,67 @@ const MachineMessageComponent = ({ e , shutDown }) =&gt; {
689 757 </div>
690 758 );
691 759 };
692   -
693 760  
694 761  
695 762  
696   -// 左侧侧边栏
  763 +
  764 + // 左侧侧边栏
697 765 const SiderComponent = () => {
698 766 const { dispatch, hooksProps, props, ...rest } = useContext(myContext);
699 767 const { currentContent, menuMap } = hooksProps;
  768 +
  769 + const teamInformation= commonFunc.showLocalMessage(props, 'teamInformation', '班组信息');
  770 + console.log('2222', teamInformation);
  771 +
  772 + const scheduledTask= commonFunc.showLocalMessage(props, 'scheduledTask', '计划任务');
  773 +
  774 + const productionExecution= commonFunc.showLocalMessage(props, 'productionExecution', '生产执行');
  775 +
  776 + const maintenanceRepair= commonFunc.showLocalMessage(props, 'maintenanceRepair', '维修保养');
  777 +
  778 + const queryTracing= commonFunc.showLocalMessage(props, 'queryTracing', '查询追踪');
  779 +
  780 + const operationGuide= commonFunc.showLocalMessage(props, 'teamInformation', '操作指南');
  781 +
700 782 const menuList = [
701 783 {
702 784 id: "teamInfo",
703   - title: "班组信息",
  785 + title: teamInformation,
704 786 path: "/indexMes/teamInfo",
705 787 icon: teamIcon,
706 788 c_icon: c_teamIcon
707 789 },
708 790 {
709 791 id: "scheduledTasks",
710   - title: "计划任务",
  792 + title: scheduledTask,
711 793 path: "/indexMes/scheduledTasks",
712 794 icon: planTaskIcon,
713 795 c_icon: c_planTaskIcon
714 796 },
715 797 {
716 798 id: "productionExec",
717   - title: "生产执行",
  799 + title: productionExecution,
718 800 path: "/indexMes/productionExec",
719 801 icon: proExeIcon,
720 802 c_icon: c_proExeIcon
721 803 },
722 804 {
723 805 id: "serviceUpkeep",
724   - title: "维修保养",
  806 + title: maintenanceRepair,
725 807 path: "/indexMes/serviceUpkeep",
726 808 icon: serviceIcon,
727 809 c_icon: c_serviceIcon
728 810 },
729 811 {
730 812 id: "queryTracking",
731   - title: "查询追踪",
  813 + title: queryTracing,
732 814 path: "/indexMes/queryTracking",
733 815 icon: queryTraceIcon,
734 816 c_icon: c_queryTraceIcon
735 817 },
736 818 {
737 819 id: "operationGuide",
738   - title: "操作指南",
  820 + title: operationGuide,
739 821 path: "/indexMes/operationGuide",
740 822 icon: guideIcon,
741 823 c_icon: c_guideIcon
... ... @@ -805,6 +887,7 @@ const SystemFunComponent = () =&gt; {
805 887 const [popoverVisible, setPopoverVisible] = useState(false);
806 888 const [popoverVisible1, setPopoverVisible1] = useState(false);
807 889 const { props, dispatch } = useContext(myContext);
  890 + const systemFunctions = commonFunc.showLocalMessage(props, 'systemFunctions', '系统功能');
808 891  
809 892 const stopRef = useRef(false);
810 893 const stopClose = useRef(false);
... ... @@ -841,7 +924,7 @@ const SystemFunComponent = () =&gt; {
841 924 const handleProcedureCall = async (params, iFlag) => {
842 925 const { onSuccess } = params;
843 926 const { app } = props;
844   -
  927 + const FriendlyReminder = commonFunc.showLocalMessage(this.props, 'FriendlyReminder', '温馨提示');
845 928 const { sMachineNameSId, sTeamNameSId, sShift, token, sModelsId } = app;
846 929  
847 930 const value = {
... ... @@ -888,10 +971,8 @@ const SystemFunComponent = () =&gt; {
888 971 onSuccess && onSuccess();
889 972 } else if (code === -7) {
890 973 Modal.confirm({
891   - title: "温馨提示:",
  974 + title: FriendlyReminder,
892 975 content: <div>{handleGetMsg(msg)}</div>,
893   - okText: "确认",
894   - cancelText: "取消",
895 976 onOk() {
896 977 handleProcedureCall(params, 1);
897 978 },
... ... @@ -899,9 +980,8 @@ const SystemFunComponent = () =&gt; {
899 980 });
900 981 } else if (code === -8) {
901 982 Modal.info({
902   - title: "温馨提示:",
  983 + title: FriendlyReminder,
903 984 content: <div>{handleGetMsg(msg)}</div>,
904   - okText: "确认",
905 985 onOk() {
906 986 onSuccess && onSuccess();
907 987 }
... ... @@ -917,6 +997,8 @@ const SystemFunComponent = () =&gt; {
917 997 const { onSuccess } = params;
918 998 const { app } = props;
919 999  
  1000 + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示');
  1001 +
920 1002 const { sMachineNameSId, sTeamNameSId, sShift, token, sModelsId } = app;
921 1003 const userinfo = commonUtils.getAppData("userinfo");
922 1004  
... ... @@ -965,10 +1047,8 @@ const SystemFunComponent = () =&gt; {
965 1047 onSuccess && onSuccess();
966 1048 } else if (code === -7) {
967 1049 Modal.confirm({
968   - title: "温馨提示:",
  1050 + title: FriendlyReminder,
969 1051 content: <div>{handleGetMsg(msg)}</div>,
970   - okText: "确认",
971   - cancelText: "取消",
972 1052 onOk() {
973 1053 handleProcedureCall1(params, 1);
974 1054 },
... ... @@ -976,9 +1056,8 @@ const SystemFunComponent = () =&gt; {
976 1056 });
977 1057 } else if (code === -8) {
978 1058 Modal.info({
979   - title: "温馨提示:",
  1059 + title: FriendlyReminder,
980 1060 content: <div>{handleGetMsg(msg)}</div>,
981   - okText: "确认",
982 1061 onOk() {
983 1062 onSuccess && onSuccess();
984 1063 }
... ... @@ -990,6 +1069,7 @@ const SystemFunComponent = () =&gt; {
990 1069 };
991 1070  
992 1071 const handleSystemFunClick = type => {
  1072 + const underDevelop = commonFunc.showLocalMessage(props, 'underDevelop', '功能开发中,敬请期待!');
993 1073 switch (type) {
994 1074 case "changePwd":
995 1075 dispatch(["saveState", { isEditPwd: true }]);
... ... @@ -1000,7 +1080,7 @@ const SystemFunComponent = () =&gt; {
1000 1080 case "logout":
1001 1081 break;
1002 1082 case "shutdown":
1003   - message.info("功能开发中,敬请期待...");
  1083 + message.info(underDevelop);
1004 1084 break;
1005 1085 case "restDailyReport":
1006 1086 handleProcedureCall({
... ... @@ -1030,6 +1110,16 @@ const SystemFunComponent = () =&gt; {
1030 1110  
1031 1111 const getSystemFunContent = () => {
1032 1112 const userinfo = commonUtils.getAppData("userinfo");
  1113 + const ModifyPassword = commonFunc.showLocalMessage(props, 'ModifyPassword','修改密码');/* 修改密码 */
  1114 + const faceCollection = commonFunc.showLocalMessage(props, 'faceCollection', '人脸采集');
  1115 + const moreFunctions = commonFunc.showLocalMessage(props, 'moreFunctions', '更多功能');
  1116 + const Logout = commonFunc.showLocalMessage(props, 'Logout', '退出登录');
  1117 + const shutDown= commonFunc.showLocalMessage(props, 'shutDown', '关机');
  1118 + const resetDailyReport= commonFunc.showLocalMessage(props, 'resetDailyReport', '关机');
  1119 + const switchToManual= commonFunc.showLocalMessage(props, 'switchToManual', '切换手动');
  1120 + const SwitchAuto= commonFunc.showLocalMessage(props, 'SwitchAuto', '切换自动');
  1121 +
  1122 +
1033 1123 const { bPlcSd } = userinfo;
1034 1124 return (
1035 1125 <div className="systemFunContent">
... ... @@ -1040,7 +1130,7 @@ const SystemFunComponent = () =&gt; {
1040 1130 }}
1041 1131 >
1042 1132 <UserAddOutlined />
1043   - <span>人脸采集</span>
  1133 + <span>{faceCollection}</span>
1044 1134 </div>
1045 1135 <div
1046 1136 className="changePwd"
... ... @@ -1048,7 +1138,7 @@ const SystemFunComponent = () =&gt; {
1048 1138 handleSystemFunClick("changePwd");
1049 1139 }}
1050 1140 >
1051   - <span>修改密码</span>
  1141 + <span>{ModifyPassword}</span>
1052 1142 </div>
1053 1143 <div
1054 1144 className="logout"
... ... @@ -1056,7 +1146,7 @@ const SystemFunComponent = () =&gt; {
1056 1146 handleSystemFunClick("logout");
1057 1147 }}
1058 1148 >
1059   - <span>退出登录</span>
  1149 + <span>{Logout}</span>
1060 1150 </div>
1061 1151 <div
1062 1152 className="shutdown"
... ... @@ -1064,7 +1154,7 @@ const SystemFunComponent = () =&gt; {
1064 1154 handleSystemFunClick("shutdown");
1065 1155 }}
1066 1156 >
1067   - <span>关机</span>
  1157 + <span>{shutDown}</span>
1068 1158 </div>
1069 1159 <Popover
1070 1160 placement="rightBottom"
... ... @@ -1079,7 +1169,7 @@ const SystemFunComponent = () =&gt; {
1079 1169 }}
1080 1170 >
1081 1171 <UndoOutlined />
1082   - <span>重置日报</span>
  1172 + <span>{resetDailyReport}</span>
1083 1173 </div>
1084 1174 <div
1085 1175 className="restDailyReport"
... ... @@ -1088,7 +1178,7 @@ const SystemFunComponent = () =&gt; {
1088 1178 }}
1089 1179 >
1090 1180 <SwapOutlined />
1091   - <span>{bPlcSd ? "切换自动" : "切换手动"}</span>
  1181 + <span>{bPlcSd ? SwitchAuto : switchToManual}</span>
1092 1182 </div>
1093 1183 </div>
1094 1184 }
... ... @@ -1108,7 +1198,7 @@ const SystemFunComponent = () =&gt; {
1108 1198 }}
1109 1199 >
1110 1200 <AppstoreOutlined />
1111   - <span>更多功能</span>
  1201 + <span>{moreFunctions}</span>
1112 1202 </div>
1113 1203 </Popover>
1114 1204 </div>
... ... @@ -1138,7 +1228,7 @@ const SystemFunComponent = () =&gt; {
1138 1228 <div className="icon">
1139 1229 <img src={popoverVisible || hoverState ? c_systemIcon : systemIcon} />
1140 1230 </div>
1141   - <div className="title">系统功能</div>
  1231 + <div className="title">{systemFunctions}</div>
1142 1232 </div>
1143 1233 </Popover>
1144 1234 );
... ...
src/mes/login/index.js
... ... @@ -19,6 +19,7 @@ const initValue = {
19 19  
20 20 // 事件层
21 21 const useLoginEvent = props => {
  22 + const [companys, setCompanys] = useState([]); // 添加这行
22 23 // 清除浏览器缓存
23 24 useEffect(() => {
24 25 const ipAddress = localStorage.ipAddress;
... ... @@ -91,6 +92,12 @@ const useLoginEvent = props =&gt; {
91 92 "mesSysbrands",
92 93 JSON.stringify({ sBrandsId: sParentId, sSubsidiaryId: sId })
93 94 );
  95 + /* 测试英文版本 默认英文 */
  96 + if(companysConfigReturn.dataset.rows) {
  97 + companysConfigReturn.dataset.rows[0].sLanguage = 'sEnglish';
  98 + }
  99 + setCompanys(companysConfigReturn.dataset.rows); // 修改这行2
  100 +
94 101 props.onSaveState({
95 102 masterData: { sBrandsId: sParentId, sSubsidiaryId: sId }
96 103 });
... ... @@ -125,13 +132,32 @@ const useLoginEvent = props =&gt; {
125 132 };
126 133  
127 134 // 登录事件
128   - const handleSubmit = async ({ faceLoginValue = {}, sEmployeeNo } = {}) => {
  135 + const handleSubmit = async ({ faceLoginValue = {}, sEmployeeNo } = {}, configsData) => {
129 136 const bFaceLogin = commonUtils.isNotEmptyObject(faceLoginValue);
130 137  
131 138 let dataReturn = {};
132 139 if (!bFaceLogin) {
133 140 // 账号密码登录
134   - const { masterData } = props;
  141 + const { masterData, companys } = props;
  142 + // 新增方法:根据sName过滤configs
  143 + const getConfigByName = (name, configs, sLanguage) => {
  144 + const configObj = configs.find(item => item.sName === name);
  145 + const showName = sLanguage === 'sChinese' ? configObj.sChinese : sLanguage ==='sEnglish' ? configObj.sEnglish :
  146 + sLanguage === 'sBig5' ? configObj.sBig5 : configObj.sChinese;
  147 + return showName;
  148 + };
  149 + const sLanguage = commonUtils.isNotEmptyArr(companys) ? companys[0].sLanguage : 'sEnglish';
  150 +
  151 + const pleaseSelectUser = getConfigByName('pleaseSelectUser', configsData, sLanguage);
  152 +
  153 + const pleaseInputPassword = getConfigByName('pleaseInputPassword', configsData, sLanguage);
  154 +
  155 + const pleaseSelectTeam = getConfigByName('pleaseSelectTeam', configsData, sLanguage);
  156 +
  157 + const pleaseselectShift = getConfigByName('pleaseselectShift', configsData, sLanguage);
  158 +
  159 + const pleaseSelectMachine = getConfigByName('pleaseSelectMachine', configsData, sLanguage);
  160 +
135 161  
136 162 const {
137 163 sUserId: userId,
... ... @@ -172,23 +198,23 @@ const useLoginEvent = props =&gt; {
172 198 }
173 199  
174 200 if (!username) {
175   - message.error("请选择用户!");
  201 + message.error(pleaseSelectUser);
176 202 return;
177 203 }
178 204 if (!sEmployeeNo && !password) {
179   - message.error("请输入密码!");
  205 + message.error(pleaseInputPassword);
180 206 return;
181 207 }
182 208 if (sShift === undefined) {
183   - message.error("请选择班次!");
  209 + message.error(pleaseselectShift);
184 210 return;
185 211 }
186 212 if (!sTeamId) {
187   - message.error("请选择班组!");
  213 + message.error(pleaseSelectTeam);
188 214 return;
189 215 }
190 216 if (!sMachineId) {
191   - message.error("请选择机台!");
  217 + message.error(pleaseSelectMachine);
192 218 return;
193 219 }
194 220  
... ... @@ -321,6 +347,7 @@ const useLoginEvent = props =&gt; {
321 347  
322 348 return {
323 349 ...props,
  350 + companys, // 确保返回companys
324 351 configs,
325 352 onSubmit: handleSubmit,
326 353 onFaceLogin: handleFaceLogin,
... ... @@ -331,8 +358,12 @@ const useLoginEvent = props =&gt; {
331 358 // 遍历登录文本组件
332 359 const handleGetFormItem = (props, item) => {
333 360 const { sModelsId } = initValue;
334   - const { masterData = {} } = props;
  361 + const { masterData = {}, companys } = props;
  362 + const sLanguage = commonUtils.isNotEmptyArr(companys) && companys[0].sLanguage || 'sEnglish';
335 363 let enabledNew = true;
  364 + if(item.sName?.includes('please') || item.sName?.includes('请')) {
  365 + return;
  366 + }
336 367 if (item.iTag === 1) {
337 368 enabledNew = false;
338 369 } else if (item.iTag === 3) {
... ... @@ -374,8 +405,10 @@ const handleGetFormItem = (props, item) =&gt; {
374 405 bPassWord: item.sName === "sPassWord",
375 406 style: { backgroundColor: "#eaeaea" }
376 407 };
  408 + const showName = sLanguage === 'sChinese' ? item.sChinese : sLanguage ==='sEnglish' ? item.sEnglish
  409 + : item.sBig5;
377 410 return (
378   - <Form.Item label={item.showName} key={item.sName}>
  411 + <Form.Item label={showName} key={item.sName}>
379 412 <ShowType {...showTypeProps} />
380 413 </Form.Item>
381 414 );
... ... @@ -384,14 +417,82 @@ const handleGetFormItem = (props, item) =&gt; {
384 417 // 主入口
385 418 const login = baseProps => {
386 419 const props = useLoginEvent(useCommonBase(baseProps));
387   - const { configs } = props;
  420 + const { configs , app, companys } = props;
  421 + const sysObj = commonUtils.isNotEmptyArr(companys) ? companys[0] : [];
  422 + console.log('222', sysObj);
  423 + const sLanguage = sysObj?.sLanguage || 'sEnglish';
  424 +
  425 + const oeeTitle =
  426 + sLanguage === "sChinese" ? "小羚羊生产执行系统" : sLanguage === "sEnglish" ? "Manufacturing Execution System" : "小羚羊生產執行系統";
  427 +
  428 + const bannerTitle =
  429 + sLanguage === "sChinese" ? "小羚羊生产执行系统" : sLanguage === "sEnglish" ? "XLY Manufacturing Execution System" : "小羚羊生產執行系統";
  430 +
  431 + const pleaseInputUserName =
  432 + sLanguage === "sChinese"
  433 + ? "用户名"
  434 + : sLanguage === "sEnglish"
  435 + ? "UserName"
  436 + : "用戶名"; /* 用戶名 */
  437 + const pleaseInputPassword =
  438 + sLanguage === "sChinese"
  439 + ? "密码"
  440 + : sLanguage === "sEnglish"
  441 + ? "Password"
  442 + : "密碼"; /* 密码 */
  443 + const teamName =
  444 + sLanguage === "sChinese"
  445 + ? "班组名称"
  446 + : sLanguage === "sEnglish"
  447 + ? "Team Name"
  448 + : "班組名稱"; /* 班组名称 */
  449 + const equipmentName =
  450 + sLanguage === "sChinese"
  451 + ? "设备名称"
  452 + : sLanguage === "sEnglish"
  453 + ? "Equipment Name"
  454 + : "設備名稱"; /* 班组名称 */
  455 + const btnLogin =
  456 + sLanguage === "sChinese"
  457 + ? "登 录"
  458 + : sLanguage === "sEnglish"
  459 + ? "Login"
  460 + : "登 錄"; /* 登 陆 */
  461 + const btnClose =
  462 + sLanguage === "sChinese"
  463 + ? "关 闭"
  464 + : sLanguage === "sEnglish"
  465 + ? "Close"
  466 + : "關 閉"; /* 关 闭 */
  467 + const btnFace = sLanguage === "sChinese"? "人 脸 登 录" : sLanguage === "sEnglish" ? "FaceLogin" : "人 臉 登 錄"; /* 人 脸 */
  468 +
  469 + const btnNormal =
  470 + sLanguage === "sChinese"
  471 + ? "普 通 登 录"
  472 + : sLanguage === "sEnglish"
  473 + ? "CommonLogin"
  474 + : "普 通 人 臉"; /* 普 通 */
  475 +
  476 + const chooseBranchCompany =
  477 + sLanguage === "sChinese"
  478 + ? "请选择分公司名称"
  479 + : sLanguage === "sEnglish"
  480 + ? "Please select branch name"
  481 + : "請選擇分公司名稱"; /* 请选择分公司名称 */
  482 +
  483 +
388 484  
389 485 const [form] = Form.useForm();
390 486  
391 487 return (
392 488 <div className={styles.login}>
  489 + {/*<div className="loginTitle">*/}
  490 + {/* <div className="loginTitle1">Enterprise Business Capability MES</div>*/}
  491 + {/* <div className="loginTitle2">{bannerTitle}</div>*/}
  492 + {/* <div className="loginTitle3">EBC-MES</div>*/}
  493 + {/*</div>*/}
393 494 <div className="loginBox">
394   - <div className="logo">劲嘉生产执行系统(EBC-MES)</div>
  495 + <div className="logo">{oeeTitle}</div>
395 496 <Form form={form} layout="vertical" size="large">
396 497 {configs.map(item => handleGetFormItem(props, item))}
397 498 <Form.Item>
... ... @@ -400,10 +501,10 @@ const login = baseProps =&gt; {
400 501 type="primary"
401 502 block
402 503 onClick={() => {
403   - props.onSubmit();
  504 + props.onSubmit({}, configs);
404 505 }}
405 506 >
406   - 登录
  507 + {btnLogin}
407 508 </Button>
408 509 </Form.Item>
409 510 </Form>
... ... @@ -420,7 +521,7 @@ const login = baseProps =&gt; {
420 521 props.onFaceLogin();
421 522 }}
422 523 >
423   - 人脸登录
  524 + {btnFace}
424 525 </div>
425 526 </div>
426 527 {/* <div style={{ width: "100%", height: 60 }} /> */}
... ... @@ -436,10 +537,13 @@ const FaceLoginModal = props =&gt; {
436 537 const { faceLoginModalVisible } = props;
437 538  
438 539 if (!faceLoginModalVisible) return "";
  540 + const { companys } = props;
  541 + const sLanguage = commonUtils.isNotEmptyArr(companys) ? companys[0].sLanguage : 'English';
  542 + const btnFace = sLanguage === "sChinese"? "人 脸 登 录" : sLanguage === "sEnglish" ? "FaceLogin" : "人 臉 登 錄"; /* 人 脸 */
439 543  
440 544 return (
441 545 <Modal
442   - title="人脸登录"
  546 + title={btnFace}
443 547 open={faceLoginModalVisible}
444 548 width={800}
445 549 height={800}
... ... @@ -467,9 +571,15 @@ const FaceLoginModal = props =&gt; {
467 571  
468 572 // 人脸弹窗后选择其他内容
469 573 const FaceLoginAfterModal = props => {
470   - const { faceLoginAfterModalVisible } = props;
  574 + const { faceLoginAfterModalVisible , companys } = props;
471 575  
472 576 if (!faceLoginAfterModalVisible) return "";
  577 + const sLanguage = commonUtils.isNotEmptyArr(companys) ? companys[0].sLanguage : 'English';
  578 + const sLoginConfirm = sLanguage === "sChinese"? "登陆信息确认" : sLanguage === "sEnglish" ? "Login Information Confirmation" : "登陸信息確認"; /* 人 脸 */
  579 + const btnConfirm = sLanguage === "sChinese"? "确认" : sLanguage === "sEnglish" ? "Confirm" : "確認"; /* 人 脸 */
  580 + const btnCancel = sLanguage === "sChinese"? "确认" : sLanguage === "sEnglish" ? "Cancel" : "取消"; /* 取消 */
  581 +
  582 +
473 583 const {
474 584 configs: configOld = [],
475 585 masterData = {},
... ... @@ -522,7 +632,7 @@ const FaceLoginAfterModal = props =&gt; {
522 632 const [form] = Form.useForm();
523 633 return (
524 634 <Modal
525   - title="登陆信息确认"
  635 + title={sLoginConfirm}
526 636 open={faceLoginAfterModalVisible}
527 637 width={500}
528 638 height={800}
... ... @@ -539,7 +649,7 @@ const FaceLoginAfterModal = props =&gt; {
539 649 props.onSubmit({ sEmployeeNo });
540 650 }}
541 651 >
542   - 确认
  652 + {btnConfirm}
543 653 </Button>
544 654 <Button
545 655 size="large"
... ... @@ -553,7 +663,7 @@ const FaceLoginAfterModal = props =&gt; {
553 663 });
554 664 }}
555 665 >
556   - 取消
  666 + {btnCancel}
557 667 </Button>
558 668 </>
559 669 }
... ...
src/mes/login/index.less
... ... @@ -13,6 +13,34 @@
13 13 font-family: Microsoft YaHei, Microsoft YaHei;
14 14 }
15 15  
  16 + .loginTitle {
  17 + position: absolute;
  18 + top: 0;
  19 + left: 0;
  20 + .size(auto, 100%);
  21 + display: flex;
  22 + flex-direction: column;
  23 + // align-items: center;
  24 + justify-content: center;
  25 + color: #FFF;
  26 + font-weight: bold;
  27 + padding-left: 6%;
  28 +
  29 + .loginTitle1 {
  30 + font-size: 34px;
  31 + }
  32 +
  33 + .loginTitle2 {
  34 + font-size: 60px;
  35 + margin-top: -8px;
  36 + }
  37 +
  38 + .loginTitle3 {
  39 + font-size: 116px;
  40 + margin-top: -57px;
  41 + }
  42 + }
  43 +
16 44 .loginBox {
17 45 width: 35%;
18 46 height: auto;
... ...
src/mes/operationGuide/component/BroadsideCard.js
1 1 import React from "react";
2 2 import { Tooltip } from "antd";
  3 +import * as commonFunc from "@/components/Common/commonFunc";
3 4 import styles from "../index.less";
4 5  
5 6 const OperationGuide = props => {
... ... @@ -10,13 +11,18 @@ const OperationGuide = props =&gt; {
10 11 });
11 12 };
12 13  
  14 + const operationGuide = commonFunc.showLocalMessage(props, 'operationGuide', '操作指引');
  15 + const digitalFactoryMES = commonFunc.showLocalMessage(props, 'digitalFactoryMES', '数字工厂MES系统操作指引.pdf');
  16 + const keyOperationMES = commonFunc.showLocalMessage(props, 'keyOperationMES', 'MES关键操作说明.xlsx');
  17 + const MESPrinterSolutions = commonFunc.showLocalMessage(props, 'MESPrinterSolutions', 'MES打印机更换纸张后亮红灯解决方法.pdf');
  18 + const workshopMESPrinters = commonFunc.showLocalMessage(props, 'workshopMESPrinters', '车间MES打印机更换纸张.pdf');
13 19 return (
14 20 <div className={styles.broadsideCardBox}>
15   - <div className="title1">操作指引</div>
  21 + <div className="title1">{operationGuide}</div>
16 22 <div className="part1">
17 23 <Tooltip
18 24 title={
19   - <div style={{ fontSize: 18 }}>数字工厂MES系统操作指引.pdf</div>
  25 + <div style={{ fontSize: 18 }}>{digitalFactoryMES}</div>
20 26 }
21 27 placement="left"
22 28 >
... ... @@ -28,7 +34,7 @@ const OperationGuide = props =&gt; {
28 34 />
29 35 </Tooltip>
30 36 <Tooltip
31   - title={<div style={{ fontSize: 18 }}>MES关键操作说明.xlsx</div>}
  37 + title={<div style={{ fontSize: 18 }}>{keyOperationMES}</div>}
32 38 placement="left"
33 39 >
34 40 <div
... ... @@ -43,23 +49,23 @@ const OperationGuide = props =&gt; {
43 49 <Tooltip
44 50 placement="left"
45 51 title={
46   - <div style={{ fontSize: 18 }}>数字工厂MES系统操作指引.pdf</div>
  52 + <div style={{ fontSize: 18 }}>{digitalFactoryMES}</div>
47 53 }
48 54 >
49   - <div>数字工厂MES系统操作指引.pdf</div>
  55 + <div>{digitalFactoryMES}</div>
50 56 </Tooltip>
51 57 <Tooltip
52 58 placement="left"
53   - title={<div style={{ fontSize: 18 }}>MES关键操作说明.xlsx</div>}
  59 + title={<div style={{ fontSize: 18 }}>{keyOperationMES}</div>}
54 60 >
55   - <div>MES关键操作说明.xlsx</div>
  61 + <div>{keyOperationMES}</div>
56 62 </Tooltip>
57 63 </div>
58 64 <div className="part1">
59 65 <Tooltip
60 66 title={
61 67 <div style={{ fontSize: 18 }}>
62   - MES打印机更换纸张后亮红灯解决方法.pdf
  68 + {MESPrinterSolutions}
63 69 </div>
64 70 }
65 71 placement="left"
... ... @@ -72,7 +78,7 @@ const OperationGuide = props =&gt; {
72 78 />
73 79 </Tooltip>
74 80 <Tooltip
75   - title={<div style={{ fontSize: 18 }}>车间MES打印机更换纸张.pdf</div>}
  81 + title={<div style={{ fontSize: 18 }}>{workshopMESPrinters}</div>}
76 82 placement="left"
77 83 >
78 84 <div
... ... @@ -88,17 +94,17 @@ const OperationGuide = props =&gt; {
88 94 placement="left"
89 95 title={
90 96 <div style={{ fontSize: 18 }}>
91   - MES打印机更换纸张后亮红灯解决方法.pdf
  97 + {MESPrinterSolutions }
92 98 </div>
93 99 }
94 100 >
95   - <div>MES打印机更换纸张后亮红灯解决方法.pdf</div>
  101 + <div>{MESPrinterSolutions}</div>
96 102 </Tooltip>
97 103 <Tooltip
98 104 placement="left"
99   - title={<div style={{ fontSize: 18 }}>车间MES打印机更换纸张.pdf</div>}
  105 + title={<div style={{ fontSize: 18 }}>{workshopMESPrinters}</div>}
100 106 >
101   - <div>车间MES打印机更换纸张.pdf</div>
  107 + <div>{workshopMESPrinters}</div>
102 108 </Tooltip>
103 109 </div>
104 110 </div>
... ...
src/mes/operationGuide/component/FlowChart.js
... ... @@ -4,14 +4,84 @@ import styles from &quot;../index.less&quot;;
4 4 import { setTimeout } from "core-js";
5 5  
6 6  
  7 +const resources = {
  8 + sChinese: {
  9 + teamLogin: "班组登录",
  10 + registerWork: "登记上班",
  11 + teamHandover: "班组交接",
  12 + planTask: "计划任务",
  13 + productionExec: "生产执行",
  14 + qualityInspection: "质量巡检",
  15 + processInspection: "工艺巡检",
  16 + equipmentInspection: "设备巡检",
  17 + disassembleBoard: "拆合板",
  18 + currentTask: "当前任务",
  19 + taskCompletion: "任务完工",
  20 + trayScan: "托盘扫码",
  21 + trayUnloading: "托盘下料",
  22 + completionClearance: "完工清场",
  23 + teamReport: "班组报工",
  24 + registerOffWork: "登记下班",
  25 + working: "作业中",
  26 + afterWork: "作业后"
  27 + },
  28 + sEnglish: {
  29 + teamLogin: "Team Login",
  30 + registerWork: "Register Work",
  31 + teamHandover: "Team Handover",
  32 + planTask: "Plan Task",
  33 + productionExec: "Production Execution",
  34 + qualityInspection: "Quality Inspection",
  35 + processInspection: "Process Inspection",
  36 + equipmentInspection: "Equipment Inspection",
  37 + disassembleBoard: "Disassemble Board",
  38 + currentTask: "Current Task",
  39 + taskCompletion: "Task Completion",
  40 + trayScan: "Tray Scan",
  41 + trayUnloading: "Tray Unloading",
  42 + completionClearance: "Completion Clearance",
  43 + teamReport: "Team Report",
  44 + registerOffWork: "Register Off Work",
  45 + beforeWork: "BeforeWork",
  46 + working: "Working",
  47 + afterWork: "After Work"
  48 + },
  49 + sBig5: {
  50 + teamLogin: "班組登錄",
  51 + registerWork: "登記上班",
  52 + teamHandover: "班組交接",
  53 + planTask: "計劃任務",
  54 + productionExec: "生產執行",
  55 + qualityInspection: "質量巡檢",
  56 + processInspection: "工藝巡檢",
  57 + equipmentInspection: "設備巡檢",
  58 + disassembleBoard: "拆合板",
  59 + currentTask: "當前任務",
  60 + taskCompletion: "任務完工",
  61 + trayScan: "托盤掃碼",
  62 + trayUnloading: "托盤下料",
  63 + completionClearance: "完工清場",
  64 + teamReport: "班組報工",
  65 + registerOffWork: "登記下班",
  66 + beforeWork: "作業中",
  67 + working: "作業中",
  68 + afterWork: "作業後"
  69 + }
  70 +};
7 71  
8   -const BroadsideCardRender = () => {
  72 +const BroadsideCardRender = (props) => {
  73 + // 获取语言设置,默认为中文
  74 + const sLanguage = props?.app?.userinfo?.sLanguage || 'sChinese';
  75 + console.log(sLanguage, sLanguage);
  76 + console.log(3888, props);
  77 + const teamLogin = resources[sLanguage].teamLogin;
  78 + console.log(teamLogin, 'teamLogin');
9 79  
10 80 const [ loading , setloading ] = useState(true)
11 81 const [ flowData , setFlowData ] = useState([
12 82 {
13 83 work:"front",
14   - name:"班组登录",
  84 + name:resources[sLanguage].teamLogin,
15 85 cellSite:"1-1",
16 86 x6:[
17 87 ()=>({
... ... @@ -19,11 +89,11 @@ const BroadsideCardRender = () =&gt; {
19 89 target: { x: getOffset('front-2-1' , 'x-domStart') , y: getOffset('front-2-1' , 'y-domCenter') },
20 90 })
21 91 ]
22   -
  92 +
23 93 },
24 94 {
25 95 work:"front",
26   - name:"登记上班",
  96 + name:resources[sLanguage].registerWork,
27 97 cellSite:"2-1",
28 98 x6:[
29 99 ()=>({
... ... @@ -34,13 +104,13 @@ const BroadsideCardRender = () =&gt; {
34 104 },
35 105 {
36 106 work:"front",
37   - name:"班组交接",
  107 + name:resources[sLanguage].teamHandover,
38 108 cellSite:"4-1",
39 109 x6:[]
40 110 },
41 111 {
42 112 work:"front",
43   - name:"计划任务",
  113 + name:resources[sLanguage].planTask,
44 114 cellSite:"2-2",
45 115 x6:[
46 116 ()=>({
... ... @@ -52,7 +122,7 @@ const BroadsideCardRender = () =&gt; {
52 122  
53 123 {
54 124 work:"centre",
55   - name:"生产执行",
  125 + name:resources[sLanguage].productionExec,
56 126 cellSite:"2-2",
57 127 x6:[
58 128 ()=>({
... ... @@ -63,27 +133,27 @@ const BroadsideCardRender = () =&gt; {
63 133 source: { x: getOffset('centre-2-2' , 'x-domStart') , y: getOffset('centre-2-2' , 'y-domCenter') },
64 134 target: { x: getOffset('centre-1-1' , 'x-domEnd') , y: getOffset('centre-1-1' , 'y-domCenter') },
65 135 vertices: [
66   - {
67   - x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-1' , 'x-domEnd'))/2),
68   - y: getOffset('centre-2-2' , 'y-domCenter')
  136 + {
  137 + x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-1' , 'x-domEnd'))/2),
  138 + y: getOffset('centre-2-2' , 'y-domCenter')
69 139 },
70   - {
71   - x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-1' , 'x-domEnd'))/2),
  140 + {
  141 + x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-1' , 'x-domEnd'))/2),
72 142 y: getOffset('centre-1-1' , 'y-domCenter')
73 143 },
74 144 ],
75 145 }),
76 146 ()=>({
77   - source: {
78   - x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-2' , 'x-domEnd'))/2) ,
79   - y: getOffset('centre-1-2' , 'y-domCenter')
  147 + source: {
  148 + x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-2' , 'x-domEnd'))/2) ,
  149 + y: getOffset('centre-1-2' , 'y-domCenter')
80 150 },
81 151 target: { x: getOffset('centre-1-2' , 'x-domEnd') , y: getOffset('centre-1-2' , 'y-domCenter') },
82 152 }),
83 153 ()=>({
84   - source: {
85   - x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-3' , 'x-domEnd'))/2) ,
86   - y: getOffset('centre-1-3' , 'y-domCenter')
  154 + source: {
  155 + x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-3' , 'x-domEnd'))/2) ,
  156 + y: getOffset('centre-1-3' , 'y-domCenter')
87 157 },
88 158 target: { x: getOffset('centre-1-3' , 'x-domEnd') , y: getOffset('centre-1-3' , 'y-domCenter') },
89 159 }),
... ... @@ -91,13 +161,13 @@ const BroadsideCardRender = () =&gt; {
91 161 source: { x: getOffset('centre-2-2' , 'x-domStart') , y: getOffset('centre-2-2' , 'y-domCenter') },
92 162 target: { x: getOffset('centre-1-4' , 'x-domEnd') , y: getOffset('centre-1-4' , 'y-domCenter') },
93 163 vertices: [
94   - {
95   - x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-4' , 'x-domEnd'))/2),
96   - y: getOffset('centre-2-2' , 'y-domCenter')
  164 + {
  165 + x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-4' , 'x-domEnd'))/2),
  166 + y: getOffset('centre-2-2' , 'y-domCenter')
97 167 },
98   - {
99   - x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-4' , 'x-domEnd'))/2) ,
100   - y: getOffset('centre-1-4' , 'y-domCenter')
  168 + {
  169 + x: getOffset('centre-2-2' , 'x-domStart') - ((getOffset('centre-2-2' , 'x-domStart') - getOffset('centre-1-4' , 'x-domEnd'))/2) ,
  170 + y: getOffset('centre-1-4' , 'y-domCenter')
101 171 },
102 172 ],
103 173 })
... ... @@ -106,31 +176,31 @@ const BroadsideCardRender = () =&gt; {
106 176  
107 177 {
108 178 work:"centre",
109   - name:"质量巡检",
  179 + name:resources[sLanguage].qualityInspection,
110 180 cellSite:"1-1",
111 181 x6:[]
112 182 },
113 183 {
114 184 work:"centre",
115   - name:"工艺巡检",
  185 + name:resources[sLanguage].processInspection,
116 186 cellSite:"1-2",
117 187 x6:[]
118 188 },
119 189 {
120 190 work:"centre",
121   - name:"设备巡检",
  191 + name:resources[sLanguage].equipmentInspection,
122 192 cellSite:"1-3",
123 193 x6:[]
124 194 },
125 195 {
126 196 work:"centre",
127   - name:"拆合板",
  197 + name:resources[sLanguage].disassembleBoard,
128 198 cellSite:"1-4",
129 199 x6:[]
130 200 },
131 201 {
132 202 work:"centre",
133   - name:"当前任务",
  203 + name:resources[sLanguage].currentTask,
134 204 cellSite:"2-1",
135 205 x6:[
136 206 ()=>({
... ... @@ -139,10 +209,10 @@ const BroadsideCardRender = () =&gt; {
139 209 })
140 210 ]
141 211 },
142   -
  212 +
143 213 {
144 214 work:"centre",
145   - name:"任务完工",
  215 + name:resources[sLanguage].taskCompletion,
146 216 cellSite:"2-3",
147 217 x6:[
148 218 ()=>({
... ... @@ -153,7 +223,7 @@ const BroadsideCardRender = () =&gt; {
153 223 },
154 224 {
155 225 work:"centre",
156   - name:"托盘扫码",
  226 + name:resources[sLanguage].trayScan,
157 227 cellSite:"3-2",
158 228 x6:[
159 229 ()=>({
... ... @@ -164,7 +234,7 @@ const BroadsideCardRender = () =&gt; {
164 234 },
165 235 {
166 236 work:"centre",
167   - name:"托盘下料",
  237 + name:resources[sLanguage].trayUnloading,
168 238 cellSite:"3-3",
169 239 x6:[
170 240 ()=>({
... ... @@ -180,7 +250,7 @@ const BroadsideCardRender = () =&gt; {
180 250  
181 251 {
182 252 work:"later",
183   - name:"完工清场",
  253 + name:resources[sLanguage].completionClearance,
184 254 cellSite:"2-1",
185 255 x6:[
186 256 ()=>({
... ... @@ -191,7 +261,7 @@ const BroadsideCardRender = () =&gt; {
191 261 },
192 262 {
193 263 work:"later",
194   - name:"班组报工",
  264 + name:resources[sLanguage].teamReport,
195 265 cellSite:"3-1",
196 266 x6:[
197 267 ()=>({
... ... @@ -202,7 +272,7 @@ const BroadsideCardRender = () =&gt; {
202 272 },
203 273 {
204 274 work:"later",
205   - name:"登记下班",
  275 + name:resources[sLanguage].registerOffWork,
206 276 cellSite:"4-1",
207 277 x6:[
208 278 ()=>({
... ... @@ -262,7 +332,7 @@ const BroadsideCardRender = () =&gt; {
262 332  
263 333 // 渲染x6线条
264 334 const lineRender = () =>{
265   -
  335 +
266 336 const graph = new window.X6.Graph({
267 337 container:document.getElementById('container'),
268 338 width: document.querySelector('#flowBody').offsetWidth,
... ... @@ -298,7 +368,7 @@ const BroadsideCardRender = () =&gt; {
298 368 },
299 369 }
300 370 })
301   -
  371 +
302 372 })
303 373  
304 374  
... ... @@ -319,8 +389,8 @@ const BroadsideCardRender = () =&gt; {
319 389 return (
320 390 <div
321 391 key={'k'+ri}
322   - onClick={()=>itemClickEvent(rows)}
323   - className="cellBox hasShow"
  392 + onClick={()=>itemClickEvent(rows)}
  393 + className="cellBox hasShow"
324 394 cell={cell}>
325 395 {rows.name}
326 396 {/* {rows.cellSite} */}
... ... @@ -338,10 +408,10 @@ const BroadsideCardRender = () =&gt; {
338 408 <div className="colExpire">
339 409 {
340 410 newList.map((e,i)=>(
341   - <div
342   - key={'i'+i}
343   - onClick={()=>itemClickEvent(e)}
344   - className="cellBox hasShow"
  411 + <div
  412 + key={'i'+i}
  413 + onClick={()=>itemClickEvent(e)}
  414 + className="cellBox hasShow"
345 415 cell={`${work}-${e.cellSite}`}>
346 416 {e.name}
347 417 {/* {e.cellSite} */}
... ... @@ -377,7 +447,7 @@ const BroadsideCardRender = () =&gt; {
377 447 <Spin spinning={loading} wrapperClassName={"loadingBox"}>
378 448 <div id="flowBody" className="flowBody">
379 449 <div className="workFront">
380   - <div className="texts">作业前</div>
  450 + <div className="texts">{resources[sLanguage].beforeWork}</div>
381 451 <div className="boxs">
382 452 {
383 453 itemRender(2,'front')
... ... @@ -385,7 +455,7 @@ const BroadsideCardRender = () =&gt; {
385 455 </div>
386 456 </div>
387 457 <div className="workCentre">
388   - <div className="texts">作业中</div>
  458 + <div className="texts">{resources[sLanguage].working}</div>
389 459 <div className="boxs">
390 460 {
391 461 itemRender(3,'centre')
... ... @@ -393,12 +463,12 @@ const BroadsideCardRender = () =&gt; {
393 463 </div>
394 464 </div>
395 465 <div className="workLater">
396   - <div className="texts">作业后</div>
  466 + <div className="texts">{resources[sLanguage].afterWork}</div>
397 467 <div className="boxs">
398 468 {
399 469 itemRender(1,'later')
400 470 }
401   - </div>
  471 + </div>
402 472 </div>
403 473 </div>
404 474 <div id="container"></div>
... ...
src/mes/operationGuide/index.js
... ... @@ -6,7 +6,7 @@ import BroadsideCard from &quot;./component/BroadsideCard&quot;;
6 6 const OperationGuide = props => {
7 7 return (
8 8 <div className={styles.operationGuide}>
9   - <FlowChart />
  9 + <FlowChart {...props} />
10 10 <BroadsideCard {...props} />
11 11 </div>
12 12 );
... ...
src/mes/productionExec/productionExecMain/index.js
... ... @@ -36,6 +36,12 @@ const list = [
36 36  
37 37 const useProductionExecMainEvent = props => {
38 38 const { formData = [] } = props;
  39 + const noProduction= commonFunc.showLocalMessage(props, 'noProduction', '暂无生产执行数据,请先开工一条任务!');
  40 +
  41 + const waitWorkLoading = commonFunc.showLocalMessage(props, 'waitWorkLoading', '等待工单数据加载中...');
  42 +
  43 + const productionLoading = commonFunc.showLocalMessage(props, 'productionLoading', '生产执行数据加载中...');
  44 +
39 45 const [refreshCount, setRefreshCount] = useState(0);
40 46 const [pageloading, setPagesLoading] = useState(true);
41 47  
... ... @@ -44,10 +50,10 @@ const useProductionExecMainEvent = props =&gt; {
44 50 const { sSrcSlaveId, iInterface: iInterfaceOld } = workOrderInfoRowData;
45 51 const bNoWorkOrderInfo = props.bFinish1 && !sSrcSlaveId;
46 52 const pageloadingMsg = sSrcSlaveId
47   - ? "生产执行数据加载中..."
  53 + ? productionLoading
48 54 : props.bFinish1
49   - ? "暂无生产执行数据,请先开工一条任务!"
50   - : "等待工单数据加载中...";
  55 + ? noProduction
  56 + : waitWorkLoading;
51 57  
52 58 const { app } = props;
53 59 const { userinfo = {} } = app;
... ... @@ -395,8 +401,9 @@ const useProductionExecMainEvent = props =&gt; {
395 401  
396 402 const ProductionExecMain = baseProps => {
397 403 const bStartWork = commonUtils.getAppData("userinfo", "bStartWork");
  404 + const workFirst = commonFunc.showLocalMessage(baseProps, 'workFirst', '请先上班后再操作');
398 405 if (!bStartWork) {
399   - return <div className={styles.noStartWork}>请先上班后再操作!</div>;
  406 + return <div className={styles.noStartWork}>{workFirst}</div>;
400 407 }
401 408  
402 409 const props = useProductionExecMainEvent(useCommonBase(baseProps));
... ... @@ -939,6 +946,9 @@ const ProductionExecContent0 = props =&gt; {
939 946 config.gdsconfigformslave.find(
940 947 item => item.sControlName === sControlName
941 948 ) || {};
  949 + if (!btnConfig.bVisible) {
  950 + btnConfig.style = { display: "none" };
  951 + }
942 952 return {
943 953 ...btnConfig,
944 954 disabled: props.onGetBtnStatus(tableName, btnConfig),
... ...
src/mes/productionExec/quickSwitchTabComponent/index.js
... ... @@ -63,7 +63,7 @@ const QuickSwitchTabComponent = baseProps =&gt; {
63 63 }
64 64 }, []);
65 65  
66   - const list = ["生产执行", "质量巡检", "拼版图", "产品图", "报工任务"];
  66 + let list = ["生产执行", "质量巡检", "拼版图", "产品图", "报工任务"];
67 67 const listId = [
68 68 "12710101117087374661080",
69 69 "12710101117089395856660",
... ... @@ -71,6 +71,37 @@ const QuickSwitchTabComponent = baseProps =&gt; {
71 71 "",
72 72 "12710101117087404588200"
73 73 ];
  74 + function translateList(language) {
  75 + // 原始中文列表
  76 + const list = ["生产执行", "质量巡检", "拼版图", "产品图", "报工任务"];
  77 +
  78 + // 定义多语言映射
  79 + const translations = {
  80 + sEnglish: {
  81 + "生产执行": "Production Execution",
  82 + "质量巡检": "Quality Inspection",
  83 + "拼版图": "Assembly Drawing",
  84 + "产品图": "Product Drawing",
  85 + "报工任务": "Work Reporting Task"
  86 + },
  87 + sBig5: {
  88 + "生产执行": "生產執行",
  89 + "质量巡检": "質量巡檢",
  90 + "拼版图": "拼版圖",
  91 + "产品图": "產品圖",
  92 + "报工任务": "報工任務"
  93 + }
  94 + };
  95 +
  96 + // 根据语言设置进行转换
  97 + if (translations[language]) {
  98 + return list.map(item => translations[language][item] || item);
  99 + }
  100 + // 默认返回原始列表
  101 + return list;
  102 + }
  103 + const sLanguage = props.app.userinfo.sLanguage || 'sChinese';
  104 + list = translateList(sLanguage);
74 105  
75 106 return (
76 107 <div className={styles.quickSwitchTabComponent} ref={ref}>
... ...
src/mes/queryTracking/index.js
... ... @@ -2,7 +2,7 @@
2 2 * @Author: varcms
3 3 * @LastEditors: varcms
4 4 * @Date: 2025-06-04 11:06:14
5   - * @Description:
  5 + * @Description:
6 6 */
7 7 import React from "react";
8 8 import styles from "./index.less";
... ...
src/mes/scheduledTasks/machineTasks/index.js
... ... @@ -4,1161 +4,1115 @@
4 4 * @Date: 2024-02-28 9:55:04
5 5 * @Description: 计划任务 ---- 机台任务
6 6 */
7   - import React, { useEffect, useRef, useState } from "react";
8   - import moment from "moment";
9   - import {
10   - Carousel,
11   - Col,
12   - Row,
13   - Button,
14   - Input,
15   - Modal,
16   - Space,
17   - Dropdown,
18   - message,
19   - Tooltip
20   - } from "antd";
21   - import { SettingTwoTone } from "@ant-design/icons";
22   - import * as commonFunc from "@/components/Common/commonFunc";
23   - import * as commonUtils from "@/utils/utils";
24   - import * as commonConfig from "@/utils/config";
25   - import * as commonBusiness from "@/components/Common/commonBusiness";
26   - import * as commonServices from "@/services/services";
27   - import useCommonBase from "@/components/Common/CommonHooks/useCommonBase";
28   - import StaticEditTable from "@/components/Common/CommonTable";
29   - import CommonViewTable from "@/components/Common/CommonViewTable";
30   - import styles from "./index.less";
31   - import taskInfoIcon from "../assets/taskInfo2.png";
32   - import statusIcon from "../assets/status.png";
33   - import taskIcon from "../assets/task.png";
34   - import timeIcon from "../assets/time.png";
35   - import { handleOeeBtnEent } from "./common/handlePause";
36   - import { operationFetch } from "../../productionExec/productionExecMain/operationFetch";
37   -
38   - // 业务层
39   - const useInfoEvent = props => {
40   - const { formData } = props;
41   - const [refreshCount, setRefreshCount] = useState(0);
42   -
43   - useEffect(
44   - async () => {
45   - if (commonUtils.isNotEmptyArr(formData)) {
46   - const colunmData = handleGetColumnData(formData, true);
47   - const result = await handleGetData(formData, true);
48   - const addState = {
49   - ...colunmData,
50   - ...result
51   - };
52   - props.onSaveState(addState);
53   - }
54   - },
55   - [formData, refreshCount]
56   - );
57   -
58   - // 获取表头数据
59   - const handleGetColumnData = (formData = [], isWait) => {
60   - let addState = {};
61   - for (let i = 0; i < formData.length; i++) {
62   - const config = formData[i];
63   - const column = commonFunc.getHeaderConfig(config);
64   - addState = {
65   - ...addState,
66   - [`slave${i}Column`]: column,
67   - [`slave${i}Config`]: config
68   - };
69   - }
70   - if (isWait) {
71   - return addState;
72   - } else {
73   - props.onSaveState(addState);
74   - }
75   - };
76   -
77   - // 获取数据集
78   - const handleGetData = async (formData = [], isWait, filter) => {
79   - let addState = {};
80   - for (let i = 0; i < formData.length; i++) {
81   - const config = formData[i];
82   - if (!config) continue;
83   -
84   - const conditonValues = props.onGetSqlConditionValues(config);
85   -
86   - if (config.sSqlStr === "Sp_OEE_ProductionReport") {
87   - conditonValues.sMachineId_s_pro = props.app.sMachineNameSId;
88   - }
89   -
90   - // 前期生产或反馈问题表必须有非空过滤条件
91   - if (
92   - (i === 1 && Object.values(conditonValues).includes("")) ||
93   - Object.values(conditonValues).includes(undefined)
94   - ) {
95   - continue;
96   - }
97   -
98   - const bFilter = [];
99   - if (filter) {
100   - Object.keys(filter).forEach(key => {
101   - bFilter.push({
102   - bFilterName: key,
103   - bFilterCondition: "like",
104   - bFilterValue: filter[key]
105   - });
106   - });
107   - }
108   -
109   - const result =
110   - (await props.onGetDataSet({
111   - name: `slave${i}`,
112   - configData: config,
113   - condition: {
114   - bFilter,
115   - sSqlCondition: { ...conditonValues }
116   - },
117   - isWait: true
118   - })) || {};
119   - props.setTempRef(result);
120   - addState = { ...addState, ...result };
121   - }
122   - props.setTempRef({}, true);
123   - if (isWait) {
124   - return addState;
125   - } else {
126   - props.onSaveState(addState);
127   - }
  7 +import React, { useEffect, useRef, useState } from "react";
  8 +import moment from "moment";
  9 +import {
  10 + Carousel,
  11 + Col,
  12 + Row,
  13 + Button,
  14 + Input,
  15 + Modal,
  16 + Space,
  17 + Dropdown,
  18 + message,
  19 + Tooltip
  20 +} from "antd";
  21 +import { SettingTwoTone } from "@ant-design/icons";
  22 +import * as commonFunc from "@/components/Common/commonFunc";
  23 +import * as commonUtils from "@/utils/utils";
  24 +import * as commonConfig from "@/utils/config";
  25 +import * as commonBusiness from "@/components/Common/commonBusiness";
  26 +import * as commonServices from "@/services/services";
  27 +import useCommonBase from "@/components/Common/CommonHooks/useCommonBase";
  28 +import StaticEditTable from "@/components/Common/CommonTable";
  29 +import styles from "./index.less";
  30 +import taskInfoIcon from "../assets/taskInfo2.png";
  31 +import statusIcon from "../assets/status.png";
  32 +import taskIcon from "../assets/task.png";
  33 +import timeIcon from "../assets/time.png";
  34 +import { handleOeeBtnEent } from "./common/handlePause";
  35 +import { operationFetch } from "../../productionExec/productionExecMain/operationFetch";
  36 +
  37 +// 业务层
  38 +const useInfoEvent = props => {
  39 + const { formData } = props;
  40 + const [refreshCount, setRefreshCount] = useState(0);
  41 +
  42 + useEffect(
  43 + async () => {
  44 + if (commonUtils.isNotEmptyArr(formData)) {
  45 + const colunmData = handleGetColumnData(formData, true);
  46 + const result = await handleGetData(formData, true);
  47 + const addState = {
  48 + ...colunmData,
  49 + ...result
  50 + };
  51 + props.onSaveState(addState);
  52 + }
  53 + },
  54 + [formData, refreshCount]
  55 + );
  56 +
  57 + // 获取表头数据
  58 + const handleGetColumnData = (formData = [], isWait) => {
  59 + let addState = {};
  60 + for (let i = 0; i < formData.length; i++) {
  61 + const config = formData[i];
  62 + const column = commonFunc.getHeaderConfig(config);
  63 + addState = {
  64 + ...addState,
  65 + [`slave${i}Column`]: column,
  66 + [`slave${i}Config`]: config
128 67 };
129   -
130   - // 查询
131   - const handleSearch = sWorkOrderNo => {
132   - handleGetData([formData[0]], false, {
133   - sWorkOrderNo
  68 + }
  69 + if (isWait) {
  70 + return addState;
  71 + } else {
  72 + props.onSaveState(addState);
  73 + }
  74 + };
  75 +
  76 + // 获取数据集
  77 + const handleGetData = async (formData = [], isWait, filter) => {
  78 + let addState = {};
  79 + for (let i = 0; i < formData.length; i++) {
  80 + const config = formData[i];
  81 + if (!config) continue;
  82 +
  83 + const conditonValues = props.onGetSqlConditionValues(config);
  84 +
  85 + if (config.sSqlStr === "Sp_OEE_ProductionReport") {
  86 + conditonValues.sMachineId_s_pro = props.app.sMachineNameSId;
  87 + }
  88 +
  89 + // 前期生产或反馈问题表必须有非空过滤条件
  90 + if (
  91 + (i === 1 && Object.values(conditonValues).includes("")) ||
  92 + Object.values(conditonValues).includes(undefined)
  93 + ) {
  94 + continue;
  95 + }
  96 +
  97 + const bFilter = [];
  98 + if (filter) {
  99 + Object.keys(filter).forEach(key => {
  100 + bFilter.push({
  101 + bFilterName: key,
  102 + bFilterCondition: "like",
  103 + bFilterValue: filter[key]
  104 + });
134 105 });
135   - };
136   -
137   - // 开工事件
138   - const handleStartWork = async params => {
139   - const { sModelsId, token, app } = props;
140   - const { name, record, config, tableData, iFlag, pauseValue } = params;
141   - const { sMachineId, sId, sSlaveId } = record;
142   -
143   - // /* 若设置了禁止跳单 选择数据不是第一条时进行提示 */
144   - // const iIndex = app.systemData.findIndex(item => item.sName === "CkxNoSkip");
145   - // if (iIndex > -1) {
146   - // const sValue = app.systemData[iIndex].sValue;
147   - // if (sValue === "1") {
148   - // /* 如果设置了进制跳单 */
149   - // const indexFirst = tableData.findIndex(
150   - // item => sId === item.sId || sSlaveId === item.sSlaveId
151   - // );
152   - // if (indexFirst > 0) {
153   - // message.warn("禁止跳单!");
154   - // return;
155   - // }
156   - // }
157   - // }
158   - // // 验证是否单据是否被使用
159   - // const dataUrl = `${
160   - // commonConfig.server_host
161   - // }bill/billCopyToCheckWork?sModelsId=${sModelsId}`;
162   - // const values = { sMachineId };
163   - // const dataReturn = (await commonServices.postValueService(
164   - // token,
165   - // values,
166   - // dataUrl
167   - // )).data;
168   - // if (dataReturn.code !== 1) {
169   - // props.getServiceError(dataReturn);
170   - // return;
171   - // }
172   -
173   - // 单据可以使用
174   - const { startWorkConfig = {} } = config;
175   - const { sAssignField } = startWorkConfig;
176   - const allTableData = {
177   - [name]: record
178   - };
179   - let rowData = commonFunc.getDefaultData(config, allTableData); // 取默认值
180   - rowData = {
181   - ...rowData,
182   - ...commonFunc.getAssignFieldValue(sAssignField, record, allTableData),
183   - handleType: "add",
184   - sId: commonUtils.createSid(),
185   - sTeamId: app.sTeamNameSId,
186   - sMachineId: app.sMachineNameSId,
187   - sParentId: record.sId,
188   - tCreateDate: new Date()
189   - };
190   -
191   - const valuesNew = {};
192   - valuesNew.data = [];
193   - valuesNew.data.push(
194   - commonBusiness.mergeData(name, "plc_machinedata", [rowData], [])
195   - );
196   -
197   - if ((iFlag || Object.is(iFlag, 0)) && valuesNew.data[0]) {
198   - valuesNew.data[0].iFlag = iFlag;
  106 + }
  107 +
  108 + const result =
  109 + (await props.onGetDataSet({
  110 + name: `slave${i}`,
  111 + configData: config,
  112 + condition: {
  113 + bFilter,
  114 + sSqlCondition: { ...conditonValues }
  115 + },
  116 + isWait: true
  117 + })) || {};
  118 + props.setTempRef(result);
  119 + addState = { ...addState, ...result };
  120 + }
  121 + props.setTempRef({}, true);
  122 + if (isWait) {
  123 + return addState;
  124 + } else {
  125 + props.onSaveState(addState);
  126 + }
  127 + };
  128 +
  129 + // 查询
  130 + const handleSearch = sWorkOrderNo => {
  131 + handleGetData([formData[0]], false, {
  132 + sWorkOrderNo
  133 + });
  134 + };
  135 +
  136 + // 开工事件
  137 + const handleStartWork = async params => {
  138 + const { sModelsId, token, app } = props;
  139 + const { name, record, config, tableData, iFlag, pauseValue } = params;
  140 + const { sMachineId, sId, sSlaveId } = record;
  141 +
  142 + // /* 若设置了禁止跳单 选择数据不是第一条时进行提示 */
  143 + // const iIndex = app.systemData.findIndex(item => item.sName === "CkxNoSkip");
  144 + // if (iIndex > -1) {
  145 + // const sValue = app.systemData[iIndex].sValue;
  146 + // if (sValue === "1") {
  147 + // /* 如果设置了进制跳单 */
  148 + // const indexFirst = tableData.findIndex(
  149 + // item => sId === item.sId || sSlaveId === item.sSlaveId
  150 + // );
  151 + // if (indexFirst > 0) {
  152 + // message.warn("禁止跳单!");
  153 + // return;
  154 + // }
  155 + // }
  156 + // }
  157 + // // 验证是否单据是否被使用
  158 + // const dataUrl = `${
  159 + // commonConfig.server_host
  160 + // }bill/billCopyToCheckWork?sModelsId=${sModelsId}`;
  161 + // const values = { sMachineId };
  162 + // const dataReturn = (await commonServices.postValueService(
  163 + // token,
  164 + // values,
  165 + // dataUrl
  166 + // )).data;
  167 + // if (dataReturn.code !== 1) {
  168 + // props.getServiceError(dataReturn);
  169 + // return;
  170 + // }
  171 +
  172 + // 单据可以使用
  173 + const { startWorkConfig = {} } = config;
  174 + const { sAssignField } = startWorkConfig;
  175 + const allTableData = {
  176 + [name]: record
  177 + };
  178 + let rowData = commonFunc.getDefaultData(config, allTableData); // 取默认值
  179 + rowData = {
  180 + ...rowData,
  181 + ...commonFunc.getAssignFieldValue(sAssignField, record, allTableData),
  182 + handleType: "add",
  183 + sId: commonUtils.createSid(),
  184 + sTeamId: app.sTeamNameSId,
  185 + sMachineId: app.sMachineNameSId,
  186 + sParentId: record.sId,
  187 + tCreateDate: new Date()
  188 + };
  189 +
  190 + const valuesNew = {};
  191 + valuesNew.data = [];
  192 + valuesNew.data.push(
  193 + commonBusiness.mergeData(name, "plc_machinedata", [rowData], [])
  194 + );
  195 +
  196 + if ((iFlag || Object.is(iFlag, 0)) && valuesNew.data[0]) {
  197 + valuesNew.data[0].iFlag = iFlag;
  198 + }
  199 +
  200 + if (pauseValue) {
  201 + valuesNew.data[0].sWorkOrderChangeMemo = pauseValue;
  202 + }
  203 +
  204 + const BtnSave = commonFunc.showMessage(
  205 + app.commonConst,
  206 + "BtnSave"
  207 + ); /* 保存 */
  208 + params.optName = BtnSave;
  209 + params.sClientType = "1";
  210 + const returnData = await commonBusiness.saveData({
  211 + token,
  212 + value: valuesNew,
  213 + sModelsId,
  214 + bMachineTask: true
  215 + });
  216 +
  217 + return returnData;
  218 + // if (commonUtils.isEmptyObject(returnData)) return;
  219 +
  220 + // props.onSaveState(
  221 + // {
  222 + // [`${name}SelectedRowKeys`]: [record.sId]
  223 + // },
  224 + // () => {
  225 + // props.dispatch({
  226 + // type: "app/saveGlobalData",
  227 + // payload: {
  228 + // currentStartWorkMachineTaskDataRow: rowData
  229 + // }
  230 + // });
  231 + // handleRefresh();
  232 + // setTimeout(() => {
  233 + // props.onChangeRouter({
  234 + // type: "name",
  235 + // path: ["生产执行", "生产执行"]
  236 + // });
  237 + // }, 500);
  238 + // }
  239 + // );
  240 + // this.props.onSaveCurrentState(slaveData, true, undefined, undefined, 1);
  241 + };
  242 +
  243 + // 更新工单状态
  244 + const handleUpdateStatus = async params => {
  245 + const { doWorkState, record } = params;
  246 +
  247 + const { sModelsId, app } = props;
  248 +
  249 + const value = {
  250 + plcMachinedata: record
  251 + };
  252 +
  253 + const url = `${
  254 + commonConfig.server_host
  255 + }oee/doUpdateStatus/${doWorkState}?sModelsId=${sModelsId}&sMachineId=${
  256 + record.sMachineId
  257 + }`;
  258 + const returnData = (await commonServices.postValueService(
  259 + app.token,
  260 + value,
  261 + url
  262 + )).data;
  263 +
  264 + if (returnData.code !== 1) {
  265 + props.getServiceError(returnData);
  266 + return false;
  267 + }
  268 +
  269 + return true;
  270 + };
  271 +
  272 + // 监听机台任务选中行变化
  273 + const { slave0SelectedRowKeys = [], slave0Data = [], sModelsId } = props;
  274 + useEffect(
  275 + () => {
  276 + if (!slave0Data.length) return;
  277 +
  278 + const globalData = commonUtils.convertStrToObj(
  279 + localStorage.xlybusinessglobalData
  280 + );
  281 + const { currentSelectedMachineTaskDataRow = {} } = globalData;
  282 +
  283 + // 当前选中行sId,默认取缓存数据
  284 + let currentSelectedRowKey = slave0SelectedRowKeys[0];
  285 + if (
  286 + !currentSelectedRowKey &&
  287 + sModelsId === currentSelectedMachineTaskDataRow?.sModelsId
  288 + ) {
  289 + currentSelectedRowKey = currentSelectedMachineTaskDataRow.sId;
  290 + }
  291 + if (!currentSelectedRowKey) {
  292 + currentSelectedRowKey = slave0Data[0].sId;
  293 + }
  294 +
  295 + // 默认选中第一行
  296 + if (!slave0SelectedRowKeys.length) {
  297 + props.onSaveState({
  298 + slave0SelectedRowKeys: [currentSelectedRowKey]
  299 + });
  300 + }
  301 +
  302 + // 将当前选中行保存到全局
  303 + props.dispatch({
  304 + type: "app/saveGlobalData",
  305 + payload: {
  306 + currentSelectedMachineTaskDataRow: {
  307 + ...(slave0Data.find(item => item.sId === currentSelectedRowKey) ||
  308 + {}),
  309 + sModelsId
  310 + }
199 311 }
200   -
201   - if (pauseValue) {
202   - valuesNew.data[0].sWorkOrderChangeMemo = pauseValue;
  312 + });
  313 +
  314 + // 前期生产或反馈问题数据根据机台任务选中行变化
  315 + handleGetData(["", formData[1]], false);
  316 + },
  317 + [slave0SelectedRowKeys[0], slave0Data.length]
  318 + );
  319 +
  320 + // 监听开工任务变化
  321 + useEffect(
  322 + () => {
  323 + if (commonUtils.isEmptyObject(props.slave0Data)) return;
  324 + const startRowData = props.slave0Data.find(item => item.iStar === 1);
  325 + if (!startRowData) return;
  326 + props.dispatch({
  327 + type: "app/saveGlobalData",
  328 + payload: {
  329 + currentStartWorkMachineTaskDataRow: startRowData
203 330 }
204   -
205   - const BtnSave = commonFunc.showMessage(
206   - app.commonConst,
207   - "BtnSave"
208   - ); /* 保存 */
209   - params.optName = BtnSave;
210   - params.sClientType = "1";
211   - const returnData = await commonBusiness.saveData({
212   - token,
213   - value: valuesNew,
214   - sModelsId,
215   - bMachineTask: true
216   - });
217   -
218   - return returnData;
219   - // if (commonUtils.isEmptyObject(returnData)) return;
220   -
221   - // props.onSaveState(
222   - // {
223   - // [`${name}SelectedRowKeys`]: [record.sId]
224   - // },
225   - // () => {
226   - // props.dispatch({
227   - // type: "app/saveGlobalData",
228   - // payload: {
229   - // currentStartWorkMachineTaskDataRow: rowData
230   - // }
231   - // });
232   - // handleRefresh();
233   - // setTimeout(() => {
234   - // props.onChangeRouter({
235   - // type: "name",
236   - // path: ["生产执行", "生产执行"]
237   - // });
238   - // }, 500);
239   - // }
240   - // );
241   - // this.props.onSaveCurrentState(slaveData, true, undefined, undefined, 1);
242   - };
243   -
244   - // 更新工单状态
245   - const handleUpdateStatus = async params => {
246   - const { doWorkState, record } = params;
247   -
248   - const { sModelsId, app } = props;
249   -
250   - const value = {
251   - plcMachinedata: record
252   - };
253   -
254   - const url = `${
255   - commonConfig.server_host
256   - }oee/doUpdateStatus/${doWorkState}?sModelsId=${sModelsId}&sMachineId=${
257   - record.sMachineId
258   - }`;
259   - const returnData = (await commonServices.postValueService(
260   - app.token,
261   - value,
262   - url
263   - )).data;
264   -
265   - if (returnData.code !== 1) {
266   - props.getServiceError(returnData);
267   - return false;
  331 + });
  332 + },
  333 + [JSON.stringify(props.slave0Data)]
  334 + );
  335 +
  336 + // 刷新页面
  337 + const handleRefresh = () => {
  338 + setRefreshCount(refreshCount + 1);
  339 + };
  340 +
  341 + const itemClickRef = useRef();
  342 +
  343 + // 开工、暂停事件
  344 + const handleTableBtnClick = async item => {
  345 + const { tableName, index, record, tableData, config, iFlag } = item;
  346 + const { showName } = config;
  347 + if (showName === "完工") {
  348 + Modal.confirm({
  349 + title: "温馨提示:",
  350 + content: <div>确认完工?</div>,
  351 + okText: "确认",
  352 + cancelText: "取消",
  353 + onOk() {
  354 + handleUpdateProductionplan({ item, iFlag: 4 });
268 355 }
269   -
270   - return true;
271   - };
272   -
273   - // 监听机台任务选中行变化
274   - const { slave0SelectedRowKeys = [], slave0Data = [], sModelsId } = props;
275   - useEffect(
276   - () => {
277   - if (!slave0Data.length) return;
278   -
279   - const globalData = commonUtils.convertStrToObj(
280   - localStorage.xlybusinessglobalData
281   - );
282   - const { currentSelectedMachineTaskDataRow = {} } = globalData;
283   -
284   - // 当前选中行sId,默认取缓存数据
285   - let currentSelectedRowKey = slave0SelectedRowKeys[0];
286   - if (
287   - !currentSelectedRowKey &&
288   - sModelsId === currentSelectedMachineTaskDataRow?.sModelsId
289   - ) {
290   - currentSelectedRowKey = currentSelectedMachineTaskDataRow.sId;
291   - }
292   - if (!currentSelectedRowKey) {
293   - currentSelectedRowKey = slave0Data[0].sId;
294   - }
295   -
296   - // 默认选中第一行
297   - if (!slave0SelectedRowKeys.length) {
298   - props.onSaveState({
299   - slave0SelectedRowKeys: [currentSelectedRowKey]
300   - });
301   - }
302   -
303   - // 将当前选中行保存到全局
304   - props.dispatch({
305   - type: "app/saveGlobalData",
306   - payload: {
307   - currentSelectedMachineTaskDataRow: {
308   - ...(slave0Data.find(item => item.sId === currentSelectedRowKey) ||
309   - {}),
310   - sModelsId
311   - }
312   - }
313   - });
314   -
315   - // 前期生产或反馈问题数据根据机台任务选中行变化
316   - handleGetData(["", formData[1]], false);
317   - },
318   - [slave0SelectedRowKeys[0], slave0Data.length]
319   - );
320   -
321   - // 监听开工任务变化
322   - useEffect(
323   - () => {
324   - if (commonUtils.isEmptyObject(props.slave0Data)) return;
325   - const startRowData = props.slave0Data.find(item => item.iStar === 1);
326   - if (!startRowData) return;
327   - props.dispatch({
328   - type: "app/saveGlobalData",
329   - payload: {
330   - currentStartWorkMachineTaskDataRow: startRowData
331   - }
332   - });
333   - },
334   - [JSON.stringify(props.slave0Data)]
335   - );
336   -
337   - // 刷新页面
338   - const handleRefresh = () => {
339   - setRefreshCount(pre => pre + 1);
340   - };
341   -
342   - const itemClickRef = useRef();
343   -
344   - // 开工、暂停事件
345   - const handleTableBtnClick = async item => {
346   - const { tableName, index, record, tableData, config, iFlag } = item;
347   - const { showName } = config;
348   - if (showName === "完工") {
  356 + });
  357 + return;
  358 + }
  359 + // const iStar = index === 0 ? 1 : 2;
  360 + const { iStar } = record;
  361 +
  362 + if (iStar === 1) {
  363 + // 如果只剩一条数据,询问是暂停还是完工
  364 + if (tableData.length === 1) {
  365 + const result = await new Promise(resolve => {
349 366 Modal.confirm({
350 367 title: "温馨提示:",
351   - content: <div>确认完工?</div>,
352   - okText: "确认",
353   - cancelText: "取消",
  368 + content: <div>请选择要变更的状态</div>,
  369 + okText: "完工",
  370 + cancelText: "暂停",
354 371 onOk() {
355   - handleUpdateProductionplan({ item, iFlag: 4 });
  372 + resolve(true);
  373 + },
  374 + onCancel() {
  375 + resolve(false);
356 376 }
357 377 });
  378 + });
  379 + if (result) {
  380 + // 走完工接口
  381 + handleUpdateProductionplan({ item, iFlag: 4 });
358 382 return;
359 383 }
360   - // const iStar = index === 0 ? 1 : 2;
361   - const { iStar } = record;
362   -
363   - if (iStar === 1) {
364   - // 如果只剩一条数据,询问是暂停还是完工
365   - if (tableData.length === 1) {
366   - const result = await new Promise(resolve => {
367   - Modal.confirm({
368   - title: "温馨提示:",
369   - content: <div>请选择要变更的状态</div>,
370   - okText: "完工",
371   - cancelText: "暂停",
372   - onOk() {
373   - resolve(true);
374   - },
375   - onCancel() {
376   - resolve(false);
377   - }
378   - });
379   - });
380   - if (result) {
381   - // 走完工接口
382   - handleUpdateProductionplan({ item, iFlag: 4 });
383   - return;
384   - }
385   - }
386   -
387   - // 开工中,走暂停接口
  384 + }
  385 +
  386 + // 开工中,走暂停接口
  387 + props.onSaveState({
  388 + taskConfirmModalVisible: true,
  389 + taskConfirmModalMsg: "请填写暂停原因",
  390 + tempTaskId: record.sId,
  391 + bPauseOnly: true,
  392 + pauseCallback: pauseValue => {
388 393 props.onSaveState({
389   - taskConfirmModalVisible: true,
390   - taskConfirmModalMsg: "请选择暂停原因",
391   - tempTaskId: record.sId,
392   - bPauseOnly: true,
393   - pauseCallback: pauseValue => {
394   - props.onSaveState({
395   - taskConfirmModalVisible: false,
396   - taskConfirmModalMsg: "",
397   - tempTaskId: "",
398   - bPauseOnly: false,
399   - pauseCallback: null
400   - });
401   - handleUpdateProductionplan({ item, iFlag: 3, pauseValue });
402   - }
  394 + taskConfirmModalVisible: false,
  395 + taskConfirmModalMsg: "",
  396 + tempTaskId: "",
  397 + bPauseOnly: false,
  398 + pauseCallback: null
403 399 });
404   - } else if (iStar === 2 || iStar === 3) {
405   - // 暂停中,走开工接口
406   - const dataReturn = await handleStartWork(item);
407   - const { code, msg } = dataReturn;
408   - if (code === 1) {
409   - // 成功开工
410   - itemClickRef.current = null;
411   - message.success(dataReturn.msg);
412   - if (props.taskConfirmModalVisible) {
413   - props.onSaveState({
414   - taskConfirmModalVisible: false,
415   - taskConfirmModalMsg: "",
416   - tempTaskId: ""
417   - });
418   - }
419   - props.onChangeRouter({
420   - type: "name",
421   - path: ["生产执行", "生产执行"]
422   - });
423   - } else if (code === -7) {
424   - // 如果有开工中的任务,即接口返回-7,弹出确认窗体
425   - itemClickRef.current = { data: item };
426   - props.onSaveState({
427   - taskConfirmModalVisible: true,
428   - taskConfirmModalMsg: msg,
429   - tempTaskId: record.sId
430   - });
431   - } else {
432   - // 报错
433   - message.error(msg);
434   - }
435   - }
436   - };
437   -
438   - // 更新机台状态
439   - const handleUpdateProductionplan = async ({ item, iFlag, pauseValue }) => {
440   - const { app } = props;
441   - const { sId } = item.record;
442   - const { token } = app;
443   - const url = `${
444   - commonConfig.server_host
445   - }oee/updateProductionplan/${sId}/${iFlag}${
446   - pauseValue
447   - ? `?sWorkOrderChangeMemo=${encodeURIComponent(pauseValue)}`
448   - : ""
449   - }`;
450   - const dataReturn = (await commonServices.getService(token, url)).data;
451   - if (dataReturn.code === 1) {
452   - dataReturn.msg && message.success(dataReturn.msg, 3);
453   - handleRefresh();
454   - } else {
455   - message.error(dataReturn.msg, 3);
  400 + handleUpdateProductionplan({ item, iFlag: 3, pauseValue });
456 401 }
457   - };
458   -
459   - return {
460   - ...props,
461   - // 其他对象
462   - itemClickRef,
463   - onSearch: handleSearch,
464   - onStartWork: handleStartWork, // 开工事件
465   - onRefresh: handleRefresh, // 刷新页面
466   - onTableBtnClick: handleTableBtnClick, // 开工、暂停事件
467   - onUpdateProductionplan: handleUpdateProductionplan // 更新机台状态
468   - };
469   - };
470   -
471   - /**
472   - * 暂停按钮
473   - * @param {*} params
474   - */
475   - const handlePause = async params => {
476   - const { item, props } = params;
477   - const { record, config } = item;
478   - await operationFetch(
479   - { ...props, workOrderInfoData: [record] },
480   - config,
481   - config.sName || "fileError"
482   - );
483   - await handleOeeBtnEent({ props, item });
484   - };
485   -
486   - const MachineTasks = baseProps => {
487   - const props = useInfoEvent(useCommonBase({ ...baseProps }));
488   - const {
489   - app,
490   - slave0Config,
491   - slave1Column,
492   - slave1Data = [],
493   - slave2Column,
494   - slave2Data = []
495   - } = props;
496   -
497   - const bStartWork = commonUtils.getAppData("userinfo", "bStartWork");
498   -
499   - const [isTableLoading, setTableLoading] = useState(false);
500   -
501   - // const BtnTableCopyTo.startWork
502   - // 开工按钮配置
503   - const startWorkConfig =
504   - slave0Config?.gdsconfigformslave?.find(
505   - item => item.sControlName === "BtnTableCopyTo.startWork"
506   - ) || {};
507   - const pauseWorkConfig =
508   - slave0Config?.gdsconfigformslave?.find(
509   - item => item.sControlName === "BtnTableCopyTo.pauseWork"
510   - ) || {};
511   -
512   - // 表格业务
513   - const [sSrcNo, setSSrcNo] = useState("");
514   - // 顶部表格配置
515   - const tableProps = {
516   - ...commonBusiness.getTableTypes("slave0", props),
517   - tableProps: {
518   - onChange: () => {},
519   - loading: isTableLoading
520   - },
521   - tableBtnsConfig: params => {
522   - const { record, index } = params;
523   - const { iStar } = record;
524   - // const iStar = index === 0 ? 1 : 2;
525   -
526   - // const bStart = iStar === 1;
527   - // const bPause = iStar === 2;
528   -
529   - // 1 :开工状态(显示暂停) 2: 暂停状态(显示开工) 3: 完工状态(显示完工,灰色)
530   - // 开工:开工接口(现在)1:正常, -7:有开工,要有提示, -1: 错误提示
531   - // -7 :完工: iFlag:3 (完工上一条) 暂停:iFlag:2 (暂停上一条)
532   - // 暂停:新接口
533   -
534   - let showName, btnBgColor, sDefault;
535   - if (iStar === 1) {
536   - showName = "暂停";
537   - btnBgColor = "#FAAD14";
538   - } else if (iStar === 2 || iStar === 3) {
539   - showName = "开工";
540   - btnBgColor = "#1890FF";
541   - } else {
542   - showName = "完工";
543   - btnBgColor = "#AAA";
544   - sDefault = "${false}";
545   - }
546   -
547   - if (!bStartWork) {
548   - sDefault = "${false}";
549   - }
550   -
551   - return [
552   - { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig },
553   - { showName: "完工", btnBgColor: "#1890FF", sDefault }
554   - ];
555   -
556   - // return [
557   - // {
558   - // ...startWorkConfig,
559   - // showName: "开工",
560   - // btnBgColor: bStart ? "#1890FF" : "#AAA"
561   - // },
562   - // {
563   - // ...pauseWorkConfig,
564   - // showName: "暂停",
565   - // btnBgColor: bPause ? "#FAAD14" : "#AAA"
566   - // }
567   - // ];
568   - },
569   - onTableBtnClick: item => {
570   - props.onTableBtnClick(item);
571   - return;
572   - // 通用按钮操作
573   - // props.onTableBtnClick(item);
574   - const { tableName, index, record, tableData, config } = item;
575   - const { iStar } = record;
576   - const { showName } = config;
577   - if (iStar === 1 && showName === "开工") {
578   - setTableLoading(true);
579   - props.onStartWork(item).finally(() => {
580   - setTableLoading(false);
581   - });
582   - } else if (iStar === 2 && showName === "暂停") {
583   - setTableLoading(true);
584   - handlePause({ item, props }).finally(() => {
585   - setTableLoading(false);
586   - props.onRefresh();
587   - });
588   - }
589   - },
590   - tableBtnsWidth: "190px",
591   - fixedHeight: "335px"
592   - };
593   - // 全部按钮事件
594   - const tableAll = () => {
595   - setSSrcNo("");
596   - props.onSearch();
597   - };
598   - // 查询按钮事件
599   - const tableQuery = () => {
600   - props.onSearch(sSrcNo);
601   - };
602   -
603   - // 前期生产或反馈问题业务
604   - const [issueType, setIssueType] = useState(4);
605   - const issueObj = slave1Column?.reduce((acc, item) => {
606   - const chineseKey = item.title.replace(/[0-9]/g, "");
607   - if (acc[chineseKey]) {
608   - acc[chineseKey].push(item);
609   - } else {
610   - acc[chineseKey] = [item];
  402 + });
  403 + } else if (iStar === 2 || iStar === 3) {
  404 + // 暂停中,走开工接口
  405 + const dataReturn = await handleStartWork(item);
  406 + const { code, msg } = dataReturn;
  407 + if (code === 1) {
  408 + // 成功开工
  409 + itemClickRef.current = null;
  410 + message.success(dataReturn.msg);
  411 + if (props.taskConfirmModalVisible) {
  412 + props.onSaveState({
  413 + taskConfirmModalVisible: false,
  414 + taskConfirmModalMsg: "",
  415 + tempTaskId: ""
  416 + });
611 417 }
612   - return acc;
613   - }, {});
614   -
615   - let issue = [];
616   -
617   - if (issueObj) {
618   - issue = Object.keys(issueObj)?.map((key, i) => {
619   - return { name: key, items: issueObj[key], id: i };
  418 + props.onChangeRouter({
  419 + type: "name",
  420 + path: ["生产执行", "生产执行"]
  421 + });
  422 + } else if (code === -7) {
  423 + // 如果有开工中的任务,即接口返回-7,弹出确认窗体
  424 + itemClickRef.current = { data: item };
  425 + props.onSaveState({
  426 + taskConfirmModalVisible: true,
  427 + taskConfirmModalMsg: msg,
  428 + tempTaskId: record.sId
620 429 });
  430 + } else {
  431 + // 报错
  432 + message.error(msg);
621 433 }
622   -
623   - const component = id => {
624   - if (issue?.length > 0) {
625   - return (
626   - <div className="marginTop componentBox">
627   - {issue[id].items.map(item => (
628   - <p>
629   - <span>{item.title}:</span>
630   - {slave1Data[0] ? (
631   - <Tooltip
632   - placement="topLeft"
633   - title={
634   - <span style={{ fontSize: 20 }}>
635   - {slave1Data[0][item.dataIndex]}
636   - </span>
637   - }
638   - >
639   - <span>{slave1Data[0][item.dataIndex]}</span>
640   - </Tooltip>
641   - ) : (
642   - ""
643   - )}
644   - </p>
645   - ))}
646   - </div>
647   - );
648   - }
649   - };
650   -
651   - const [carouselData, setCarouselData] = useState([
652   - {
653   - title: "暂无通告",
654   - content: "暂无通告",
655   - id: 999
656   - }
657   - ]);
658   -
659   - const { slave3Data = [] } = props;
660   -
661   - useEffect(
662   - () => {
663   - if (!slave3Data.length) return;
664   -
665   - const tempData = slave3Data.map((item, index) => ({
666   - title: `车间通告${index + 1}`,
667   - content: item.sNoticeMemo,
668   - id: index
669   - }));
670   -
671   - setCarouselData(tempData);
672   - },
673   - [slave3Data.length]
674   - );
675   -
676   - // 设备信息业务
677   - const slave2OneData = slave2Data[0] || {};
678   - const { countMapJsON } = slave2OneData;
679   - const countMap = commonUtils.convertStrToObj(countMapJsON);
680   -
681   - const taskInfoData = {};
682   - slave2Column?.forEach(obj => {
683   - taskInfoData[`${obj.dataIndex}Title`] = obj.title;
684   - taskInfoData[`${obj.dataIndex}Conent`] = countMap[obj.dataIndex];
685   - });
686   -
  434 + }
  435 + };
  436 +
  437 + // 更新机台状态
  438 + const handleUpdateProductionplan = async ({ item, iFlag, pauseValue }) => {
  439 + const { app } = props;
  440 + const { sId } = item.record;
  441 + const { token } = app;
  442 + const url = `${
  443 + commonConfig.server_host
  444 + }oee/updateProductionplan/${sId}/${iFlag}${
  445 + pauseValue
  446 + ? `?sWorkOrderChangeMemo=${encodeURIComponent(pauseValue)}`
  447 + : ""
  448 + }`;
  449 + const dataReturn = (await commonServices.getService(token, url)).data;
  450 + if (dataReturn.code === 1) {
  451 + handleRefresh();
  452 + } else {
  453 + message.error(dataReturn.msg);
  454 + }
  455 + };
  456 +
  457 + return {
  458 + ...props,
  459 + // 其他对象
  460 + itemClickRef,
  461 + onSearch: handleSearch,
  462 + onStartWork: handleStartWork, // 开工事件
  463 + onRefresh: handleRefresh, // 刷新页面
  464 + onTableBtnClick: handleTableBtnClick, // 开工、暂停事件
  465 + onUpdateProductionplan: handleUpdateProductionplan // 更新机台状态
  466 + };
  467 +};
  468 +
  469 +/**
  470 + * 暂停按钮
  471 + * @param {*} params
  472 + */
  473 +const handlePause = async params => {
  474 + const { item, props } = params;
  475 + const { record, config } = item;
  476 + await operationFetch(
  477 + { ...props, workOrderInfoData: [record] },
  478 + config,
  479 + config.sName || "fileError"
  480 + );
  481 + await handleOeeBtnEent({ props, item });
  482 +};
  483 +
  484 +const MachineTasks = baseProps => {
  485 + const props = useInfoEvent(useCommonBase({ ...baseProps }));
  486 + const {
  487 + app,
  488 + slave0Config,
  489 + slave1Column,
  490 + slave1Data = [],
  491 + slave2Column,
  492 + slave2Data = []
  493 + } = props;
  494 +
  495 + const bStartWork = commonUtils.getAppData("userinfo", "bStartWork");
  496 +
  497 + const [isTableLoading, setTableLoading] = useState(false);
  498 +
  499 + // const BtnTableCopyTo.startWork
  500 + // 开工按钮配置
  501 + const startWorkConfig =
  502 + slave0Config?.gdsconfigformslave?.find(
  503 + item => item.sControlName === "BtnTableCopyTo.startWork"
  504 + ) || {};
  505 + const pauseWorkConfig =
  506 + slave0Config?.gdsconfigformslave?.find(
  507 + item => item.sControlName === "BtnTableCopyTo.pauseWork"
  508 + ) || {};
  509 +
  510 + // 表格业务
  511 + const [sSrcNo, setSSrcNo] = useState("");
  512 + // 顶部表格配置
  513 + const tableProps = {
  514 + ...commonBusiness.getTableTypes("slave0", props),
  515 + tableProps: {
  516 + onChange: () => {},
  517 + loading: isTableLoading
  518 + },
  519 + tableBtnsConfig: params => {
  520 + const { record, index } = params;
  521 + const { iStar } = record;
  522 + // const iStar = index === 0 ? 1 : 2;
  523 +
  524 + // const bStart = iStar === 1;
  525 + // const bPause = iStar === 2;
  526 +
  527 + // 1 :开工状态(显示暂停) 2: 暂停状态(显示开工) 3: 完工状态(显示完工,灰色)
  528 + // 开工:开工接口(现在)1:正常, -7:有开工,要有提示, -1: 错误提示
  529 + // -7 :完工: iFlag:3 (完工上一条) 暂停:iFlag:2 (暂停上一条)
  530 + // 暂停:新接口
  531 +
  532 + let showName, btnBgColor, sDefault;
  533 + if (iStar === 1) {
  534 + showName = "暂1停";
  535 + btnBgColor = "#FAAD14";
  536 + } else if (iStar === 2 || iStar === 3) {
  537 + showName = "开1工";
  538 + btnBgColor = "#1890FF";
  539 + } else {
  540 + showName = "完1工";
  541 + btnBgColor = "#AAA";
  542 + sDefault = "${false}";
  543 + }
  544 +
  545 + if (!bStartWork) {
  546 + sDefault = "${false}";
  547 + }
  548 +
  549 + return [
  550 + { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig },
  551 + { showName: "完工", btnBgColor: "#1890FF", sDefault }
  552 + ];
  553 +
  554 + // return [
  555 + // {
  556 + // ...startWorkConfig,
  557 + // showName: "开工",
  558 + // btnBgColor: bStart ? "#1890FF" : "#AAA"
  559 + // },
  560 + // {
  561 + // ...pauseWorkConfig,
  562 + // showName: "暂停",
  563 + // btnBgColor: bPause ? "#FAAD14" : "#AAA"
  564 + // }
  565 + // ];
  566 + },
  567 + onTableBtnClick: item => {
  568 + props.onTableBtnClick(item);
  569 + return;
  570 + // 通用按钮操作
  571 + // props.onTableBtnClick(item);
  572 + const { tableName, index, record, tableData, config } = item;
  573 + const { iStar } = record;
  574 + const { showName } = config;
  575 + if (iStar === 1 && showName === "开工") {
  576 + setTableLoading(true);
  577 + props.onStartWork(item).finally(() => {
  578 + setTableLoading(false);
  579 + });
  580 + } else if (iStar === 2 && showName === "暂停") {
  581 + setTableLoading(true);
  582 + handlePause({ item, props }).finally(() => {
  583 + setTableLoading(false);
  584 + props.onRefresh();
  585 + });
  586 + }
  587 + },
  588 + tableBtnsWidth: "190px",
  589 + fixedHeight: "335px"
  590 + };
  591 + // 全部按钮事件
  592 + const tableAll = () => {
  593 + setSSrcNo("");
  594 + props.onSearch();
  595 + };
  596 + // 查询按钮事件
  597 + const tableQuery = () => {
  598 + props.onSearch(sSrcNo);
  599 + };
  600 +
  601 + // 前期生产或反馈问题业务
  602 + const [issueType, setIssueType] = useState(4);
  603 + const issueObj = slave1Column?.reduce((acc, item) => {
  604 + const chineseKey = item.title.replace(/[0-9]/g, "");
  605 + if (acc[chineseKey]) {
  606 + acc[chineseKey].push(item);
  607 + } else {
  608 + acc[chineseKey] = [item];
  609 + }
  610 + return acc;
  611 + }, {});
  612 +
  613 + let issue = [];
  614 +
  615 + if (issueObj) {
  616 + issue = Object.keys(issueObj)?.map((key, i) => {
  617 + return { name: key, items: issueObj[key], id: i };
  618 + });
  619 + }
  620 +
  621 + const component = id => {
  622 + if (issue?.length > 0) {
687 623 return (
688   - <div className={styles.tasksBox}>
689   - <Row className={`tasksBg tasksTable`}>
690   - <Col span={24}>
691   - <div className="table">
692   - <StaticEditTable {...tableProps} />
693   - </div>
694   - <div className="tableSearch">
695   - <Button type="primary" size="large" onClick={tableAll}>
696   - {" "}
697   - 全部{" "}
698   - </Button>
699   - <Input
700   - allowClear
701   - placeholder="工单编号"
702   - value={sSrcNo}
703   - onChange={e => setSSrcNo(e.target.value)}
704   - />
705   - <Button type="primary" size="large" onClick={tableQuery}>
706   - {" "}
707   - 查询{" "}
708   - </Button>
709   - </div>
710   - </Col>
711   - </Row>
712   - <Row gutter={[15, 0]} className={`marginTop`}>
713   - <Col span={18}>
714   - <div className={`tasksBg taskIssue`}>
715   - <h2>前期生产或反馈问题</h2>
716   - {issue?.map(item => (
717   - <Button
718   - className="taskBtn"
719   - key={item.id}
720   - type={issueType === item.id ? "primary" : ""}
721   - ghost={issueType === item.id ? false : true}
722   - onClick={() => setIssueType(item.id)}
723   - >
724   - {item.name}
725   - </Button>
726   - ))}
727   - {component(issueType)}
728   - </div>
729   - </Col>
730   - <Col span={6}>
731   - <div className={`tasksBg taskIssue`} style={{ maxWidth: "434px" }}>
732   - <Carousel autoplay>
733   - {carouselData.map(item => (
734   - <div key={item.id} className={`tasksCarousel`}>
735   - <h2>{item.title}</h2>
736   - <p>{item.content}</p>
737   - </div>
738   - ))}
739   - </Carousel>
740   - </div>
741   - </Col>
742   - </Row>
743   - <Row gutter={[15, 0]} className={`tasksBg marginTop taskInfo`}>
744   - <h2>设备信息</h2>
745   - <Col span={4} className="taskInfoBox">
746   - <div className={"leftBox"}>
747   - <img src={taskInfoIcon} alt={taskInfoData.sMachineNameTitle} />
748   - <div>
749   - <h3>{taskInfoData.sMachineNameTitle}:</h3>
750   - <p>{taskInfoData.sMachineNameConent}</p>
  624 + <div className="marginTop componentBox">
  625 + {issue[id].items.map(item => (
  626 + <p>
  627 + <span>{item.title}:</span>
  628 + {slave1Data[0] ? (
  629 + <Tooltip
  630 + placement="topLeft"
  631 + title={
  632 + <span style={{ fontSize: 20 }}>
  633 + {slave1Data[0][item.dataIndex]}
  634 + </span>
  635 + }
  636 + >
  637 + <span>{slave1Data[0][item.dataIndex]}</span>
  638 + </Tooltip>
  639 + ) : (
  640 + ""
  641 + )}
  642 + </p>
  643 + ))}
  644 + </div>
  645 + );
  646 + }
  647 + };
  648 + const NoAnnouncements = commonFunc.showLocalMessage(props, 'NoAnnouncements', '暂无通告');
  649 +
  650 + const [carouselData, setCarouselData] = useState([
  651 + {
  652 + title: NoAnnouncements,
  653 + content: NoAnnouncements,
  654 + id: 999
  655 + }
  656 + ]);
  657 +
  658 + const { slave3Data = [] } = props;
  659 +
  660 + useEffect(
  661 + () => {
  662 + if (!slave3Data.length) return;
  663 +
  664 + const tempData = slave3Data.map((item, index) => ({
  665 + title: `车间通告${index + 1}`,
  666 + content: item.sNoticeMemo,
  667 + id: index
  668 + }));
  669 +
  670 + setCarouselData(tempData);
  671 + },
  672 + [slave3Data.length]
  673 + );
  674 +
  675 + // 设备信息业务
  676 + const slave2OneData = slave2Data[0] || {};
  677 + const { countMapJsON } = slave2OneData;
  678 + const countMap = commonUtils.convertStrToObj(countMapJsON);
  679 +
  680 + const taskInfoData = {};
  681 + slave2Column?.forEach(obj => {
  682 + taskInfoData[`${obj.dataIndex}Title`] = obj.title;
  683 + taskInfoData[`${obj.dataIndex}Conent`] = countMap[obj.dataIndex];
  684 + });
  685 + const feedbackIssues = commonFunc.showLocalMessage(props, 'feedbackIssues', '前期生产或反馈问题');
  686 + const btnsearch = commonFunc.showLocalMessage(props, 'BtnSearch', '查询111');
  687 + console.log('3333', btnsearch);
  688 + const btnAll = commonFunc.showLocalMessage(props, 'btnAll', '全部');
  689 + const sWorkOrderNo = commonFunc.showLocalMessage(props, 'sWorkOrderNo', '工单编号');
  690 +
  691 +
  692 + return (
  693 + <div className={styles.tasksBox}>
  694 + <Row className={`tasksBg tasksTable`}>
  695 + <Col span={24}>
  696 + <div className="table">
  697 + <StaticEditTable {...tableProps} />
  698 + </div>
  699 + <div className="tableSearch">
  700 + <Button type="primary" size="large" onClick={tableAll}>
  701 + {" "}
  702 + {btnAll}{" "}
  703 + </Button>
  704 + <Input
  705 + allowClear
  706 + placeholder={sWorkOrderNo}
  707 + value={sSrcNo}
  708 + onChange={e => setSSrcNo(e.target.value)}
  709 + />
  710 + <Button type="primary" size="large" onClick={tableQuery}>
  711 + {" "}
  712 + {btnsearch}{" "}
  713 + </Button>
  714 + </div>
  715 + </Col>
  716 + </Row>
  717 + <Row gutter={[15, 0]} className={`marginTop`}>
  718 + <Col span={18}>
  719 + <div className={`tasksBg taskIssue`}>
  720 + <h2>{feedbackIssues}</h2>
  721 + {issue?.map(item => (
  722 + <Button
  723 + className="taskBtn"
  724 + key={item.id}
  725 + type={issueType === item.id ? "primary" : ""}
  726 + ghost={issueType === item.id ? false : true}
  727 + onClick={() => setIssueType(item.id)}
  728 + >
  729 + {item.name}
  730 + </Button>
  731 + ))}
  732 + {component(issueType)}
  733 + </div>
  734 + </Col>
  735 + <Col span={6}>
  736 + <div className={`tasksBg taskIssue`} style={{ maxWidth: "434px" }}>
  737 + <Carousel autoplay>
  738 + {carouselData.map(item => (
  739 + <div key={item.id} className={`tasksCarousel`}>
  740 + <h2>{item.title}</h2>
  741 + <p>{item.content}</p>
751 742 </div>
  743 + ))}
  744 + </Carousel>
  745 + </div>
  746 + </Col>
  747 + </Row>
  748 + <Row gutter={[15, 0]} className={`tasksBg marginTop taskInfo`}>
  749 + <h2>设备信息</h2>
  750 + <Col span={4} className="taskInfoBox">
  751 + <div className={"leftBox"}>
  752 + <img src={taskInfoIcon} alt={taskInfoData.sMachineNameTitle} />
  753 + <div>
  754 + <h3>{taskInfoData.sMachineNameTitle}:</h3>
  755 + <p>{taskInfoData.sMachineNameConent}</p>
  756 + </div>
  757 + </div>
  758 + </Col>
  759 + <Col span={4} className="taskInfoBox">
  760 + <div className={"leftBox"}>
  761 + <img src={statusIcon} alt={taskInfoData.sStatusNameTitle} />
  762 + <div>
  763 + <h3>{taskInfoData.sStatusNameTitle}:</h3>
  764 + <p>{taskInfoData.sStatusNameConent}</p>
  765 + </div>
  766 + <StatusBtnComponent />
  767 + </div>
  768 + </Col>
  769 + <Col span={10} className="taskInfoBox">
  770 + <div className={"centerBox"}>
  771 + <img src={timeIcon} alt={taskInfoData.tStartingUpTimeTitle} />
  772 + <div className="timeBox">
  773 + <h3>{taskInfoData.tStartingUpTimeTitle}:</h3>
  774 + <p>{taskInfoData.tStartingUpTimeConent}</p>
  775 + </div>
  776 + <div className="timeBox">
  777 + <div className="bothEndsAlign">
  778 + <p>{taskInfoData.tNorRunTimeTitle}:</p>
  779 + <span>{taskInfoData.tNorRunTimeConent}</span>
752 780 </div>
753   - </Col>
754   - <Col span={4} className="taskInfoBox">
755   - <div className={"leftBox"}>
756   - <img src={statusIcon} alt={taskInfoData.sStatusNameTitle} />
757   - <div>
758   - <h3>{taskInfoData.sStatusNameTitle}:</h3>
759   - <p>{taskInfoData.sStatusNameConent}</p>
760   - </div>
761   - <StatusBtnComponent />
  781 + <div className="bothEndsAlign">
  782 + <p>{taskInfoData.tExeWaitTimeTitle}:</p>
  783 + <span>{taskInfoData.tExeWaitTimeConent}</span>
762 784 </div>
763   - </Col>
764   - <Col span={10} className="taskInfoBox">
765   - <div className={"centerBox"}>
766   - <img src={timeIcon} alt={taskInfoData.tStartingUpTimeTitle} />
767   - <div className="timeBox">
768   - <h3>{taskInfoData.tStartingUpTimeTitle}:</h3>
769   - <p>{taskInfoData.tStartingUpTimeConent}</p>
770   - </div>
771   - <div className="timeBox">
772   - <div className="bothEndsAlign">
773   - <p>{taskInfoData.tNorRunTimeTitle}:</p>
774   - <span>{taskInfoData.tNorRunTimeConent}</span>
775   - </div>
776   - <div className="bothEndsAlign">
777   - <p>{taskInfoData.tExeWaitTimeTitle}:</p>
778   - <span>{taskInfoData.tExeWaitTimeConent}</span>
779   - </div>
780   - </div>
781   - <div className="timeBox">
782   - <div className="bothEndsAlign">
783   - <p>{taskInfoData.tNorWaitTimeTitle}:</p>
784   - <span>{taskInfoData.tNorWaitTimeConent}</span>
785   - </div>
786   - <div className="bothEndsAlign">
787   - <p>{taskInfoData.tMaintenceTimeTitle}:</p>
788   - <span>{taskInfoData.tMaintenceTimeConent}</span>
789   - </div>
790   - </div>
  785 + </div>
  786 + <div className="timeBox">
  787 + <div className="bothEndsAlign">
  788 + <p>{taskInfoData.tNorWaitTimeTitle}:</p>
  789 + <span>{taskInfoData.tNorWaitTimeConent}</span>
791 790 </div>
792   - </Col>
793   - <Col span={6} className="taskInfoBox">
794   - <div className={"leftBox"}>
795   - <img src={taskIcon} alt={taskInfoData.tStartingUpTimeTitle} />
796   - <div>
797   - <h3>今日完成任务批次/产量(个):</h3>
798   - <p>
799   - {taskInfoData.iFinishTaskBatchConent} /{" "}
800   - {taskInfoData.iFinishProductionNumConent}
801   - </p>
802   - </div>
  791 + <div className="bothEndsAlign">
  792 + <p>{taskInfoData.tMaintenceTimeTitle}:</p>
  793 + <span>{taskInfoData.tMaintenceTimeConent}</span>
803 794 </div>
804   - </Col>
805   - </Row>
806   - <TaskConfirmModal {...props} />
807   - </div>
808   - );
809   - };
810   -
811   - const TaskConfirmModal = props => {
812   - const {
813   - taskConfirmModalVisible,
814   - taskConfirmModalMsg,
815   - bPauseOnly,
816   - slave0Config
817   - } = props;
818   - if (!taskConfirmModalVisible) return "";
819   -
820   - const handleClose = () => {
821   - props.itemClickRef.current = null;
822   - props.onSaveState({
823   - taskConfirmModalVisible: false,
824   - bPauseOnly: false,
825   - pauseCallback: null
826   - });
827   - };
828   -
829   - const [pauseValue, setPauseValue] = useState("");
830   -
831   - const viewConfigs = slave0Config?.gdsconfigformslave.filter(
832   - item => item.sName === "sPausereason"
833   - );
  795 + </div>
  796 + </div>
  797 + </Col>
  798 + <Col span={6} className="taskInfoBox">
  799 + <div className={"leftBox"}>
  800 + <img src={taskIcon} alt={taskInfoData.tStartingUpTimeTitle} />
  801 + <div>
  802 + <h3>今日完成任务批次/产量(个):</h3>
  803 + <p>
  804 + {taskInfoData.iFinishTaskBatchConent} /{" "}
  805 + {taskInfoData.iFinishProductionNumConent}
  806 + </p>
  807 + </div>
  808 + </div>
  809 + </Col>
  810 + </Row>
  811 + <TaskConfirmModal {...props} />
  812 + </div>
  813 + );
  814 +};
834 815  
835   - const sIdRef = useRef(commonUtils.createSid());
836   -
837   - const viewProps = {
838   - ...props,
839   - viewConfigs,
840   - tableConfig: { ...slave0Config, gdsconfigformslave: viewConfigs },
841   - iColValueView: 24,
842   - viewRow: { sId: sIdRef.current, sPausereason: pauseValue },
843   - tableName: "slave0",
844   - enabled: true,
845   - onDataChange: (...args) => {
846   - setPauseValue(args[2].sPausereason);
847   - }
848   - };
849   -
850   - return (
851   - <Modal
852   - title={<span style={{ fontSize: 22 }}>提示!</span>}
853   - open={taskConfirmModalVisible}
854   - width={500}
855   - height={320}
856   - className="mesCommonModal"
857   - footer={
  816 +const TaskConfirmModal = props => {
  817 + const { taskConfirmModalVisible, taskConfirmModalMsg, bPauseOnly } = props;
  818 + if (!taskConfirmModalVisible) return "";
  819 +
  820 + const handleClose = () => {
  821 + props.itemClickRef.current = null;
  822 + props.onSaveState({
  823 + taskConfirmModalVisible: false,
  824 + bPauseOnly: false,
  825 + pauseCallback: null
  826 + });
  827 + };
  828 +
  829 + const [pauseValue, setPauseValue] = useState("");
  830 +
  831 + return (
  832 + <Modal
  833 + title={<span style={{ fontSize: 22 }}>提示!</span>}
  834 + open={taskConfirmModalVisible}
  835 + width={500}
  836 + height={370}
  837 + className="mesCommonModal"
  838 + footer={
  839 + <Space>
  840 + {bPauseOnly ? (
  841 + <Button
  842 + size="large"
  843 + type="primary"
  844 + className={styles.btnZt}
  845 + onClick={() => {
  846 + if (!pauseValue.trim()) {
  847 + message.warning("请先输入暂停原因!");
  848 + return;
  849 + }
  850 + props.pauseCallback(pauseValue.trim());
  851 + }}
  852 + >
  853 + 暂停
  854 + </Button>
  855 + ) : (
858 856 <>
859   - {bPauseOnly ? (
860   - <Space>
861   - <Button
862   - size="large"
863   - type="primary"
864   - className={styles.btnZt}
865   - onClick={() => {
866   - if (!pauseValue.trim()) {
867   - message.warning("请先选择暂停原因!");
868   - return;
869   - }
870   - props.pauseCallback(pauseValue.trim());
871   - }}
872   - >
873   - 暂停
874   - </Button>
875   - </Space>
876   - ) : (
877   - <Space style={{ width: "100%" , 'justify-content': 'space-between' }}>
878   - <Button
879   - size="large"
880   - type="primary"
881   - className={styles.btnWg}
882   - onClick={() => {
883   - if (props.itemClickRef.current?.data)
884   - props.onTableBtnClick({
885   - ...(props.itemClickRef.current?.data || {}),
886   - iFlag: 4
887   - });
888   - // handleClose();
889   - }}
890   - >
891   - 完工
892   - </Button>
893   - <Button
894   - size="large"
895   - type="primary"
896   - className={styles.btnZt}
897   - onClick={() => {
898   - if (!pauseValue.trim()) {
899   - message.warning("请先选择暂停原因!");
900   - return;
901   - }
902   - if (props.itemClickRef.current?.data)
903   - props.onTableBtnClick({
904   - ...(props.itemClickRef.current?.data || {}),
905   - iFlag: 3,
906   - pauseValue: pauseValue.trim()
907   - });
908   - // handleClose();
909   - }}
910   - >
911   - 暂停
912   - </Button>
913   - </Space>
914   - )}
  857 + <Button
  858 + size="large"
  859 + type="primary"
  860 + className={styles.btnWg}
  861 + onClick={() => {
  862 + if (props.itemClickRef.current?.data)
  863 + props.onTableBtnClick({
  864 + ...(props.itemClickRef.current?.data || {}),
  865 + iFlag: 4
  866 + });
  867 + // handleClose();
  868 + }}
  869 + >
  870 + 完工
  871 + </Button>
  872 + <Button
  873 + size="large"
  874 + type="primary"
  875 + className={styles.btnZt}
  876 + onClick={() => {
  877 + if (!pauseValue.trim()) {
  878 + message.warning("请先输入暂停原因!");
  879 + return;
  880 + }
  881 + if (props.itemClickRef.current?.data)
  882 + props.onTableBtnClick({
  883 + ...(props.itemClickRef.current?.data || {}),
  884 + iFlag: 3,
  885 + pauseValue: pauseValue.trim()
  886 + });
  887 + // handleClose();
  888 + }}
  889 + >
  890 + 暂停
  891 + </Button>
915 892 </>
  893 + )}
  894 + </Space>
  895 + }
  896 + onCancel={handleClose}
  897 + >
  898 + <div className={styles.taskConfirmModal}>{taskConfirmModalMsg}</div>
  899 + <div className={styles.pauseReason}>
  900 + <div className={styles.pauseTitle}>暂停原因</div>
  901 + <Input.TextArea
  902 + placeholder="请输入暂停原因"
  903 + autoSize={{ minRows: 3, maxRows: 3 }}
  904 + style={{ width: "100%" }}
  905 + value={pauseValue}
  906 + onChange={e => setPauseValue(e.target.value)}
  907 + />
  908 + </div>
  909 + </Modal>
  910 + );
  911 +};
  912 +
  913 +// 全屏状态
  914 +const StatusBtnComponent = () => {
  915 + const items = [
  916 + {
  917 + key: "4",
  918 + label: <span className={styles.statusDropdown}>转产</span>,
  919 + value: {
  920 + conent2: "转产",
  921 + backgroundColor: "#752AFE"
  922 + }
  923 + },
  924 + {
  925 + key: "1",
  926 + label: <span className={styles.statusDropdown}>测试</span>,
  927 + value: {
  928 + conent2: "转产",
  929 + backgroundColor: "#21C9FE"
  930 + },
  931 + children: [
  932 + {
  933 + key: "1-1",
  934 + label: <span className={styles.statusDropdown}>产品打样</span>,
  935 + value: {
  936 + conent2: "产品打样",
  937 + backgroundColor: "#21C9FE"
916 938 }
917   - onCancel={handleClose}
918   - >
919   - <div className={styles.taskConfirmModal}>{taskConfirmModalMsg}</div>
920   - <div className={styles.pauseReason}>
921   - {/* <div className={styles.pauseTitle}>暂停原因</div> */}
922   - <CommonViewTable {...viewProps} />
923   - {/* <Input.TextArea
924   - placeholder="请输入暂停原因"
925   - autoSize={{ minRows: 3, maxRows: 3 }}
926   - style={{ width: "100%" }}
927   - value={pauseValue}
928   - onChange={e => setPauseValue(e.target.value)}
929   - /> */}
930   - </div>
931   - </Modal>
  939 + },
  940 + {
  941 + key: "1-2",
  942 + label: <span className={styles.statusDropdown}>工艺测试</span>,
  943 + value: {
  944 + conent2: "工艺测试",
  945 + backgroundColor: "#21C9FE"
  946 + }
  947 + }
  948 + ]
  949 + },
  950 + {
  951 + key: "2",
  952 + label: <span className={styles.statusDropdown}>保养</span>,
  953 + value: {
  954 + conent2: "保养",
  955 + backgroundColor: "#FF6600"
  956 + },
  957 + children: [
  958 + {
  959 + key: "2-1",
  960 + label: <span className={styles.statusDropdown}>日常保养</span>,
  961 + value: {
  962 + conent2: "日常保养",
  963 + backgroundColor: "#FF6600"
  964 + }
  965 + },
  966 + {
  967 + key: "2-2",
  968 + label: <span className={styles.statusDropdown}>一级保养</span>,
  969 + value: {
  970 + conent2: "一级保养",
  971 + backgroundColor: "#FF6600"
  972 + }
  973 + },
  974 + {
  975 + key: "2-3",
  976 + label: <span className={styles.statusDropdown}>二级保养</span>,
  977 + value: {
  978 + conent2: "二级保养",
  979 + backgroundColor: "#FF6600"
  980 + }
  981 + },
  982 + {
  983 + key: "2-4",
  984 + label: <span className={styles.statusDropdown}>一级+二级保养</span>,
  985 + value: {
  986 + conent2: "一级+二级保养",
  987 + backgroundColor: "#FF6600",
  988 + fontSize: 130
  989 + }
  990 + },
  991 + {
  992 + key: "2-5",
  993 + label: <span className={styles.statusDropdown}>年度保养</span>,
  994 + value: {
  995 + conent2: "年度保养",
  996 + backgroundColor: "#FF6600"
  997 + }
  998 + }
  999 + ]
  1000 + }
  1001 + ];
  1002 +
  1003 + const handleMenuClick = e => {
  1004 + message.success({
  1005 + top: 0,
  1006 + duration: 0,
  1007 + className: styles.machineStatus,
  1008 + content: <MachineMessageComponent e={e} />
  1009 + });
  1010 + };
  1011 +
  1012 + return (
  1013 + <div className={styles.statusBtn}>
  1014 + <Dropdown
  1015 + menu={{ items, onClick: handleMenuClick }}
  1016 + trigger={["click"]}
  1017 + placement="top"
  1018 + overlayClassName={styles.statusDropdown}
  1019 + >
  1020 + <Button type="link" size="large" style={{ fontSize: 26 }}>
  1021 + <SettingTwoTone />
  1022 + </Button>
  1023 + </Dropdown>
  1024 + </div>
  1025 + );
  1026 +};
  1027 +
  1028 +const MachineMessageComponent = ({ e }) => {
  1029 + const value = e.item?.props?.value || {};
  1030 + const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss"));
  1031 + const { backgroundColor, conent2, fontSize } = value;
  1032 +
  1033 + const [currentTime, setCurrentTime] = useState("");
  1034 + const [diffHours, setDiffHours] = useState(0);
  1035 + const [diffMins, setDiffMins] = useState(0);
  1036 + const [diffSecs, setDiffSecs] = useState(0);
  1037 + const flagRef = useRef(0);
  1038 + useEffect(() => {
  1039 + const getTime = () => {
  1040 + const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss");
  1041 + setCurrentTime(currentTimeNew);
  1042 +
  1043 + const duration = moment.duration(
  1044 + moment(currentTimeNew).diff(moment(startTime))
932 1045 );
  1046 + const hours = duration
  1047 + .asHours()
  1048 + .toString()
  1049 + .split(".")[0];
  1050 + const minutes = (duration.asMinutes() % 60).toString().split(".")[0];
  1051 + const seconds = duration.asSeconds() % 60;
  1052 +
  1053 + setDiffHours(hours);
  1054 + setDiffMins(minutes);
  1055 + setDiffSecs(seconds);
933 1056 };
934   -
935   - // 全屏状态
936   - const StatusBtnComponent = () => {
937   -
938   - const items = [
939   - {
940   - key: "4",
941   - label: <span className={styles.statusDropdown}>转产</span>,
942   - value: {
943   - conent2: "转产",
944   - backgroundColor: "#752AFE"
945   - }
946   - },
947   - {
948   - key: "1",
949   - label: <span className={styles.statusDropdown}>测试</span>,
950   - value: {
951   - conent2: "转产",
952   - backgroundColor: "#21C9FE"
953   - },
954   - children: [
955   - {
956   - key: "1-1",
957   - label: <span className={styles.statusDropdown}>产品打样</span>,
958   - value: {
959   - conent2: "产品打样",
960   - backgroundColor: "#21C9FE"
961   - }
962   - },
963   - {
964   - key: "1-2",
965   - label: <span className={styles.statusDropdown}>工艺测试</span>,
966   - value: {
967   - conent2: "工艺测试",
968   - backgroundColor: "#21C9FE"
969   - }
970   - }
971   - ]
972   - },
973   - {
974   - key: "2",
975   - label: <span className={styles.statusDropdown}>保养</span>,
976   - value: {
977   - conent2: "保养",
978   - backgroundColor: "#FF6600"
979   - },
980   - children: [
981   - {
982   - key: "2-1",
983   - label: <span className={styles.statusDropdown}>日常保养</span>,
984   - value: {
985   - conent2: "日常保养",
986   - backgroundColor: "#FF6600"
987   - }
988   - },
989   - {
990   - key: "2-2",
991   - label: <span className={styles.statusDropdown}>一级保养</span>,
992   - value: {
993   - conent2: "一级保养",
994   - backgroundColor: "#FF6600"
995   - }
996   - },
997   - {
998   - key: "2-3",
999   - label: <span className={styles.statusDropdown}>二级保养</span>,
1000   - value: {
1001   - conent2: "二级保养",
1002   - backgroundColor: "#FF6600"
1003   - }
1004   - },
1005   - {
1006   - key: "2-4",
1007   - label: <span className={styles.statusDropdown}>一级+二级保养</span>,
1008   - value: {
1009   - conent2: "一级+二级保养",
1010   - backgroundColor: "#FF6600",
1011   - fontSize: 130
1012   - }
1013   - },
1014   - {
1015   - key: "2-5",
1016   - label: <span className={styles.statusDropdown}>年度保养</span>,
1017   - value: {
1018   - conent2: "年度保养",
1019   - backgroundColor: "#FF6600"
1020   - }
1021   - }
1022   - ]
1023   - }
1024   - ];
1025   -
1026   - // 全屏
1027   - const handleMenuClick = item2 => {
1028   - const newObj = {
1029   - ...item2,
1030   - item: item2.item
1031   - };
1032   - window.$wkcFullStatus(newObj , true)
1033   - };
1034   -
1035   -
1036   - return (
1037   - <>
1038   - <div className={styles.statusBtn}>
1039   - <Dropdown menu={{ items, onClick: handleMenuClick }} trigger={["click"]} placement="top" overlayClassName={styles.statusDropdown} >
1040   - <Button type="link" size="large" style={{ fontSize: 26 }}>
1041   - <SettingTwoTone />
1042   - </Button>
1043   - </Dropdown>
1044   - </div>
1045   - </>
1046   - );
  1057 +
  1058 + getTime();
  1059 + const timer = setInterval(() => {
  1060 + getTime();
  1061 + }, 1000);
  1062 +
  1063 + const handleMenuClose = () => {
  1064 + if (flagRef.current) return;
  1065 + flagRef.current++;
  1066 + Modal.confirm({
  1067 + title: "温馨提示:",
  1068 + content: <div>确认退出该页面?</div>,
  1069 + okText: "确认",
  1070 + cancelText: "取消",
  1071 + zIndex: 2000,
  1072 + onOk() {
  1073 + message.destroy();
  1074 + },
  1075 + onCancel() {
  1076 + setTimeout(() => {
  1077 + flagRef.current = 0;
  1078 + }, 500);
  1079 + }
  1080 + });
1047 1081 };
1048   -
1049   - // const MachineMessageComponent = ({ e , shutDown , minimize}) => {
1050   - // const value = e.item?.props?.value || {};
1051   - // const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss"));
1052   - // const { backgroundColor, conent2, fontSize } = value;
1053   - // const [currentTime, setCurrentTime] = useState("");
1054   - // const [diffHours, setDiffHours] = useState(0);
1055   - // const [diffMins, setDiffMins] = useState(0);
1056   - // const [diffSecs, setDiffSecs] = useState(0);
1057   - // const flagRef = useRef(0);
1058   - // useEffect(() => {
1059   - // const getTime = () => {
1060   - // const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss");
1061   - // setCurrentTime(currentTimeNew);
1062   -
1063   - // const duration = moment.duration(
1064   - // moment(currentTimeNew).diff(moment(startTime))
1065   - // );
1066   - // const hours = duration
1067   - // .asHours()
1068   - // .toString()
1069   - // .split(".")[0];
1070   - // const minutes = (duration.asMinutes() % 60).toString().split(".")[0];
1071   - // const seconds = duration.asSeconds() % 60;
1072   -
1073   - // setDiffHours(hours);
1074   - // setDiffMins(minutes);
1075   - // setDiffSecs(seconds);
1076   - // };
1077   -
1078   - // getTime();
1079   - // const timer = setInterval(() => {
1080   - // getTime();
1081   - // }, 1000);
1082   -
1083   - // // const handleMenuClose = () => {
1084   - // // if (flagRef.current) return;
1085   - // // flagRef.current++;
1086   - // // Modal.confirm({
1087   - // // title: "温馨提示:",
1088   - // // content: <div>确认退出该页面?</div>,
1089   - // // okText: "确认",
1090   - // // cancelText: "取消",
1091   - // // zIndex: 2000,
1092   - // // onOk() {
1093   - // // message.destroy();
1094   - // // },
1095   - // // onCancel() {
1096   - // // setTimeout(() => {
1097   - // // flagRef.current = 0;
1098   - // // }, 500);
1099   - // // }
1100   - // // });
1101   - // // };
1102   -
1103   - // // setInterval(() => {
1104   - // // document.addEventListener("click", handleMenuClose);
1105   - // // }, 1000);
1106   -
1107   - // return () => {
1108   - // clearInterval(timer);
1109   - // // document.removeEventListener("click", handleMenuClose);
1110   - // };
1111   - // }, []);
1112   -
1113   - // const handleMenuClose = () => {
1114   - // if (flagRef.current) return;
1115   - // flagRef.current++;
1116   - // Modal.confirm({
1117   - // title: "温馨提示:",
1118   - // content: <div>确认退出该页面?</div>,
1119   - // okText: "确认",
1120   - // cancelText: "取消",
1121   - // zIndex: 2000,
1122   - // onOk() {
1123   - // // message.destroy();
1124   - // shutDown()
1125   - // },
1126   - // onCancel() {
1127   - // setTimeout(() => {
1128   - // flagRef.current = 0;
1129   - // }, 500);
1130   - // }
1131   - // });
1132   - // };
1133   -
1134   - // return (
1135   - // <div className={styles.machineStatusContent} style={{ backgroundColor }}>
1136   - // <div className="conent1">设备停机状态告知</div>
1137   - // <div className="conent2" style={fontSize ? { fontSize } : {}}>
1138   - // {conent2}
1139   - // </div>
1140   - // <div className="conent3">
1141   - // 停机开始时间:
1142   - // {startTime}
1143   - // </div>
1144   - // <div className="conent4">
1145   - // 系统当前时间:
1146   - // {currentTime}
1147   - // </div>
1148   - // <div className="conent5">
1149   - // 此次停机耗时:
1150   - // <span className="conent6">
1151   - // 约:
1152   - // {diffHours}时 {diffMins}分 {diffSecs}秒
1153   - // </span>
1154   - // </div>
1155   - // <div className="conent7">
1156   - // <Button size="large" type="primary" className={styles.btnWg} onClick={minimize} > 最小化 </Button>
1157   - // <Button size="large" type="primary" className={styles.btnWg} onClick={handleMenuClose} > 退出 </Button>
1158   - // </div>
1159   - // </div>
1160   - // );
1161   - // };
1162   -
1163   - export default MachineTasks;
1164   -
1165 1082 \ No newline at end of file
  1083 +
  1084 + setInterval(() => {
  1085 + document.addEventListener("click", handleMenuClose);
  1086 + }, 1000);
  1087 +
  1088 + return () => {
  1089 + clearInterval(timer);
  1090 + document.removeEventListener("click", handleMenuClose);
  1091 + };
  1092 + }, []);
  1093 +
  1094 + return (
  1095 + <div className={styles.machineStatusContent} style={{ backgroundColor }}>
  1096 + <div className="conent1">设备停机状态告知</div>
  1097 + <div className="conent2" style={fontSize ? { fontSize } : {}}>
  1098 + {conent2}
  1099 + </div>
  1100 + <div className="conent3">
  1101 + 停机开始时间:
  1102 + {startTime}
  1103 + </div>
  1104 + <div className="conent4">
  1105 + 系统当前时间:
  1106 + {currentTime}
  1107 + </div>
  1108 + <div className="conent5">
  1109 + 此次停机耗时:
  1110 + <span className="conent6">
  1111 + 约:
  1112 + {diffHours}时 {diffMins}分 {diffSecs}秒
  1113 + </span>
  1114 + </div>
  1115 + </div>
  1116 + );
  1117 +};
  1118 +
  1119 +export default MachineTasks;
... ...
src/mes/teamInfo/index.js
... ... @@ -500,8 +500,8 @@ const TeamInfo = baseProps =&gt; {
500 500 tableName: "slave",
501 501 viewRow: props.slaveData && props.slaveData.length !== 0 ? props.slaveData[0] : {},
502 502 onDataChange: (tableName, sName, returnValue , sId , dropDownData , isWait ) => {
503   - props.onSaveState({
504   - [`slaveData`]: [ {...props.slaveData[0] , ...returnValue} ]
  503 + props.onSaveState({
  504 + [`slaveData`]: [ {...props.slaveData[0] , ...returnValue} ]
505 505 });
506 506 setTimeout(()=>{
507 507 // 调用指令集保存
... ... @@ -522,8 +522,8 @@ const TeamInfo = baseProps =&gt; {
522 522 };
523 523 // 清空临时IPQC
524 524 const clearTempIpqc = () => {
525   - props.onSaveState({
526   - [`slaveData`]: [ {...props.slaveData[0] , sIpqcId2:'' , sIpqcName2: '' } ]
  525 + props.onSaveState({
  526 + [`slaveData`]: [ {...props.slaveData[0] , sIpqcId2:'' , sIpqcName2: '' } ]
527 527 });
528 528 props.onExecInstructSet({
529 529 nextProps: { ...props , slaveData : [ {...props.slaveData[0] , sIpqcId2:'',sIpqcName2:''} ] },
... ... @@ -533,6 +533,16 @@ const TeamInfo = baseProps =&gt; {
533 533 }
534 534 })
535 535 }
  536 + const teamInformation= commonFunc.showLocalMessage(props, 'teamInformation', '班组信息');
  537 +
  538 + const captain = commonFunc.showLocalMessage(props, 'captain', '机长');
  539 +
  540 + const shift = commonFunc.showLocalMessage(props, 'shift', '班次');
  541 +
  542 + const classGroup = commonFunc.showLocalMessage(props, 'classGroup', '班组');
  543 +
  544 + const foreman = commonFunc.showLocalMessage(props, 'foreman', '领班');
  545 + console.log('2222', teamInformation);
536 546  
537 547  
538 548 return (
... ... @@ -541,7 +551,7 @@ const TeamInfo = baseProps =&gt; {
541 551 <div className="teamInfo">
542 552 <h2>
543 553 <img src={teaIcon} />
544   - 班组信息
  554 + {teamInformation}
545 555 </h2>
546 556 <div className="userWorkBox">
547 557 <div className="workTop">
... ... @@ -564,15 +574,15 @@ const TeamInfo = baseProps =&gt; {
564 574 )}
565 575 <ul>
566 576 <li>
567   - <label>机长</label>
  577 + <label>{captain}</label>
568 578 <span>{ sActualEmployeeName || sEmployeeName}</span>
569 579 </li>
570 580 <li>
571   - <label>班组</label>
  581 + <label>{classGroup}</label>
572 582 <span>{props.app.userinfo?.sTeamNo}</span>
573 583 </li>
574 584 <li>
575   - <label>班次</label>
  585 + <label>{shift}</label>
576 586 <span>
577 587 {props.app.userinfo?.sShift == "1"
578 588 ? "白班"
... ... @@ -585,7 +595,7 @@ const TeamInfo = baseProps =&gt; {
585 595 </div>
586 596 <ul style={{'flex-direction': 'row'}}>
587 597 <li>
588   - <label>领班</label>
  598 + <label>{foreman}</label>
589 599 <span>{sForemanName}</span>
590 600 </li>
591 601 <li>
... ... @@ -601,7 +611,7 @@ const TeamInfo = baseProps =&gt; {
601 611 <CommonViewTable {...viewProps} className="temporaryIpqc"></CommonViewTable>
602 612 <Button style={{ 'position': 'absolute' , 'top': '20%' ,'right': '2%'}} type="primary" onClick={() => { clearTempIpqc() }} > 清空 </Button>
603 613 </div>
604   -
  614 +
605 615 </div>
606 616 </div>
607 617 <div className="postList">
... ... @@ -710,13 +720,13 @@ const TeamJoinInfo = props =&gt; {
710 720 });
711 721 props.onChangeRouter({ type: "name", path: ["计划任务", "机台任务"] });
712 722 };
713   -
  723 + const workHandoverInformation= commonFunc.showLocalMessage(props, 'workHandoverInformation', '上班交接信息');
714 724 return (
715 725 <div className="joinInfo">
716 726 <Row className="teamTitle">
717 727 <h2 style={{ color: "#1890ff", margin: 0 }}>
718 728 <img src={joinIcon} />
719   - 上班交接信息
  729 + {workHandoverInformation}
720 730 </h2>
721 731 </Row>
722 732 <Row className="teamInfoBox">
... ...