From a7c11f44644124cf16014f972363b6a3ba9ca29a Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 30 十月 2024 15:36:25 +0800
Subject: [PATCH] 测试完成

---
 src/views/repositoryai/templateku/configurat/measurement.vue |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/views/repositoryai/templateku/configurat/measurement.vue b/src/views/repositoryai/templateku/configurat/measurement.vue
index a4f6ead..eef021a 100644
--- a/src/views/repositoryai/templateku/configurat/measurement.vue
+++ b/src/views/repositoryai/templateku/configurat/measurement.vue
@@ -112,6 +112,7 @@
       drawer: false,
       radio: "2",
       code: "",
+      timeout: "5",
       Answerline: [],
       questionList: [],
     };
@@ -147,6 +148,7 @@
     requstWs(message, next, file) {
       console.log("杩炴帴");
       this.id = this.$route.query.id;
+      this.timeout = this.$route.query.timeout;
       // 闃叉鐢ㄦ埛澶氭杩炵画鐐瑰嚮鍙戣捣璇锋眰锛屾墍浠ヨ鍏堝叧闂笂娆$殑ws璇锋眰銆�
       closeWebsocket();
       console.log(this.id);
@@ -167,6 +169,7 @@
     // 鎺ユ敹ws杩斿洖鐨勬暟鎹�
     wsMessage(data) {
       let dataJson = data;
+      let timerId = null;
       dataJson = JSON.parse(dataJson);
       dataJson = JSON.parse(dataJson);
       console.log(dataJson, "鏁版嵁");
@@ -177,6 +180,11 @@
           isEat: 1,
         });
       }
+      timerId = setTimeout(() => {
+        if (!answer) {
+          this.sendFn(); // 鍚庤皟鐢�
+        }
+    },this.timeout*1000);
       // 浼樺厛鍔犲叆閫氱敤搴撳尮閰嶆枃鏈�
       if (dataJson.nowQuestion.submoduleText) {
         this.Answerline.push({
@@ -216,6 +224,8 @@
     },
 
     sendFn() {
+      console.log('鍙戦��');
+
       // 娑堟伅鍙戦��
       const obj = {
         type: "text",

--
Gitblit v1.9.3