Browse Source

fix: 流程引擎代码样式3

liuc 3 months ago
parent
commit
89d564b040
1 changed files with 15 additions and 7 deletions
  1. 15 7
      src/views/flow/stFormWork/formWork.vue

+ 15 - 7
src/views/flow/stFormWork/formWork.vue

@@ -487,8 +487,6 @@ onMounted(async () => {
       targetElement.insertAdjacentElement('afterend', newDiv);
     }
   }
-
-  WebSocketStore.connect();
   for (let i = 0; i < customComponent.length; i++) {
     if (document.getElementById(customComponent[i].pid)) {
       customComponent[i].visible = true;
@@ -497,6 +495,11 @@ onMounted(async () => {
       divElement.appendChild(pElement);
     }
   }
+  try {
+    WebSocketStore.connect();
+  } catch (websocketErr) {
+
+  }
 });
 
 const viewListContent = ref([])
@@ -1003,11 +1006,16 @@ const findDynamicObjects = (formConfig) => {
   return dynamicElements;
 }
 const sendWebsocket = (msg) => {
-  const socketMap = {};
-  socketMap.userId = userStore.employeeId;
-  socketMap.type = 'REFRESH';
-  socketMap.message = msg;
-  WebSocketStore.send(JSON.stringify(socketMap));
+  try {
+    const socketMap = {};
+    socketMap.userId = userStore.employeeId;
+    socketMap.type = 'REFRESH';
+    socketMap.message = msg;
+    WebSocketStore.send(JSON.stringify(socketMap));
+  } catch (e) {
+
+  }
+
 }
 // 已阅
 const handleReadFlow = () => {