Commit 036bd08079b183d3547a615657c75ab5af32266f

Authored by Min
1 parent a1aad727

1.劲嘉---机台任务,完工按钮操作添加loading

src/mes/scheduledTasks/machineTasks/index.js
@@ -34,27 +34,33 @@ @@ -34,27 +34,33 @@
34 import timeIcon from "../assets/time.png"; 34 import timeIcon from "../assets/time.png";
35 import { handleOeeBtnEent } from "./common/handlePause"; 35 import { handleOeeBtnEent } from "./common/handlePause";
36 import { operationFetch } from "../../productionExec/productionExecMain/operationFetch"; 36 import { operationFetch } from "../../productionExec/productionExecMain/operationFetch";
37 - 37 +
38 // 业务层 38 // 业务层
39 const useInfoEvent = props => { 39 const useInfoEvent = props => {
40 const { formData } = props; 40 const { formData } = props;
41 const [refreshCount, setRefreshCount] = useState(0); 41 const [refreshCount, setRefreshCount] = useState(0);
42 - 42 + const [isRefreshing, setIsRefreshing] = useState(false);
  43 +
43 useEffect( 44 useEffect(
44 async () => { 45 async () => {
45 if (commonUtils.isNotEmptyArr(formData)) { 46 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); 47 + setIsRefreshing(true);
  48 + try {
  49 + const colunmData = handleGetColumnData(formData, true);
  50 + const result = await handleGetData(formData, true);
  51 + const addState = {
  52 + ...colunmData,
  53 + ...result
  54 + };
  55 + props.onSaveState(addState);
  56 + } finally {
  57 + setIsRefreshing(false);
  58 + }
53 } 59 }
54 }, 60 },
55 [formData, refreshCount] 61 [formData, refreshCount]
56 ); 62 );
57 - 63 +
58 // 获取表头数据 64 // 获取表头数据
59 const handleGetColumnData = (formData = [], isWait) => { 65 const handleGetColumnData = (formData = [], isWait) => {
60 let addState = {}; 66 let addState = {};
@@ -73,20 +79,20 @@ @@ -73,20 +79,20 @@
73 props.onSaveState(addState); 79 props.onSaveState(addState);
74 } 80 }
75 }; 81 };
76 - 82 +
77 // 获取数据集 83 // 获取数据集
78 const handleGetData = async (formData = [], isWait, filter) => { 84 const handleGetData = async (formData = [], isWait, filter) => {
79 let addState = {}; 85 let addState = {};
80 for (let i = 0; i < formData.length; i++) { 86 for (let i = 0; i < formData.length; i++) {
81 const config = formData[i]; 87 const config = formData[i];
82 if (!config) continue; 88 if (!config) continue;
83 - 89 +
84 const conditonValues = props.onGetSqlConditionValues(config); 90 const conditonValues = props.onGetSqlConditionValues(config);
85 - 91 +
86 if (config.sSqlStr === "Sp_OEE_ProductionReport") { 92 if (config.sSqlStr === "Sp_OEE_ProductionReport") {
87 conditonValues.sMachineId_s_pro = props.app.sMachineNameSId; 93 conditonValues.sMachineId_s_pro = props.app.sMachineNameSId;
88 } 94 }
89 - 95 +
90 // 前期生产或反馈问题表必须有非空过滤条件 96 // 前期生产或反馈问题表必须有非空过滤条件
91 if ( 97 if (
92 (i === 1 && Object.values(conditonValues).includes("")) || 98 (i === 1 && Object.values(conditonValues).includes("")) ||
@@ -94,7 +100,7 @@ @@ -94,7 +100,7 @@
94 ) { 100 ) {
95 continue; 101 continue;
96 } 102 }
97 - 103 +
98 const bFilter = []; 104 const bFilter = [];
99 if (filter) { 105 if (filter) {
100 Object.keys(filter).forEach(key => { 106 Object.keys(filter).forEach(key => {
@@ -105,7 +111,7 @@ @@ -105,7 +111,7 @@
105 }); 111 });
106 }); 112 });
107 } 113 }
108 - 114 +
109 const result = 115 const result =
110 (await props.onGetDataSet({ 116 (await props.onGetDataSet({
111 name: `slave${i}`, 117 name: `slave${i}`,
@@ -126,20 +132,20 @@ @@ -126,20 +132,20 @@
126 props.onSaveState(addState); 132 props.onSaveState(addState);
127 } 133 }
128 }; 134 };
129 - 135 +
130 // 查询 136 // 查询
131 const handleSearch = sWorkOrderNo => { 137 const handleSearch = sWorkOrderNo => {
132 handleGetData([formData[0]], false, { 138 handleGetData([formData[0]], false, {
133 sWorkOrderNo 139 sWorkOrderNo
134 }); 140 });
135 }; 141 };
136 - 142 +
137 // 开工事件 143 // 开工事件
138 const handleStartWork = async params => { 144 const handleStartWork = async params => {
139 const { sModelsId, token, app } = props; 145 const { sModelsId, token, app } = props;
140 const { name, record, config, tableData, iFlag, pauseValue } = params; 146 const { name, record, config, tableData, iFlag, pauseValue } = params;
141 const { sMachineId, sId, sSlaveId } = record; 147 const { sMachineId, sId, sSlaveId } = record;
142 - 148 +
143 // /* 若设置了禁止跳单 选择数据不是第一条时进行提示 */ 149 // /* 若设置了禁止跳单 选择数据不是第一条时进行提示 */
144 // const iIndex = app.systemData.findIndex(item => item.sName === "CkxNoSkip"); 150 // const iIndex = app.systemData.findIndex(item => item.sName === "CkxNoSkip");
145 // if (iIndex > -1) { 151 // if (iIndex > -1) {
@@ -169,7 +175,7 @@ @@ -169,7 +175,7 @@
169 // props.getServiceError(dataReturn); 175 // props.getServiceError(dataReturn);
170 // return; 176 // return;
171 // } 177 // }
172 - 178 +
173 // 单据可以使用 179 // 单据可以使用
174 const { startWorkConfig = {} } = config; 180 const { startWorkConfig = {} } = config;
175 const { sAssignField } = startWorkConfig; 181 const { sAssignField } = startWorkConfig;
@@ -187,21 +193,21 @@ @@ -187,21 +193,21 @@
187 sParentId: record.sId, 193 sParentId: record.sId,
188 tCreateDate: new Date() 194 tCreateDate: new Date()
189 }; 195 };
190 - 196 +
191 const valuesNew = {}; 197 const valuesNew = {};
192 valuesNew.data = []; 198 valuesNew.data = [];
193 valuesNew.data.push( 199 valuesNew.data.push(
194 commonBusiness.mergeData(name, "plc_machinedata", [rowData], []) 200 commonBusiness.mergeData(name, "plc_machinedata", [rowData], [])
195 ); 201 );
196 - 202 +
197 if ((iFlag || Object.is(iFlag, 0)) && valuesNew.data[0]) { 203 if ((iFlag || Object.is(iFlag, 0)) && valuesNew.data[0]) {
198 valuesNew.data[0].iFlag = iFlag; 204 valuesNew.data[0].iFlag = iFlag;
199 } 205 }
200 - 206 +
201 if (pauseValue) { 207 if (pauseValue) {
202 valuesNew.data[0].sWorkOrderChangeMemo = pauseValue; 208 valuesNew.data[0].sWorkOrderChangeMemo = pauseValue;
203 } 209 }
204 - 210 +
205 const BtnSave = commonFunc.showMessage( 211 const BtnSave = commonFunc.showMessage(
206 app.commonConst, 212 app.commonConst,
207 "BtnSave" 213 "BtnSave"
@@ -214,10 +220,10 @@ @@ -214,10 +220,10 @@
214 sModelsId, 220 sModelsId,
215 bMachineTask: true 221 bMachineTask: true
216 }); 222 });
217 - 223 +
218 return returnData; 224 return returnData;
219 // if (commonUtils.isEmptyObject(returnData)) return; 225 // if (commonUtils.isEmptyObject(returnData)) return;
220 - 226 +
221 // props.onSaveState( 227 // props.onSaveState(
222 // { 228 // {
223 // [`${name}SelectedRowKeys`]: [record.sId] 229 // [`${name}SelectedRowKeys`]: [record.sId]
@@ -240,17 +246,17 @@ @@ -240,17 +246,17 @@
240 // ); 246 // );
241 // this.props.onSaveCurrentState(slaveData, true, undefined, undefined, 1); 247 // this.props.onSaveCurrentState(slaveData, true, undefined, undefined, 1);
242 }; 248 };
243 - 249 +
244 // 更新工单状态 250 // 更新工单状态
245 const handleUpdateStatus = async params => { 251 const handleUpdateStatus = async params => {
246 const { doWorkState, record } = params; 252 const { doWorkState, record } = params;
247 - 253 +
248 const { sModelsId, app } = props; 254 const { sModelsId, app } = props;
249 - 255 +
250 const value = { 256 const value = {
251 plcMachinedata: record 257 plcMachinedata: record
252 }; 258 };
253 - 259 +
254 const url = `${ 260 const url = `${
255 commonConfig.server_host 261 commonConfig.server_host
256 }oee/doUpdateStatus/${doWorkState}?sModelsId=${sModelsId}&sMachineId=${ 262 }oee/doUpdateStatus/${doWorkState}?sModelsId=${sModelsId}&sMachineId=${
@@ -261,26 +267,26 @@ @@ -261,26 +267,26 @@
261 value, 267 value,
262 url 268 url
263 )).data; 269 )).data;
264 - 270 +
265 if (returnData.code !== 1) { 271 if (returnData.code !== 1) {
266 props.getServiceError(returnData); 272 props.getServiceError(returnData);
267 return false; 273 return false;
268 } 274 }
269 - 275 +
270 return true; 276 return true;
271 }; 277 };
272 - 278 +
273 // 监听机台任务选中行变化 279 // 监听机台任务选中行变化
274 const { slave0SelectedRowKeys = [], slave0Data = [], sModelsId } = props; 280 const { slave0SelectedRowKeys = [], slave0Data = [], sModelsId } = props;
275 useEffect( 281 useEffect(
276 () => { 282 () => {
277 if (!slave0Data.length) return; 283 if (!slave0Data.length) return;
278 - 284 +
279 const globalData = commonUtils.convertStrToObj( 285 const globalData = commonUtils.convertStrToObj(
280 localStorage.xlybusinessglobalData 286 localStorage.xlybusinessglobalData
281 ); 287 );
282 const { currentSelectedMachineTaskDataRow = {} } = globalData; 288 const { currentSelectedMachineTaskDataRow = {} } = globalData;
283 - 289 +
284 // 当前选中行sId,默认取缓存数据 290 // 当前选中行sId,默认取缓存数据
285 let currentSelectedRowKey = slave0SelectedRowKeys[0]; 291 let currentSelectedRowKey = slave0SelectedRowKeys[0];
286 if ( 292 if (
@@ -292,14 +298,14 @@ @@ -292,14 +298,14 @@
292 if (!currentSelectedRowKey) { 298 if (!currentSelectedRowKey) {
293 currentSelectedRowKey = slave0Data[0].sId; 299 currentSelectedRowKey = slave0Data[0].sId;
294 } 300 }
295 - 301 +
296 // 默认选中第一行 302 // 默认选中第一行
297 if (!slave0SelectedRowKeys.length) { 303 if (!slave0SelectedRowKeys.length) {
298 props.onSaveState({ 304 props.onSaveState({
299 slave0SelectedRowKeys: [currentSelectedRowKey] 305 slave0SelectedRowKeys: [currentSelectedRowKey]
300 }); 306 });
301 } 307 }
302 - 308 +
303 // 将当前选中行保存到全局 309 // 将当前选中行保存到全局
304 props.dispatch({ 310 props.dispatch({
305 type: "app/saveGlobalData", 311 type: "app/saveGlobalData",
@@ -311,13 +317,13 @@ @@ -311,13 +317,13 @@
311 } 317 }
312 } 318 }
313 }); 319 });
314 - 320 +
315 // 前期生产或反馈问题数据根据机台任务选中行变化 321 // 前期生产或反馈问题数据根据机台任务选中行变化
316 handleGetData(["", formData[1]], false); 322 handleGetData(["", formData[1]], false);
317 }, 323 },
318 [slave0SelectedRowKeys[0], slave0Data.length] 324 [slave0SelectedRowKeys[0], slave0Data.length]
319 ); 325 );
320 - 326 +
321 // 监听开工任务变化 327 // 监听开工任务变化
322 useEffect( 328 useEffect(
323 () => { 329 () => {
@@ -333,14 +339,14 @@ @@ -333,14 +339,14 @@
333 }, 339 },
334 [JSON.stringify(props.slave0Data)] 340 [JSON.stringify(props.slave0Data)]
335 ); 341 );
336 - 342 +
337 // 刷新页面 343 // 刷新页面
338 const handleRefresh = () => { 344 const handleRefresh = () => {
339 setRefreshCount(pre => pre + 1); 345 setRefreshCount(pre => pre + 1);
340 }; 346 };
341 - 347 +
342 const itemClickRef = useRef(); 348 const itemClickRef = useRef();
343 - 349 +
344 // 开工、暂停事件 350 // 开工、暂停事件
345 const handleTableBtnClick = async item => { 351 const handleTableBtnClick = async item => {
346 const { tableName, index, record, tableData, config, iFlag } = item; 352 const { tableName, index, record, tableData, config, iFlag } = item;
@@ -359,7 +365,7 @@ @@ -359,7 +365,7 @@
359 } 365 }
360 // const iStar = index === 0 ? 1 : 2; 366 // const iStar = index === 0 ? 1 : 2;
361 const { iStar } = record; 367 const { iStar } = record;
362 - 368 +
363 if (iStar === 1) { 369 if (iStar === 1) {
364 // 如果只剩一条数据,询问是暂停还是完工 370 // 如果只剩一条数据,询问是暂停还是完工
365 if (tableData.length === 1) { 371 if (tableData.length === 1) {
@@ -383,7 +389,7 @@ @@ -383,7 +389,7 @@
383 return; 389 return;
384 } 390 }
385 } 391 }
386 - 392 +
387 // 开工中,走暂停接口 393 // 开工中,走暂停接口
388 props.onSaveState({ 394 props.onSaveState({
389 taskConfirmModalVisible: true, 395 taskConfirmModalVisible: true,
@@ -434,7 +440,7 @@ @@ -434,7 +440,7 @@
434 } 440 }
435 } 441 }
436 }; 442 };
437 - 443 +
438 // 更新机台状态 444 // 更新机台状态
439 const handleUpdateProductionplan = async ({ item, iFlag, pauseValue }) => { 445 const handleUpdateProductionplan = async ({ item, iFlag, pauseValue }) => {
440 const { app } = props; 446 const { app } = props;
@@ -455,7 +461,7 @@ @@ -455,7 +461,7 @@
455 message.error(dataReturn.msg, 3); 461 message.error(dataReturn.msg, 3);
456 } 462 }
457 }; 463 };
458 - 464 +
459 return { 465 return {
460 ...props, 466 ...props,
461 // 其他对象 467 // 其他对象
@@ -464,10 +470,11 @@ @@ -464,10 +470,11 @@
464 onStartWork: handleStartWork, // 开工事件 470 onStartWork: handleStartWork, // 开工事件
465 onRefresh: handleRefresh, // 刷新页面 471 onRefresh: handleRefresh, // 刷新页面
466 onTableBtnClick: handleTableBtnClick, // 开工、暂停事件 472 onTableBtnClick: handleTableBtnClick, // 开工、暂停事件
467 - onUpdateProductionplan: handleUpdateProductionplan // 更新机台状态 473 + onUpdateProductionplan: handleUpdateProductionplan, // 更新机台状态
  474 + isRefreshing
468 }; 475 };
469 }; 476 };
470 - 477 +
471 /** 478 /**
472 * 暂停按钮 479 * 暂停按钮
473 * @param {*} params 480 * @param {*} params
@@ -482,7 +489,7 @@ @@ -482,7 +489,7 @@
482 ); 489 );
483 await handleOeeBtnEent({ props, item }); 490 await handleOeeBtnEent({ props, item });
484 }; 491 };
485 - 492 +
486 const MachineTasks = baseProps => { 493 const MachineTasks = baseProps => {
487 const props = useInfoEvent(useCommonBase({ ...baseProps })); 494 const props = useInfoEvent(useCommonBase({ ...baseProps }));
488 const { 495 const {
@@ -491,13 +498,14 @@ @@ -491,13 +498,14 @@
491 slave1Column, 498 slave1Column,
492 slave1Data = [], 499 slave1Data = [],
493 slave2Column, 500 slave2Column,
494 - slave2Data = [] 501 + slave2Data = [],
  502 + isRefreshing // 新增:接收刷新loading状态
495 } = props; 503 } = props;
496 - 504 +
497 const bStartWork = commonUtils.getAppData("userinfo", "bStartWork"); 505 const bStartWork = commonUtils.getAppData("userinfo", "bStartWork");
498 - 506 +
499 const [isTableLoading, setTableLoading] = useState(false); 507 const [isTableLoading, setTableLoading] = useState(false);
500 - 508 +
501 // const BtnTableCopyTo.startWork 509 // const BtnTableCopyTo.startWork
502 // 开工按钮配置 510 // 开工按钮配置
503 const startWorkConfig = 511 const startWorkConfig =
@@ -508,7 +516,7 @@ @@ -508,7 +516,7 @@
508 slave0Config?.gdsconfigformslave?.find( 516 slave0Config?.gdsconfigformslave?.find(
509 item => item.sControlName === "BtnTableCopyTo.pauseWork" 517 item => item.sControlName === "BtnTableCopyTo.pauseWork"
510 ) || {}; 518 ) || {};
511 - 519 +
512 // 表格业务 520 // 表格业务
513 const [sSrcNo, setSSrcNo] = useState(""); 521 const [sSrcNo, setSSrcNo] = useState("");
514 // 顶部表格配置 522 // 顶部表格配置
@@ -516,21 +524,21 @@ @@ -516,21 +524,21 @@
516 ...commonBusiness.getTableTypes("slave0", props), 524 ...commonBusiness.getTableTypes("slave0", props),
517 tableProps: { 525 tableProps: {
518 onChange: () => {}, 526 onChange: () => {},
519 - loading: isTableLoading 527 + loading: isTableLoading || isRefreshing
520 }, 528 },
521 tableBtnsConfig: params => { 529 tableBtnsConfig: params => {
522 const { record, index } = params; 530 const { record, index } = params;
523 const { iStar } = record; 531 const { iStar } = record;
524 // const iStar = index === 0 ? 1 : 2; 532 // const iStar = index === 0 ? 1 : 2;
525 - 533 +
526 // const bStart = iStar === 1; 534 // const bStart = iStar === 1;
527 // const bPause = iStar === 2; 535 // const bPause = iStar === 2;
528 - 536 +
529 // 1 :开工状态(显示暂停) 2: 暂停状态(显示开工) 3: 完工状态(显示完工,灰色) 537 // 1 :开工状态(显示暂停) 2: 暂停状态(显示开工) 3: 完工状态(显示完工,灰色)
530 // 开工:开工接口(现在)1:正常, -7:有开工,要有提示, -1: 错误提示 538 // 开工:开工接口(现在)1:正常, -7:有开工,要有提示, -1: 错误提示
531 // -7 :完工: iFlag:3 (完工上一条) 暂停:iFlag:2 (暂停上一条) 539 // -7 :完工: iFlag:3 (完工上一条) 暂停:iFlag:2 (暂停上一条)
532 // 暂停:新接口 540 // 暂停:新接口
533 - 541 +
534 let showName, btnBgColor, sDefault; 542 let showName, btnBgColor, sDefault;
535 if (iStar === 1) { 543 if (iStar === 1) {
536 showName = "暂停"; 544 showName = "暂停";
@@ -543,16 +551,16 @@ @@ -543,16 +551,16 @@
543 btnBgColor = "#AAA"; 551 btnBgColor = "#AAA";
544 sDefault = "${false}"; 552 sDefault = "${false}";
545 } 553 }
546 - 554 +
547 if (!bStartWork) { 555 if (!bStartWork) {
548 sDefault = "${false}"; 556 sDefault = "${false}";
549 } 557 }
550 - 558 +
551 return [ 559 return [
552 { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig }, 560 { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig },
553 { showName: "完工", btnBgColor: "#1890FF", sDefault } 561 { showName: "完工", btnBgColor: "#1890FF", sDefault }
554 ]; 562 ];
555 - 563 +
556 // return [ 564 // return [
557 // { 565 // {
558 // ...startWorkConfig, 566 // ...startWorkConfig,
@@ -599,7 +607,7 @@ @@ -599,7 +607,7 @@
599 const tableQuery = () => { 607 const tableQuery = () => {
600 props.onSearch(sSrcNo); 608 props.onSearch(sSrcNo);
601 }; 609 };
602 - 610 +
603 // 前期生产或反馈问题业务 611 // 前期生产或反馈问题业务
604 const [issueType, setIssueType] = useState(4); 612 const [issueType, setIssueType] = useState(4);
605 const issueObj = slave1Column?.reduce((acc, item) => { 613 const issueObj = slave1Column?.reduce((acc, item) => {
@@ -611,15 +619,15 @@ @@ -611,15 +619,15 @@
611 } 619 }
612 return acc; 620 return acc;
613 }, {}); 621 }, {});
614 - 622 +
615 let issue = []; 623 let issue = [];
616 - 624 +
617 if (issueObj) { 625 if (issueObj) {
618 issue = Object.keys(issueObj)?.map((key, i) => { 626 issue = Object.keys(issueObj)?.map((key, i) => {
619 return { name: key, items: issueObj[key], id: i }; 627 return { name: key, items: issueObj[key], id: i };
620 }); 628 });
621 } 629 }
622 - 630 +
623 const component = id => { 631 const component = id => {
624 if (issue?.length > 0) { 632 if (issue?.length > 0) {
625 return ( 633 return (
@@ -647,7 +655,7 @@ @@ -647,7 +655,7 @@
647 ); 655 );
648 } 656 }
649 }; 657 };
650 - 658 +
651 const [carouselData, setCarouselData] = useState([ 659 const [carouselData, setCarouselData] = useState([
652 { 660 {
653 title: "暂无通告", 661 title: "暂无通告",
@@ -655,35 +663,35 @@ @@ -655,35 +663,35 @@
655 id: 999 663 id: 999
656 } 664 }
657 ]); 665 ]);
658 - 666 +
659 const { slave3Data = [] } = props; 667 const { slave3Data = [] } = props;
660 - 668 +
661 useEffect( 669 useEffect(
662 () => { 670 () => {
663 if (!slave3Data.length) return; 671 if (!slave3Data.length) return;
664 - 672 +
665 const tempData = slave3Data.map((item, index) => ({ 673 const tempData = slave3Data.map((item, index) => ({
666 title: `车间通告${index + 1}`, 674 title: `车间通告${index + 1}`,
667 content: item.sNoticeMemo, 675 content: item.sNoticeMemo,
668 id: index 676 id: index
669 })); 677 }));
670 - 678 +
671 setCarouselData(tempData); 679 setCarouselData(tempData);
672 }, 680 },
673 [slave3Data.length] 681 [slave3Data.length]
674 ); 682 );
675 - 683 +
676 // 设备信息业务 684 // 设备信息业务
677 const slave2OneData = slave2Data[0] || {}; 685 const slave2OneData = slave2Data[0] || {};
678 const { countMapJsON } = slave2OneData; 686 const { countMapJsON } = slave2OneData;
679 const countMap = commonUtils.convertStrToObj(countMapJsON); 687 const countMap = commonUtils.convertStrToObj(countMapJsON);
680 - 688 +
681 const taskInfoData = {}; 689 const taskInfoData = {};
682 slave2Column?.forEach(obj => { 690 slave2Column?.forEach(obj => {
683 taskInfoData[`${obj.dataIndex}Title`] = obj.title; 691 taskInfoData[`${obj.dataIndex}Title`] = obj.title;
684 taskInfoData[`${obj.dataIndex}Conent`] = countMap[obj.dataIndex]; 692 taskInfoData[`${obj.dataIndex}Conent`] = countMap[obj.dataIndex];
685 }); 693 });
686 - 694 +
687 return ( 695 return (
688 <div className={styles.tasksBox}> 696 <div className={styles.tasksBox}>
689 <Row className={`tasksBg tasksTable`}> 697 <Row className={`tasksBg tasksTable`}>
@@ -814,7 +822,7 @@ @@ -814,7 +822,7 @@
814 </div> 822 </div>
815 ); 823 );
816 }; 824 };
817 - 825 +
818 const TaskConfirmModal = props => { 826 const TaskConfirmModal = props => {
819 const { 827 const {
820 taskConfirmModalVisible, 828 taskConfirmModalVisible,
@@ -823,7 +831,7 @@ @@ -823,7 +831,7 @@
823 slave0Config 831 slave0Config
824 } = props; 832 } = props;
825 if (!taskConfirmModalVisible) return ""; 833 if (!taskConfirmModalVisible) return "";
826 - 834 +
827 const handleClose = () => { 835 const handleClose = () => {
828 props.itemClickRef.current = null; 836 props.itemClickRef.current = null;
829 props.onSaveState({ 837 props.onSaveState({
@@ -832,15 +840,15 @@ @@ -832,15 +840,15 @@
832 pauseCallback: null 840 pauseCallback: null
833 }); 841 });
834 }; 842 };
835 - 843 +
836 const [pauseValue, setPauseValue] = useState(""); 844 const [pauseValue, setPauseValue] = useState("");
837 - 845 +
838 const viewConfigs = slave0Config?.gdsconfigformslave.filter( 846 const viewConfigs = slave0Config?.gdsconfigformslave.filter(
839 item => item.sName === "sPausereason" 847 item => item.sName === "sPausereason"
840 ); 848 );
841 849
842 const sIdRef = useRef(commonUtils.createSid()); 850 const sIdRef = useRef(commonUtils.createSid());
843 - 851 +
844 const viewProps = { 852 const viewProps = {
845 ...props, 853 ...props,
846 viewConfigs, 854 viewConfigs,
@@ -853,7 +861,7 @@ @@ -853,7 +861,7 @@
853 setPauseValue(args[2].sPausereason); 861 setPauseValue(args[2].sPausereason);
854 } 862 }
855 }; 863 };
856 - 864 +
857 return ( 865 return (
858 <Modal 866 <Modal
859 title={<span style={{ fontSize: 22 }}>提示!</span>} 867 title={<span style={{ fontSize: 22 }}>提示!</span>}
@@ -893,7 +901,7 @@ @@ -893,7 +901,7 @@
893 iFlag: 4 901 iFlag: 4
894 }); 902 });
895 // handleClose(); 903 // handleClose();
896 - }} 904 + }}
897 > 905 >
898 完工 906 完工
899 </Button> 907 </Button>
@@ -938,10 +946,10 @@ @@ -938,10 +946,10 @@
938 </Modal> 946 </Modal>
939 ); 947 );
940 }; 948 };
941 - 949 +
942 // 全屏状态 950 // 全屏状态
943 const StatusBtnComponent = () => { 951 const StatusBtnComponent = () => {
944 - 952 +
945 const items = [ 953 const items = [
946 { 954 {
947 key: "4", 955 key: "4",
@@ -1029,17 +1037,17 @@ @@ -1029,17 +1037,17 @@
1029 ] 1037 ]
1030 } 1038 }
1031 ]; 1039 ];
1032 - 1040 +
1033 // 全屏 1041 // 全屏
1034 const handleMenuClick = item2 => { 1042 const handleMenuClick = item2 => {
1035 - const newObj = { 1043 + const newObj = {
1036 ...item2, 1044 ...item2,
1037 item: item2.item 1045 item: item2.item
1038 }; 1046 };
1039 window.$wkcFullStatus(newObj , true) 1047 window.$wkcFullStatus(newObj , true)
1040 }; 1048 };
1041 -  
1042 - 1049 +
  1050 +
1043 return ( 1051 return (
1044 <> 1052 <>
1045 <div className={styles.statusBtn}> 1053 <div className={styles.statusBtn}>
@@ -1052,7 +1060,7 @@ @@ -1052,7 +1060,7 @@
1052 </> 1060 </>
1053 ); 1061 );
1054 }; 1062 };
1055 - 1063 +
1056 // const MachineMessageComponent = ({ e , shutDown , minimize}) => { 1064 // const MachineMessageComponent = ({ e , shutDown , minimize}) => {
1057 // const value = e.item?.props?.value || {}; 1065 // const value = e.item?.props?.value || {};
1058 // const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss")); 1066 // const { current: startTime } = useRef(moment().format("YYYY-MM-DD HH:mm:ss"));
@@ -1066,7 +1074,7 @@ @@ -1066,7 +1074,7 @@
1066 // const getTime = () => { 1074 // const getTime = () => {
1067 // const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss"); 1075 // const currentTimeNew = moment().format("YYYY-MM-DD HH:mm:ss");
1068 // setCurrentTime(currentTimeNew); 1076 // setCurrentTime(currentTimeNew);
1069 - 1077 +
1070 // const duration = moment.duration( 1078 // const duration = moment.duration(
1071 // moment(currentTimeNew).diff(moment(startTime)) 1079 // moment(currentTimeNew).diff(moment(startTime))
1072 // ); 1080 // );
@@ -1076,17 +1084,17 @@ @@ -1076,17 +1084,17 @@
1076 // .split(".")[0]; 1084 // .split(".")[0];
1077 // const minutes = (duration.asMinutes() % 60).toString().split(".")[0]; 1085 // const minutes = (duration.asMinutes() % 60).toString().split(".")[0];
1078 // const seconds = duration.asSeconds() % 60; 1086 // const seconds = duration.asSeconds() % 60;
1079 - 1087 +
1080 // setDiffHours(hours); 1088 // setDiffHours(hours);
1081 // setDiffMins(minutes); 1089 // setDiffMins(minutes);
1082 // setDiffSecs(seconds); 1090 // setDiffSecs(seconds);
1083 // }; 1091 // };
1084 - 1092 +
1085 // getTime(); 1093 // getTime();
1086 // const timer = setInterval(() => { 1094 // const timer = setInterval(() => {
1087 // getTime(); 1095 // getTime();
1088 // }, 1000); 1096 // }, 1000);
1089 - 1097 +
1090 // // const handleMenuClose = () => { 1098 // // const handleMenuClose = () => {
1091 // // if (flagRef.current) return; 1099 // // if (flagRef.current) return;
1092 // // flagRef.current++; 1100 // // flagRef.current++;
@@ -1106,17 +1114,17 @@ @@ -1106,17 +1114,17 @@
1106 // // } 1114 // // }
1107 // // }); 1115 // // });
1108 // // }; 1116 // // };
1109 - 1117 +
1110 // // setInterval(() => { 1118 // // setInterval(() => {
1111 // // document.addEventListener("click", handleMenuClose); 1119 // // document.addEventListener("click", handleMenuClose);
1112 // // }, 1000); 1120 // // }, 1000);
1113 - 1121 +
1114 // return () => { 1122 // return () => {
1115 // clearInterval(timer); 1123 // clearInterval(timer);
1116 // // document.removeEventListener("click", handleMenuClose); 1124 // // document.removeEventListener("click", handleMenuClose);
1117 // }; 1125 // };
1118 // }, []); 1126 // }, []);
1119 - 1127 +
1120 // const handleMenuClose = () => { 1128 // const handleMenuClose = () => {
1121 // if (flagRef.current) return; 1129 // if (flagRef.current) return;
1122 // flagRef.current++; 1130 // flagRef.current++;
@@ -1137,7 +1145,7 @@ @@ -1137,7 +1145,7 @@
1137 // } 1145 // }
1138 // }); 1146 // });
1139 // }; 1147 // };
1140 - 1148 +
1141 // return ( 1149 // return (
1142 // <div className={styles.machineStatusContent} style={{ backgroundColor }}> 1150 // <div className={styles.machineStatusContent} style={{ backgroundColor }}>
1143 // <div className="conent1">设备停机状态告知</div> 1151 // <div className="conent1">设备停机状态告知</div>
@@ -1166,6 +1174,5 @@ @@ -1166,6 +1174,5 @@
1166 // </div> 1174 // </div>
1167 // ); 1175 // );
1168 // }; 1176 // };
1169 - 1177 +
1170 export default MachineTasks; 1178 export default MachineTasks;
1171 -  
1172 \ No newline at end of file 1179 \ No newline at end of file