From 96c9de8611e7694dbb8121aacc80593233e4ee9d Mon Sep 17 00:00:00 2001 From: zhangzhen <525765282@qq.com> Date: Fri, 5 Sep 2025 15:44:19 +0800 Subject: [PATCH] 格式化代码; --- src/mes/costomPageFun/index.js | 563 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 file changed, 210 insertions(+), 353 deletions(-) diff --git a/src/mes/costomPageFun/index.js b/src/mes/costomPageFun/index.js index cd664d2..8000dda 100644 --- a/src/mes/costomPageFun/index.js +++ b/src/mes/costomPageFun/index.js @@ -8,15 +8,10 @@ import * as commonFunc from "@/components/Common/commonFunc"; import FaceDetect from "@/components/FaceDetect"; import ShowType from "@/components/Common/CommonComponent"; const costomPageFun = ({ props, tableName, sFieldName, actionName }) => { - const { sModelsId } = commonUtils.convertStrToObj( - localStorage.xlybusinesscurrentMesPane - ); + const { sModelsId } = commonUtils.convertStrToObj(localStorage.xlybusinesscurrentMesPane); let result = false; - switch ( - `${sModelsId}-${tableName}${sFieldName ? `-${sFieldName}` : "" - }-${actionName}` - ) { + switch (`${sModelsId}-${tableName}${sFieldName ? `-${sFieldName}` : ""}-${actionName}`) { case "12710101117087404588200-table0-mesTableLineAdd": case "12710101117260270570210-table0-mesTableLineAdd": case "12710101117087371044360-slave0-mesTableLineAdd": @@ -135,10 +130,7 @@ const costomPageFun = ({ props, tableName, sFieldName, actionName }) => { break; } - if ( - ["mesBtnClick"].includes(actionName) && - ["BtnRight.PriorCom", "BtnRight.NextCom"].includes(sFieldName) - ) { + if (["mesBtnClick"].includes(actionName) && ["BtnRight.PriorCom", "BtnRight.NextCom"].includes(sFieldName)) { handleUpDownData({ ...props, tableName, sFieldName }); return true; } @@ -149,19 +141,14 @@ const costomPageFun = ({ props, tableName, sFieldName, actionName }) => { // 班组报工行车记录表格新增 const mesTableLineAdd1 = (props, tableName) => { // const tableName = "table0"; - const { - [`${tableName}SelectedRowKeys`]: selectedRowKeys, - [`${tableName}Data`]: tableData = [] - } = props; + const { [`${tableName}SelectedRowKeys`]: selectedRowKeys, [`${tableName}Data`]: tableData = [] } = props; if (commonUtils.isEmptyObject(selectedRowKeys)) { message.info("请先选中一条行车记录数据!"); return; } - const rowDataIndex = tableData.findIndex( - item => item.sId === selectedRowKeys[0] - ); + const rowDataIndex = tableData.findIndex(item => item.sId === selectedRowKeys[0]); if (rowDataIndex === -1) return; const rowData = tableData[rowDataIndex]; @@ -206,21 +193,17 @@ const mesTableLineAdd1 = (props, tableName) => { props.onSaveState( { [`${tableName}Data`]: tableDataNew, - [`${tableName}SelectedRowKeys`]: [rowDataCopy.sId] + [`${tableName}SelectedRowKeys`]: [rowDataCopy.sId], }, nextProps => { const name = tableName; const { [`${name}Config`]: tableConfig = {} } = nextProps; - const rowClickConfig = tableConfig.gdsconfigformslave?.find( - item => - item.sControlName && - item.sControlName.toLowerCase().includes("rowclick") - ); + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); if (!rowClickConfig) return; props.handleExecInstructSet({ btnConfig: rowClickConfig, - nextProps: nextProps + nextProps: nextProps, }); } ); @@ -228,9 +211,7 @@ const mesTableLineAdd1 = (props, tableName) => { // 研发工艺参数材料表新增 const mesTableLineAdd2 = (props, tableName) => { - const oTab = document - .querySelector('.ant-tabs-tabpane-active[id*="研发工艺参数"]') - .querySelector(".ant-tabs-tab-active"); + const oTab = document.querySelector('.ant-tabs-tabpane-active[id*="研发工艺参数"]').querySelector(".ant-tabs-tab-active"); if (!oTab) return; const dataNodeKey = oTab.getAttribute("data-node-key") || ""; @@ -242,29 +223,23 @@ const mesTableLineAdd2 = (props, tableName) => { handleType: "add", sParentId: props.yftable0Data?.[0]?.sId || "", sRev, - bSave: 0 + bSave: 0, }; const { [`${tableName}Data`]: tableData = [] } = props; props.onSaveState({ - [`${tableName}Data`]: [...tableData, newData] + [`${tableName}Data`]: [...tableData, newData], }); }; // 班组报工行车记录表格起始时间修改 const mesTableChange1 = (props, tableName) => { // const tableName = "table0"; - const { - [`${tableName}SelectedRowKeys`]: selectedRowKeys, - [`${tableName}Data`]: tableData = [], - rowDataOld - } = props; + const { [`${tableName}SelectedRowKeys`]: selectedRowKeys, [`${tableName}Data`]: tableData = [], rowDataOld } = props; let tableDataNew = lodash.cloneDeep(tableData); - const rowDataIndex = tableData.findIndex( - item => item.sId === selectedRowKeys[0] - ); + const rowDataIndex = tableData.findIndex(item => item.sId === selectedRowKeys[0]); if (rowDataIndex === -1) return; const rowData = tableData[rowDataIndex]; @@ -275,30 +250,23 @@ const mesTableChange1 = (props, tableName) => { return; } - let parentRowDataIndex = tableData.findIndex( - item => item.sId !== sId && item.tStartDate === tStartDate - ); + let parentRowDataIndex = tableData.findIndex(item => item.sId !== sId && item.tStartDate === tStartDate); if (parentRowDataIndex === -1) { - parentRowDataIndex = tableData.findIndex( - item => item.tStartDate === rowDataOld.tEndDate - ); + parentRowDataIndex = tableData.findIndex(item => item.tStartDate === rowDataOld.tEndDate); } if (parentRowDataIndex === -1) return; const parentRowData = tableData[parentRowDataIndex]; - const { - tStartDate: tStartDateParent, - tEndDate: tEndDateParent - } = parentRowData; + const { tStartDate: tStartDateParent, tEndDate: tEndDateParent } = parentRowData; // 检查tStartDate是否在tEndDate之前 if (moment(tEndDate).isBefore(moment(tStartDate))) { message.info("结束时间不能小于起始时间!", 3); tableDataNew[rowDataIndex] = rowDataOld; props.onSaveState({ - [`${tableName}Data`]: tableDataNew + [`${tableName}Data`]: tableDataNew, }); return; } @@ -308,7 +276,7 @@ const mesTableChange1 = (props, tableName) => { message.info("结束不能大于父节点的结束时间!", 3); tableDataNew[rowDataIndex] = rowDataOld; props.onSaveState({ - [`${tableName}Data`]: tableDataNew + [`${tableName}Data`]: tableDataNew, }); return; } @@ -318,7 +286,7 @@ const mesTableChange1 = (props, tableName) => { message.info("结束不能大于当前时间!", 3); tableDataNew[rowDataIndex] = rowDataOld; props.onSaveState({ - [`${tableName}Data`]: tableDataNew + [`${tableName}Data`]: tableDataNew, }); return; } @@ -326,14 +294,13 @@ const mesTableChange1 = (props, tableName) => { // 父节点的结束时间改成当前行的起始时间 tableDataNew[rowDataIndex].bUnChanged = false; tableDataNew[parentRowDataIndex].tStartDate = tEndDate; - tableDataNew[parentRowDataIndex].handleType = - tableDataNew[parentRowDataIndex].handleType || "update"; + tableDataNew[parentRowDataIndex].handleType = tableDataNew[parentRowDataIndex].handleType || "update"; // 时间倒序排序 tableDataNew.sort((a, b) => new Date(b.tEndDate) - new Date(a.tEndDate)); const addState = { - [`${tableName}Data`]: tableDataNew + [`${tableName}Data`]: tableDataNew, }; props.onSaveState(addState); @@ -353,32 +320,28 @@ const mesTableLineDel1 = async (props, tableName) => { if (commonUtils.isNotEmptyArr(tableData)) { const addState = { [`${tableName}SelectedRowKeys`]: [tableData[0].sId], - [`slave1SelectedRowKeys`]: [tableData[0].sAbnormalEventId] + [`slave1SelectedRowKeys`]: [tableData[0].sAbnormalEventId], }; if (tableData.some(item => item.bUnChanged)) { addState[`${tableName}Data`] = tableData.map(item => ({ ...item, - bUnChanged: undefined + bUnChanged: undefined, })); } props.onSaveState(addState); const name = tableName; const { [`${name}Config`]: tableConfig = {} } = props; - const rowClickConfig = tableConfig.gdsconfigformslave?.find( - item => - item.sControlName && - item.sControlName.toLowerCase().includes("rowclick") - ); + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); if (!rowClickConfig) return; await awaitPromiseReturn(); props.handleExecInstructSet({ btnConfig: rowClickConfig, nextProps: { ...props, - [`${tableName}SelectedRowKeys`]: [tableData[0].sId] - } + [`${tableName}SelectedRowKeys`]: [tableData[0].sId], + }, }); } return; @@ -386,10 +349,7 @@ const mesTableLineDel1 = async (props, tableName) => { // 找剩余数据中开始时间等于删除数据结束时间的那条数据 const iIndex = tableData.findIndex( - item => - !item.bUnChanged && - (item.sSrcHourId === sSrcHourId || item.sId === sSrcHourId) && - tEndDate === item.tStartDate + item => !item.bUnChanged && (item.sSrcHourId === sSrcHourId || item.sId === sSrcHourId) && tEndDate === item.tStartDate ); if (iIndex === -1) { if (tableName === "table0") { @@ -404,7 +364,7 @@ const mesTableLineDel1 = async (props, tableName) => { tableDataNew[iIndex].tStartDate = tStartDate; tableDataNew[iIndex].handleType = tableDataNew[iIndex].handleType || "update"; const addState = { - [`${tableName}Data`]: tableDataNew + [`${tableName}Data`]: tableDataNew, }; props.onSaveState(addState); @@ -424,73 +384,67 @@ const handleMesSave = props => { sInstruct: JSON.stringify([ { opr: "newempty", - newDataset: "NewReportSlave" + newDataset: "NewReportSlave", }, { opr: "edit", desDataset: "NewReportSlave", dataset: "table0@sec", - sValue: - "sNewReportSlaveId:table0.sId,sSrcHourId:table0.sSrcHourId,tEndDate:table0.tEndDate" + sValue: "sNewReportSlaveId:table0.sId,sSrcHourId:table0.sSrcHourId,tEndDate:table0.tEndDate", }, { opr: "filter", srcDataset: "table0", newDataset: "OldReportSlave", dataset: "NewReportSlave,table0One", - condition: "'${table0One.sId}'=='${NewReportSlave.sSrcHourId}'" + condition: "'${table0One.sId}'=='${NewReportSlave.sSrcHourId}'", }, { opr: "newempty", - newDataset: "temp0" + newDataset: "temp0", }, { opr: "edit", desDataset: "temp0", dataset: "NewReportSlave,OldReportSlave", sValue: - "iOperateType:${1},sNewReportSlaveId:NewReportSlave.sNewReportSlaveId,sOldReportSlaveId:OldReportSlave.sId,tNewEndDate:NewReportSlave.tEndDate" + "iOperateType:${1},sNewReportSlaveId:NewReportSlave.sNewReportSlaveId,sOldReportSlaveId:OldReportSlave.sId,tNewEndDate:NewReportSlave.tEndDate", }, { opr: "exesql", data: [ { - sql: - "call Sp_mes_Operate_ProductionReport(${iOperateType},${sNewReportSlaveId},${sOldReportSlaveId},${tNewEndDate})", - srcDataset: "temp0" - } - ] + sql: "call Sp_mes_Operate_ProductionReport(${iOperateType},${sNewReportSlaveId},${sOldReportSlaveId},${tNewEndDate})", + srcDataset: "temp0", + }, + ], }, { opr: "save", data: [ { tablename: "mftproductionreportslave", - srcDataset: "table0" - } - ] + srcDataset: "table0", + }, + ], }, { opr: "refresh", - dataset: "table0,table1,table4,table0NotFirstlineSelected" - } - ]) + dataset: "table0,table1,table4,table0NotFirstlineSelected", + }, + ]), }, inscallback: async () => { const name = "table0"; const { [`${name}Config`]: tableConfig = {} } = props; - const rowClickConfig = tableConfig.gdsconfigformslave?.find( - item => - item.sControlName && - item.sControlName.toLowerCase().includes("rowclick") - ); + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); if (!rowClickConfig) return; await awaitPromiseReturn(); props.handleExecInstructSet({ btnConfig: rowClickConfig, - nextProps: props + nextProps: props, }); - } + }, }); }; @@ -513,25 +467,24 @@ const handleMesSlave0Save = props => { sInstruct: JSON.stringify([ { opr: "newempty", - newDataset: "NewReportSlave" + newDataset: "NewReportSlave", }, { opr: "edit", desDataset: "NewReportSlave", dataset: "slave0@sec", - sValue: - "sNewReportSlaveId:slave0.sId,sSrcHourId:slave0.sSrcHourId,tEndDate:slave0.tEndDate" + sValue: "sNewReportSlaveId:slave0.sId,sSrcHourId:slave0.sSrcHourId,tEndDate:slave0.tEndDate", }, { opr: "filter", srcDataset: "slave0", newDataset: "OldReportSlave", dataset: "NewReportSlave,slave0One", - condition: "'${slave0One.sId}'=='${NewReportSlave.sSrcHourId}'" + condition: "'${slave0One.sId}'=='${NewReportSlave.sSrcHourId}'", }, { opr: "newempty", - newDataset: "temp0" + newDataset: "temp0", }, { @@ -539,48 +492,43 @@ const handleMesSlave0Save = props => { desDataset: "temp0", dataset: "NewReportSlave,OldReportSlave", sValue: - "iOperateType:${1},sNewReportSlaveId:NewReportSlave.sNewReportSlaveId,sOldReportSlaveId:OldReportSlave.sId,tNewEndDate:NewReportSlave.tEndDate" + "iOperateType:${1},sNewReportSlaveId:NewReportSlave.sNewReportSlaveId,sOldReportSlaveId:OldReportSlave.sId,tNewEndDate:NewReportSlave.tEndDate", }, { opr: "exesql", data: [ { - sql: - "call Sp_mes_Operate_ProductionReport(${iOperateType},${sNewReportSlaveId},${sOldReportSlaveId},${tNewEndDate})", - srcDataset: "temp0" - } - ] + sql: "call Sp_mes_Operate_ProductionReport(${iOperateType},${sNewReportSlaveId},${sOldReportSlaveId},${tNewEndDate})", + srcDataset: "temp0", + }, + ], }, { opr: "save", data: [ { tablename: "mftproductionreportslave", - srcDataset: "slave0" - } - ] + srcDataset: "slave0", + }, + ], }, { opr: "refresh", - dataset: "slave0,slave0NotFirstlineSelected" - } - ]) + dataset: "slave0,slave0NotFirstlineSelected", + }, + ]), }, inscallback: async nextProps => { const name = "slave0"; const { [`${name}Config`]: tableConfig = {} } = props; - const rowClickConfig = tableConfig.gdsconfigformslave?.find( - item => - item.sControlName && - item.sControlName.toLowerCase().includes("rowclick") - ); + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); if (!rowClickConfig) return; await awaitPromiseReturn(); props.handleExecInstructSet({ btnConfig: rowClickConfig, - nextProps: nextProps + nextProps: nextProps, }); - } + }, }); }; @@ -590,7 +538,7 @@ const handleMesSave1 = (props, delRow) => { const temp0Data = []; temp0Data.push({ sNewReportSlaveId: delRow.sId, - sOldReportSlaveId: delRow.sSrcHourId + sOldReportSlaveId: delRow.sSrcHourId, }); props.handleExecInstructSet({ @@ -602,11 +550,10 @@ const handleMesSave1 = (props, delRow) => { opr: "exesql", data: [ { - sql: - "call Sp_mes_Operate_ProductionReport(2,${sNewReportSlaveId},${sOldReportSlaveId},null)", - srcDataset: "temp0" - } - ] + sql: "call Sp_mes_Operate_ProductionReport(2,${sNewReportSlaveId},${sOldReportSlaveId},null)", + srcDataset: "temp0", + }, + ], }, // { @@ -633,25 +580,21 @@ const handleMesSave1 = (props, delRow) => { // }, { opr: "refresh", - dataset: "table0,table1,table4,tableS1,table0FirstlineSelected" - } - ]) + dataset: "table0,table1,table4,tableS1,table0FirstlineSelected", + }, + ]), }, inscallback: async nextProps => { const name = "table0"; const { [`${name}Config`]: tableConfig = {} } = props; - const rowClickConfig = tableConfig.gdsconfigformslave?.find( - item => - item.sControlName && - item.sControlName.toLowerCase().includes("rowclick") - ); + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); if (!rowClickConfig) return; await awaitPromiseReturn(); props.handleExecInstructSet({ btnConfig: rowClickConfig, - nextProps: nextProps + nextProps: nextProps, }); - } + }, }); }; @@ -661,7 +604,7 @@ const handleMesSlave0Save1 = (props, delRow) => { const temp0Data = []; temp0Data.push({ sNewReportSlaveId: delRow.sId, - sOldReportSlaveId: delRow.sSrcHourId + sOldReportSlaveId: delRow.sSrcHourId, }); props.handleExecInstructSet({ @@ -680,51 +623,40 @@ const handleMesSlave0Save1 = (props, delRow) => { opr: "exesql", data: [ { - sql: - "call Sp_mes_Operate_ProductionReport(2,${sNewReportSlaveId},${sOldReportSlaveId},null)", - srcDataset: "temp0" - } - ] + sql: "call Sp_mes_Operate_ProductionReport(2,${sNewReportSlaveId},${sOldReportSlaveId},null)", + srcDataset: "temp0", + }, + ], }, { opr: "refresh", - dataset: "slave0,slave0FirstlineSelected" - } - ]) + dataset: "slave0,slave0FirstlineSelected", + }, + ]), }, inscallback: async nextProps => { const name = "slave0"; const { [`${name}Config`]: tableConfig = {} } = props; - const rowClickConfig = tableConfig.gdsconfigformslave?.find( - item => - item.sControlName && - item.sControlName.toLowerCase().includes("rowclick") - ); + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); if (!rowClickConfig) return; await awaitPromiseReturn(); props.handleExecInstructSet({ btnConfig: rowClickConfig, - nextProps: nextProps + nextProps: nextProps, }); - } + }, }); }; // 班组报工托盘计数信息按钮 const mesGetBtnsConfig1 = props => { - const { - table0Data = [], - table0SelectedRowKeys = [], - btnsConfig = [] - } = props; + const { table0Data = [], table0SelectedRowKeys = [], btnsConfig = [] } = props; if (!table0SelectedRowKeys.length) { return []; } - const table0Row = table0Data.find( - item => item.sId === table0SelectedRowKeys[0] - ); + const table0Row = table0Data.find(item => item.sId === table0SelectedRowKeys[0]); const sSrcHourId = table0Row?.sSrcHourId; // 是否新纪录 @@ -740,16 +672,9 @@ const mesGetBtnsConfig1 = props => { // 班组报工托盘计数信息按钮点击事件 const mesTableBtnClick1 = props => { - const { - sControlName, - table0Data = [], - table0SelectedRowKeys = [], - params - } = props; + const { sControlName, table0Data = [], table0SelectedRowKeys = [], params } = props; const { record } = params; - const table0Row = table0Data.find( - item => item.sId === table0SelectedRowKeys[0] - ); + const table0Row = table0Data.find(item => item.sId === table0SelectedRowKeys[0]); const { sId, sSrcHourId, tStartDate, tEndDate } = table0Row; let table0RowNext; @@ -757,21 +682,13 @@ const mesTableBtnClick1 = props => { // 调至下段 table0RowNext = table0Data.find( item => - !item.bUnChanged && - item.tStartDate === tEndDate && - (item.sId === sSrcHourId || - item.sSrcHourId === sSrcHourId || - item.sSrcHourId === sId) + !item.bUnChanged && item.tStartDate === tEndDate && (item.sId === sSrcHourId || item.sSrcHourId === sSrcHourId || item.sSrcHourId === sId) ); } else { // 调至上段 table0RowNext = table0Data.find( item => - !item.bUnChanged && - item.tEndDate === tStartDate && - (item.sId === sSrcHourId || - item.sSrcHourId === sSrcHourId || - item.sSrcHourId === sId) + !item.bUnChanged && item.tEndDate === tStartDate && (item.sId === sSrcHourId || item.sSrcHourId === sSrcHourId || item.sSrcHourId === sId) ); } @@ -779,7 +696,7 @@ const mesTableBtnClick1 = props => { temp0Data.push({ sNewReportSlaveId: sId, sOldReportSlaveId: table0RowNext.sId, - sTrayOutId: record.sId + sTrayOutId: record.sId, }); props.onExecInstructSet({ @@ -793,16 +710,16 @@ const mesTableBtnClick1 = props => { { sql: "update mftplctray A SET A.sReportTrayId= ${sOldReportSlaveId} WHERE A.sReportTrayId=${sNewReportSlaveId} and A.sTrayOutId=${sTrayOutId}", - srcDataset: "temp0" - } - ] + srcDataset: "temp0", + }, + ], }, { opr: "refresh", - dataset: "table1" - } - ]) - } + dataset: "table1", + }, + ]), + }, }); }; @@ -833,7 +750,7 @@ const mesTableBtnClick2 = props => { tableS5Data: [], tableS8Data: [], tableS9Data: [], - tableS10Data: [] + tableS10Data: [], }); const oTabs = document.querySelectorAll(`.ant-tabs-tab-btn[id*="生产日报"]`); @@ -850,7 +767,7 @@ const mesTableBtnClick3 = props => { if (bHourlyReport) { props.onExecInstructSet({ nextProps: props, - btnConfig: config + btnConfig: config, }); return; } @@ -868,22 +785,20 @@ const mesTableBtnClick3 = props => { props.onSaveState({ table0SelectedRowKeys: [], table4Data: [], - table13Data: [] + table13Data: [], }); setTimeout(() => { props.onTableSelectRowChange("table0", [table0Data[iIndex].sId]); props.onSaveState({ - refreshTableList: ["table0,table0NotFirstlineSelected"] + refreshTableList: ["table0,table0NotFirstlineSelected"], }); }, 200); const oTabs = document.querySelectorAll(`.ant-tabs-tab-btn[id*="班组报工"]`); oTabs?.[0]?.click(); setTimeout(() => { - const oTabs1 = document.querySelectorAll( - `.ant-tabs-tab-btn[id*="产量上报信息"]` - ); + const oTabs1 = document.querySelectorAll(`.ant-tabs-tab-btn[id*="产量上报信息"]`); oTabs1?.[0]?.click(); }, 200); }; @@ -892,10 +807,7 @@ const mesTableBtnClick3 = props => { const handleSlaveWypj2BtnPre = props => { const listName = "slaveWypj2"; const tableName = "slaveWypj3"; - const { - [`${listName}Data`]: listData = [], - [`${tableName}Data`]: tableData = [] - } = props; + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; const [rowData = {}] = listData; @@ -910,23 +822,21 @@ const handleSlaveWypj2BtnPre = props => { return; } - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( - item => item.sControlName === "BtnTable.View" - )?.sInstruct; + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnTable.View")?.sInstruct; if (!sInstructStr) return; const selectedRowKeys = [tableData[iIndex - 1].sId]; props.onSaveState( { - [`${tableName}SelectedRowKeys`]: selectedRowKeys + [`${tableName}SelectedRowKeys`]: selectedRowKeys, }, nextProps => { props.onExecInstructSet({ nextProps: nextProps, btnConfig: { showName: "上一卷", - sInstruct: sInstructStr - } + sInstruct: sInstructStr, + }, }); } ); @@ -936,10 +846,7 @@ const handleSlaveWypj2BtnPre = props => { const handleSlaveWypj2BtnNext = props => { const listName = "slaveWypj2"; const tableName = "slaveWypj3"; - const { - [`${listName}Data`]: listData = [], - [`${tableName}Data`]: tableData = [] - } = props; + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; const [rowData = {}] = listData; @@ -954,23 +861,21 @@ const handleSlaveWypj2BtnNext = props => { return; } - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( - item => item.sControlName === "BtnTable.View" - )?.sInstruct; + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnTable.View")?.sInstruct; if (!sInstructStr) return; const selectedRowKeys = [tableData[iIndex + 1].sId]; props.onSaveState( { - [`${tableName}SelectedRowKeys`]: selectedRowKeys + [`${tableName}SelectedRowKeys`]: selectedRowKeys, }, nextProps => { props.onExecInstructSet({ nextProps: nextProps, btnConfig: { showName: "下一卷", - sInstruct: sInstructStr - } + sInstruct: sInstructStr, + }, }); } ); @@ -980,10 +885,7 @@ const handleSlaveWypj2BtnNext = props => { const handleSalveWydm2BtnPre = props => { const listName = "salveWydm2"; const tableName = "salveWydm3"; - const { - [`${listName}Data`]: listData = [], - [`${tableName}Data`]: tableData = [] - } = props; + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; const [rowData = {}] = listData; @@ -998,23 +900,21 @@ const handleSalveWydm2BtnPre = props => { return; } - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( - item => item.sControlName === "BtnReelView" - )?.sInstruct; + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; if (!sInstructStr) return; const selectedRowKeys = [tableData[iIndex - 1].sId]; props.onSaveState( { - [`${tableName}SelectedRowKeys`]: selectedRowKeys + [`${tableName}SelectedRowKeys`]: selectedRowKeys, }, nextProps => { props.onExecInstructSet({ nextProps: nextProps, btnConfig: { showName: "上一版", - sInstruct: sInstructStr - } + sInstruct: sInstructStr, + }, }); } ); @@ -1024,10 +924,7 @@ const handleSalveWydm2BtnPre = props => { const handleSalveWydm2BtnNext = props => { const listName = "salveWydm2"; const tableName = "salveWydm3"; - const { - [`${listName}Data`]: listData = [], - [`${tableName}Data`]: tableData = [] - } = props; + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; const [rowData = {}] = listData; @@ -1042,23 +939,21 @@ const handleSalveWydm2BtnNext = props => { return; } - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( - item => item.sControlName === "BtnReelView" - )?.sInstruct; + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; if (!sInstructStr) return; const selectedRowKeys = [tableData[iIndex + 1].sId]; props.onSaveState( { - [`${tableName}SelectedRowKeys`]: selectedRowKeys + [`${tableName}SelectedRowKeys`]: selectedRowKeys, }, nextProps => { props.onExecInstructSet({ nextProps: nextProps, btnConfig: { showName: "下一版", - sInstruct: sInstructStr - } + sInstruct: sInstructStr, + }, }); } ); @@ -1068,10 +963,7 @@ const handleSalveWydm2BtnNext = props => { const handleSlaveWyrj2BtnPre = props => { const listName = "slaveWyrj2"; const tableName = "slaveWyrj3"; - const { - [`${listName}Data`]: listData = [], - [`${tableName}Data`]: tableData = [] - } = props; + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; const [rowData = {}] = listData; @@ -1087,23 +979,21 @@ const handleSlaveWyrj2BtnPre = props => { return; } - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( - item => item.sControlName === "BtnReelView" - )?.sInstruct; + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; if (!sInstructStr) return; const selectedRowKeys = [tableData[iIndex - 1].sId]; props.onSaveState( { - [`${tableName}SelectedRowKeys`]: selectedRowKeys + [`${tableName}SelectedRowKeys`]: selectedRowKeys, }, nextProps => { props.onExecInstructSet({ nextProps: nextProps, btnConfig: { showName: "上一版", - sInstruct: sInstructStr - } + sInstruct: sInstructStr, + }, }); } ); @@ -1113,10 +1003,7 @@ const handleSlaveWyrj2BtnPre = props => { const handleSlaveWyrj2BtnNext = props => { const listName = "slaveWyrj2"; const tableName = "slaveWyrj3"; - const { - [`${listName}Data`]: listData = [], - [`${tableName}Data`]: tableData = [] - } = props; + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; const [rowData = {}] = listData; @@ -1131,23 +1018,21 @@ const handleSlaveWyrj2BtnNext = props => { return; } - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( - item => item.sControlName === "BtnReelView" - )?.sInstruct; + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; if (!sInstructStr) return; const selectedRowKeys = [tableData[iIndex + 1].sId]; props.onSaveState( { - [`${tableName}SelectedRowKeys`]: selectedRowKeys + [`${tableName}SelectedRowKeys`]: selectedRowKeys, }, nextProps => { props.onExecInstructSet({ nextProps: nextProps, btnConfig: { showName: "下一版", - sInstruct: sInstructStr - } + sInstruct: sInstructStr, + }, }); } ); @@ -1159,10 +1044,7 @@ const handleUpDownData = props => { const listName = showTableName; const tableName = showTableName.substr(0, showTableName.length - 1) + 3; - const { - [`${listName}Data`]: listData = [], - [`${tableName}Data`]: tableData = [] - } = props; + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; const [rowData = {}] = listData; @@ -1177,36 +1059,31 @@ const handleUpDownData = props => { return; } - if ( - ["BtnRight.NextCom"].includes(sFieldName) && - iIndex === tableData.length - 1 - ) { + if (["BtnRight.NextCom"].includes(sFieldName) && iIndex === tableData.length - 1) { message.info("已是最后一条数据!"); return; } - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( - item => item.sControlName === "BtnReelView" - )?.sInstruct; + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; if (!sInstructStr) return; const info = { "BtnRight.PriorCom": { index: iIndex - 1, message: "上一版" }, - "BtnRight.NextCom": { index: iIndex + 1, message: "下一版" } + "BtnRight.NextCom": { index: iIndex + 1, message: "下一版" }, }[sFieldName] || { index: iIndex, message: "当前" }; const selectedRowKeys = [tableData[info.index].sId]; props.onSaveState( { - [`${tableName}SelectedRowKeys`]: selectedRowKeys + [`${tableName}SelectedRowKeys`]: selectedRowKeys, }, nextProps => { props.onExecInstructSet({ nextProps: nextProps, btnConfig: { showName: info.message, - sInstruct: sInstructStr - } + sInstruct: sInstructStr, + }, }); } ); @@ -1220,7 +1097,7 @@ const mesTableChange2 = (props, tableName) => { delete tableDataNew[0].tConnectDate; props.onSaveState({ - [`${tableName}Data`]: tableDataNew + [`${tableName}Data`]: tableDataNew, }); }; @@ -1257,10 +1134,7 @@ const mesTableChange3 = (props, tableName) => { } const checkTime = moment(tConnectDate); - if ( - !checkTime.isSameOrAfter(startTime) || - !checkTime.isSameOrBefore(endTime) - ) { + if (!checkTime.isSameOrAfter(startTime) || !checkTime.isSameOrBefore(endTime)) { let msg = ""; if (sShift === "1" || sShift === "白班") { if (bDelayedOvertime) { @@ -1280,33 +1154,32 @@ const mesTableChange3 = (props, tableName) => { } }; - const handleGetRefreshStatus = props => { const { refreshTableListCount = 0 } = props; if (!refreshTableListCount) { - message.warning('请先等待页面初始化加载完成!'); + message.warning("请先等待页面初始化加载完成!"); return true; } else { return false; } -} +}; // 质量巡检-巡检项目-所有巡检按钮 const handleZlxjCheck = async (props, btnName) => { const { table0Data = [], table1Data = [], refreshTableListCount = 0 } = props; const { sTeamNo } = commonUtils.getAppData("userinfo"); if (!refreshTableListCount) { - message.warning('请先等待页面初始化加载完成!'); + message.warning("请先等待页面初始化加载完成!"); return; } const typeList = { - "BtnRight.ipqcCheck": '2', - "BtnRight.qualityCheck": '3', - "BtnRight.foremanCheck": '4', - "BtnRight.managerCheck": '5', - "BtnRight.otherCheck": '6' - } + "BtnRight.ipqcCheck": "2", + "BtnRight.qualityCheck": "3", + "BtnRight.foremanCheck": "4", + "BtnRight.managerCheck": "5", + "BtnRight.otherCheck": "6", + }; const sCurRole = typeList[btnName]; @@ -1314,39 +1187,37 @@ const handleZlxjCheck = async (props, btnName) => { if (!faceResult) return; const { name } = faceResult; if (!name) { - message.warning('人脸信息获取失败,请重新尝试!'); + message.warning("人脸信息获取失败,请重新尝试!"); return; } const table0DataNew = cloneDeep(table0Data); const table1DataNew = cloneDeep(table1Data); table0DataNew[0].sCurRole = sCurRole; - table0DataNew[0].handleType = table0DataNew[0].handleType || 'update'; + table0DataNew[0].handleType = table0DataNew[0].handleType || "update"; table1DataNew.unshift({ sId: commonUtils.createSid(), - handleType: 'add', + handleType: "add", sSReserve1: sCurRole, bSave: 1, sParentId: table0Data[0].sId, - tPollingTime: moment().format('YYYY-MM-DD HH:mm:ss'), + tPollingTime: moment().format("YYYY-MM-DD HH:mm:ss"), sPollingPerson: name, - sGroup: sTeamNo.substr(sTeamNo.length - 1, 1) === 'A' ? 'A' : 'B' + sGroup: sTeamNo.substr(sTeamNo.length - 1, 1) === "A" ? "A" : "B", }); props.onSaveState({ userfaceData: [faceResult], tempUserName: name, table0Data: table0DataNew, - table1Data: table1DataNew + table1Data: table1DataNew, }); -} +}; let loginInfo = {}; const sModelsId = "16034339700006038392152714521000"; -const mesSysbrands = commonUtils.convertStrToObj( - localStorage.getItem("mesSysbrands") -); +const mesSysbrands = commonUtils.convertStrToObj(localStorage.getItem("mesSysbrands")); const handleGetFormItem = (props, item) => { let enabledNew = true; @@ -1374,32 +1245,28 @@ const handleGetFormItem = (props, item) => { onFilterDropDownData: props.onFilterDropDownData, onSaveState: props.onSaveState, bPassWord: item.sName === "sPassWord", - style: { backgroundColor: "#eaeaea" } + style: { backgroundColor: "#eaeaea" }, }; return ( -