wu
2023-12-04 4c70d9f0656bbec48fa619f2ec9aa0ee12fca2c1
CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -75,7 +75,18 @@
    this.isButtonDisabled = true;
  },
  mounted() {
    window.addEventListener('beforeunload', this.closeSocket);
  },
  beforeUnmount() {
    window.removeEventListener('beforeunload', this.closeSocket);
  },
  methods: {
    closeSocket() {
      // 关闭 WebSocket 连接
      socket.close();
    },
    showdata () {
      
@@ -156,6 +167,9 @@
        socket.onerror = function () {
          console.log("websocket发生了错误");
        };
        this.$router.afterEach(function(){
          socket.close();
        })
      }
    },
    send () {