diff --git a/src/components/Common/CommonListEvent.js b/src/components/Common/CommonListEvent.js index 873ea78..deae3d8 100644 --- a/src/components/Common/CommonListEvent.js +++ b/src/components/Common/CommonListEvent.js @@ -1750,6 +1750,9 @@ export default (ChildComponent) => { const iConfigIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === sNotRepeatColumn); const sNotRepeatShowName = iConfigIndex > -1 ? slaveConfig.gdsconfigformslave[iConfigIndex].showName : ''; message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseSame') + sNotRepeatShowName); // 请选择相同 + this.props.onSaveState({ + loading: false, + }); return; } } @@ -1780,33 +1783,33 @@ export default (ChildComponent) => { this.props.app.webSocket.onmessageTmp = (msg) => { const rtmsg = JSON.parse(msg.data); if (rtmsg.action === 'execute') { - if (rtmsg.msg === 'continue') { - const { formRoute } = this.state; - if (commonUtils.isNotEmptyArr(copyToData)) { - copyTo.name = name; - copyTo.config = copyToConfig; - if (name !== 'BtnCopyTo.workOrderToWorkOrder' && !name.includes('BtnCopyTo.tmpInfo') && !name.includes('btncopyto.tmpinfobysql')) { - copyTo.masterData = copyToData[0]; - copyTo.slaveData = copyToData; - copyTo.copyOtherData = addcopyOther; - copyTo.srcFormRoute = this.props.formRoute; /* 未清来源路由 */ - } - copyTo.copyToDataSid = sId?.split(','); - dispatch({ - type: 'content/onRouter', - payload: { - url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`, /* 接口地址 */ - copyTo, - refresh: getData.bind(this, slaveConfig, slaveFilterCondition, commonUtils.isEmpty(slavePagination) ? 0 : slavePagination.current, slavePagination.pageSize, slaveOrderBy, isRefresh, undefined, undefined, treeFilterCondition), - sSrcModelsId: this.props.sModelsId, - }, - }); - } else { - message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择数据 + if (rtmsg.msg !== 'continue') { + message.warning(rtmsg.handlers + commonFunc.showMessage(app.commonConst, 'InOperation'));/* 在操作,请稍后再操作! */ + } + const { formRoute } = this.state; + if (commonUtils.isNotEmptyArr(copyToData)) { + copyTo.name = name; + copyTo.config = copyToConfig; + if (name !== 'BtnCopyTo.workOrderToWorkOrder' && !name.includes('BtnCopyTo.tmpInfo') && !name.includes('btncopyto.tmpinfobysql')) { + copyTo.masterData = copyToData[0]; + copyTo.slaveData = copyToData; + copyTo.copyOtherData = addcopyOther; + copyTo.srcFormRoute = this.props.formRoute; /* 未清来源路由 */ } + copyTo.copyToDataSid = sId?.split(','); + dispatch({ + type: 'content/onRouter', + payload: { + url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`, /* 接口地址 */ + copyTo, + refresh: getData.bind(this, slaveConfig, slaveFilterCondition, commonUtils.isEmpty(slavePagination) ? 0 : slavePagination.current, slavePagination.pageSize, slaveOrderBy, isRefresh, undefined, undefined, treeFilterCondition), + sSrcModelsId: this.props.sModelsId, + }, + }); } else { - message.warning(rtmsg.handlers + commonFunc.showMessage(app.commonConst, 'InOperation'));/* 在操作,请稍后再操作! */ + message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择数据 } + } }; let sId = sIdArray.toString(); @@ -1815,21 +1818,46 @@ export default (ChildComponent) => { const values = { sSlaveId: sId }; const dataReturn = (await commonServices.postValueService(token, values, dataUrl)).data; if (dataReturn.code === 1) { - const sendSocketMessage = this.props.handleSendSocketMessage; - if (sIdArray?.length > 10) { - sId = sIdArray?.[0]; - } - if (dataReturn.dataset.rows.length > 0) { - confirm({ - title: commonFunc.showMessage(app.commonConst, 'beUsedToNew'), /* 单据已存在,是否填写新单据 */ - onOk() { - sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null); - }, - onCancel() { - }, - }); + if (commonUtils.isNotEmptyArr(copyToData) && copyToData.length > 0) { /* 复制到数据大于200 就不走websoket */ + if (commonUtils.isNotEmptyArr(copyToData)) { + copyTo.name = name; + copyTo.config = copyToConfig; + copyTo.srcFormRoute = this.props.formRoute; /* 未清来源路由 */ + if (name !== 'BtnCopyTo.workOrderToWorkOrder' && !name.includes('BtnCopyTo.tmpInfo') && !name.includes('ByQuo') + && !name?.toLowerCase()?.includes('tmpinfobysql') + && !name.includes('ByOrder') && !name.includes('ByWork')) { + copyTo.masterData = copyToData[0]; + copyTo.slaveData = copyToData; + copyTo.copyOtherData = addcopyOther; + } + dispatch({ + type: 'content/onRouter', + payload: { + url: `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sActiveId}?sModelsId=${sActiveId}&sName=${formRoute}`, /* 接口地址 */ + copyTo, + refresh: getData.bind(this, slaveConfig, slaveFilterCondition, commonUtils.isEmpty(slavePagination) ? 0 : slavePagination.current, slavePagination.pageSize, slaveOrderBy, isRefresh, undefined, undefined, treeFilterCondition), + }, + }); + } else { + message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择数据 + } } else { - sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null); + const sendSocketMessage = this.props.handleSendSocketMessage; + if (sIdArray?.length > 10) { + sId = sIdArray?.[0]; + } + if (dataReturn.dataset.rows.length > 0) { + confirm({ + title: commonFunc.showMessage(app.commonConst, 'beUsedToNew'), /* 单据已存在,是否填写新单据 */ + onOk() { + sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null); + }, + onCancel() { + }, + }); + } else { + sendSocketMessage('copy', 'execute', sId, userinfo.sId, null, null); + } } } else { this.props.getServiceError(dataReturn); diff --git a/src/components/Common/commonKeyUp.js b/src/components/Common/commonKeyUp.js index 96b5160..5db7b3a 100644 --- a/src/components/Common/commonKeyUp.js +++ b/src/components/Common/commonKeyUp.js @@ -41,7 +41,6 @@ export function getKeyUpEvent(name, sFieldName, tableConfig, masterData, tableDa const sAssignField = tableConfig.gdsconfigformslave[iConfigIndex].sOnChangeAssignField; const sButtonParam = tableConfig.gdsconfigformslave[iConfigIndex].sButtonParam; /* 设置多级联动 */ - console.log('sAssignField:', sAssignField); // 根据赋值字段类型分发处理逻辑 /* keyUp联动其他表 */ @@ -500,7 +499,7 @@ function formatTableData(originObj) { if (originObj == null || typeof originObj !== 'object') { return {}; } - + const newObj = {}; // 遍历原始对象的键值对 Object.entries(originObj).forEach(([key, value]) => { diff --git a/src/components/IndexCenter/IndexCenter.js b/src/components/IndexCenter/IndexCenter.js index 2cbc598..e7eb47b 100644 --- a/src/components/IndexCenter/IndexCenter.js +++ b/src/components/IndexCenter/IndexCenter.js @@ -784,7 +784,7 @@ class IndexCenter extends Component { .replace('{token}', token) .replace('{ipAddress}', addressStr) .replace('{ipPadAddress}', ipPadAddress) : ''; - console.log('iframeUrl', iframeUrl); + const ExtraWrap = (
diff --git a/src/models/app.js b/src/models/app.js index a1676e5..a5d7c0e 100644 --- a/src/models/app.js +++ b/src/models/app.js @@ -567,6 +567,8 @@ export default { }, /** 返回新页签 */ *createWebSocket({ payload }, { put, select }) { + // console.log("WebSocket 功能已被禁用"); + // return null; const { reStart, dispatch } = payload; const userinfo = yield select(state => state.app.userinfo); let url = `${config.ws_host}websocket/${userinfo.sId}`; @@ -714,11 +716,11 @@ export default { } else { dispatch({ type: "app/throwError", payload: { code: -2, msg: rtmsg.msg } }); } - } else if (rtmsg.action === "kpimodle") { + } else if (rtmsg.action === "kpi1modle") { // 主页数据 const msgData = JSON.parse(msg.data); dispatch({ type: "app/saveKpiData", payload: { kpiData: msgData.msg } }); - } else if (rtmsg.action === "workMsg") { + } else if (rtmsg.action === "wor2kMsg") { // 工单系统消息 const msgData = JSON.parse(msg.data); dispatch({ type: "app/saveWorkMsg", payload: { workMsg: msgData.msg } }); diff --git a/src/routes/indexPage.js b/src/routes/indexPage.js index 5c03e6d..bd60427 100644 --- a/src/routes/indexPage.js +++ b/src/routes/indexPage.js @@ -26,34 +26,34 @@ function IndexPage({ app }) { }; }, []); - const { webSocket, userinfo } = app; - const { sId } = userinfo; - const testMsg = JSON.stringify({ flag: "connectTest", sId: "test", sendFrom: sId }); - - const timer = useRef(null); - - const { url } = webSocket || {}; - const wsRef = useRef(webSocket); - const xlyWsTimerFun = () => { - clearInterval(timer.current); - // 重新启动定时器 - timer.current = setInterval(() => { - if (wsRef.current && wsRef.current.readyState === WebSocket.OPEN) { - wsRef.current.send(testMsg); - } - }, 20000); - } - useEffect(() => { - if (url) { - wsRef.current = webSocket; - xlyWsTimerFun(); - window.xlyWsTimerFun = xlyWsTimerFun; - } - return () => { - window.xlyWsTimerFun = null; - clearInterval(timer.current); - }; - }, [url]); + // const { webSocket, userinfo } = app; + // const { sId } = userinfo; + // const testMsg = JSON.stringify({ flag: "connectTest", sId: "test", sendFrom: sId }); + // + // const timer = useRef(null); + // + // const { url } = webSocket || {}; + // const wsRef = useRef(webSocket); + // const xlyWsTimerFun = () => { + // clearInterval(timer.current); + // // 重新启动定时器 + // timer.current = setInterval(() => { + // if (wsRef.current && wsRef.current.readyState === WebSocket.OPEN) { + // wsRef.current.send(testMsg); + // } + // }, 20000); + // } + // useEffect(() => { + // if (url) { + // wsRef.current = webSocket; + // xlyWsTimerFun(); + // window.xlyWsTimerFun = xlyWsTimerFun; + // } + // return () => { + // window.xlyWsTimerFun = null; + // clearInterval(timer.current); + // }; + // }, [url]); // 根据用户语言选择对应的语言包 const getLocale = () => {