Browse Source

监听websocket

huangxingxing 9 months ago
parent
commit
1b7a86b264
2 changed files with 7 additions and 9 deletions
  1. 5 5
      src/control/vtkModel.js
  2. 2 4
      src/view/InfoDialoges.vue

+ 5 - 5
src/control/vtkModel.js

@@ -388,12 +388,12 @@ export class VtkModel {
         const initialValues = {
           // base: 0,
           center: [point.x, point.y, point.z],
-          height: 6,
-          radius: 1,
-          resolution: 6,
-          // height: 4.0,
-          // radius: 1,
+          // height: 10,
+          // radius: 3,
           // resolution: 6,
+          height: 10.0,
+          radius:2,
+          resolution: 6,
           direction: [
             // velocity.vector[2],
             // velocity.vector[0],

+ 2 - 4
src/view/InfoDialoges.vue

@@ -1085,14 +1085,12 @@ const websocketonmessage = (res) => {
 // Websoket连接错误事件
 const websocketonerror = (res) => {
     console.log("连接错误", res);
-    reconnect
-    websock.value.close();
+    initWebSocket();
   
 };
 // Websoket断开事件
 const websocketclose = (res) => {
     console.log("断开连接", res);
-    reconnect();
 };
 // 创建 websocket 的实例
 
@@ -1138,7 +1136,7 @@ const start = () => {
 // 组件被销毁之前,清空 sock 对象
 onBeforeUnmount(() => {
     // 关闭连接
-    websocketclose;
+    websocketclose();
     // 销毁 websocket 实例对象
     websock.value = null;
     rizhi.logs='';