diff --git a/src/components/Common/CommonBillEvent.js b/src/components/Common/CommonBillEvent.js index 7aaeeab..7e66248 100644 --- a/src/components/Common/CommonBillEvent.js +++ b/src/components/Common/CommonBillEvent.js @@ -2069,7 +2069,36 @@ export default (ChildComponent) => { } } }; - this.props.handleSendSocketMessage('update', 'showMsg', currentId, userinfo.sId, null, null); + // 检查WebSocket连接状态 + const isWebSocketConnected = app.webSocket && app.webSocket.readyState === 1; // 1表示连接正常 + console.log('检查WebSocket连接状态', isWebSocketConnected); + if (isWebSocketConnected) { + // 发送WebSocket消息 + this.props.handleSendSocketMessage('update', 'showMsg', currentId, userinfo.sId, null, null); + + // 添加超时机制,防止WebSocket断链导致按钮一直加载 + setTimeout(() => { + // 检查是否仍然处于加载状态 + if (this.props.loading) { + this.props.onSaveState({ loading: false }); + console.log('网络连接超时,请检查网络后重试'); + } + }, 10000); // 10秒超时 + } else { + // WebSocket未连接,直接执行编辑操作 + // console.log('WebSocket未连接,直接执行编辑操作'); + try { + await this.handleGetData(masterConfig, slaveConfig, checkConfig,'update'); + if (cb && typeof cb === 'function') { + this.props.onSaveState({ enabled: false, calculated: false }, () => { cb(); }); + } else { + this.props.onSaveState({ enabled: true, calculated: false, loading: false }); + } + } catch (error) { + this.props.onSaveState({ loading: false }); + message.error('修改操作失败,请重试'); + } + } }; /** 表单回带 */ handleForm = (form) => { diff --git a/src/components/Common/PersonCenter/PersonCenterAddFace.js b/src/components/Common/PersonCenter/PersonCenterAddFace.js index f291b34..f0d5e71 100644 --- a/src/components/Common/PersonCenter/PersonCenterAddFace.js +++ b/src/components/Common/PersonCenter/PersonCenterAddFace.js @@ -10,7 +10,7 @@ const PersonCenterAddFace = Form.create({ mapPropsToFields(props) {}, })(props => { const { onCancel, handleModalClose, addFaceVisible } = props; - console.log('sssaddFaceVisibles', addFaceVisible); + const GetFace = commonFunc.showMessage(props.app.commonConst, "GetFace"); /* 在线用户 */ return (