From 22ce3a4c8453b54c2bfe6d582b734195f899f195 Mon Sep 17 00:00:00 2001
From: hcong <1050828145@qq.com>
Date: 星期二, 10 十二月 2024 14:59:50 +0800
Subject: [PATCH] 1. 新增socket生命周期管理、心跳机制、重连机制 2. 新增socket消息校验、解析、生成 3. 新增socket消息类型枚举类src\enum\socketMessage 3. 新增消息管理类src\socket\MessageManager 4. 新增观察者模式消息的发布订阅机制src\socket\eventBus 5. 修改后台任务页面注册后台任务状态消息并修改状态的逻辑

---
 src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
index 6348a1b..33c01fb 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
@@ -3,7 +3,6 @@
     <template #header>
       <div><el-text tag="b" size="large">鏁版嵁婧愭鏌�</el-text></div>
       <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
-      <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
     </template>
     <FormCol>
       <template v-for="(v, i) in checkResults" :key="i">
@@ -91,10 +90,24 @@
     async fetch() {
       this.loading = true;
       setTimeout(async () => {
-        const res = await _fetch();
-        this.pass = res ? res.pass : undefined;
-        this.des = res ? res.des : undefined;
-        this.loading = false;
+        if (_fetch != undefined) {
+          _fetch()
+            .then((res) => {
+              this.pass = res ? res.pass : undefined;
+              this.des = res ? res.des : undefined;
+            })
+            .catch(() => {
+              this.pass = false;
+              this.des = '缃戠粶閾炬帴閿欒';
+            })
+            .finally(() => {
+              this.loading = false;
+            });
+        } else {
+          this.pass = undefined;
+          this.des = undefined;
+          this.loading = false;
+        }
       }, 1000);
     }
   };
@@ -160,7 +173,7 @@
           });
         }),
         // 鍖哄煙鑼冨洿鍐呯殑鐩戞祴鏁版嵁鏄惁瀛樺湪銆佹暟鎹椂闂磋法搴︽槸鍚﹀畬鏁淬�佹暟鎹殑鍒濇鍒嗘瀽鏄惁瀹屾垚
-        baseCheckItem('鐜板満鐩戞祴鏁版嵁', '', () => {}),
+        baseCheckItem('鐜板満鐩戞祴鏁版嵁', ''),
         // 鍖哄煙鑼冨洿鍐呯殑姣忎釜鐩戠鐐逛綅涓庣洃娴嬩华鍣ㄧ殑鍖归厤璁板綍鏄惁瀛樺湪锛岀己澶辨儏鍐电瓑
         baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => {
           return userMapApi.fetchDeviceMap(this.areaInfo).then((res) => {
@@ -192,14 +205,12 @@
             return { pass, des };
           });
         }),
+        // complaintApi.fetchComplaints();
         // 鍖哄煙鑼冨洿鍐呯殑淇¤鎶曡瘔璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
-        baseCheckItem('淇¤鎶曡瘔', '', () => {
-          // complaintApi.fetchComplaints();
-        }),
+        baseCheckItem('淇¤鎶曡瘔', ''),
+        // complaintApi.fetchPunishment();
         // 鍖哄煙鑼冨洿鍐呯殑琛屾斂澶勭綒璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
-        baseCheckItem('琛屾斂澶勭綒', '', () => {
-          // complaintApi.fetchPunishment();
-        })
+        baseCheckItem('琛屾斂澶勭綒', '')
       ]
     };
   },
@@ -253,7 +264,7 @@
       //   online: true,
       //   sourceType: v.sourceType
       // };
-      this.areaInfo = value
+      this.areaInfo = value;
 
       this.checkResults.forEach((e) => {
         e.fetch();

--
Gitblit v1.9.3