Commit 86afb719021d6f7668930d8899f4109909ebb537

Authored by Min
1 parent b1ef056e

1.处理单据修改点击不动问题

src/components/Common/CommonBillEvent.js
... ... @@ -2069,7 +2069,36 @@ export default (ChildComponent) => {
2069 2069 }
2070 2070 }
2071 2071 };
2072   - this.props.handleSendSocketMessage('update', 'showMsg', currentId, userinfo.sId, null, null);
  2072 + // 检查WebSocket连接状态
  2073 + const isWebSocketConnected = app.webSocket && app.webSocket.readyState === 1; // 1表示连接正常
  2074 + console.log('检查WebSocket连接状态', isWebSocketConnected);
  2075 + if (isWebSocketConnected) {
  2076 + // 发送WebSocket消息
  2077 + this.props.handleSendSocketMessage('update', 'showMsg', currentId, userinfo.sId, null, null);
  2078 +
  2079 + // 添加超时机制,防止WebSocket断链导致按钮一直加载
  2080 + setTimeout(() => {
  2081 + // 检查是否仍然处于加载状态
  2082 + if (this.props.loading) {
  2083 + this.props.onSaveState({ loading: false });
  2084 + console.log('网络连接超时,请检查网络后重试');
  2085 + }
  2086 + }, 10000); // 10秒超时
  2087 + } else {
  2088 + // WebSocket未连接,直接执行编辑操作
  2089 + // console.log('WebSocket未连接,直接执行编辑操作');
  2090 + try {
  2091 + await this.handleGetData(masterConfig, slaveConfig, checkConfig,'update');
  2092 + if (cb && typeof cb === 'function') {
  2093 + this.props.onSaveState({ enabled: false, calculated: false }, () => { cb(); });
  2094 + } else {
  2095 + this.props.onSaveState({ enabled: true, calculated: false, loading: false });
  2096 + }
  2097 + } catch (error) {
  2098 + this.props.onSaveState({ loading: false });
  2099 + message.error('修改操作失败,请重试');
  2100 + }
  2101 + }
2073 2102 };
2074 2103 /** 表单回带 */
2075 2104 handleForm = (form) => {
... ...
src/components/Common/PersonCenter/PersonCenterAddFace.js
... ... @@ -10,7 +10,7 @@ const PersonCenterAddFace = Form.create({
10 10 mapPropsToFields(props) {},
11 11 })(props => {
12 12 const { onCancel, handleModalClose, addFaceVisible } = props;
13   - console.log('sssaddFaceVisibles', addFaceVisible);
  13 +
14 14 const GetFace = commonFunc.showMessage(props.app.commonConst, "GetFace"); /* 在线用户 */
15 15 return (
16 16 <div>
... ...