From f2d39455f5939851c3612848803bdca625062817 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期三, 30 十月 2024 11:31:32 +0800 Subject: [PATCH] 测试完成 --- src/views/repositoryai/templateku/configurat/measurement.vue | 8 ++++++++ src/views/repositoryai/templateku/configurat/index.vue | 2 +- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/src/views/repositoryai/templateku/configurat/index.vue b/src/views/repositoryai/templateku/configurat/index.vue index 24f2049..8c2cc6a 100644 --- a/src/views/repositoryai/templateku/configurat/index.vue +++ b/src/views/repositoryai/templateku/configurat/index.vue @@ -2181,7 +2181,7 @@ .then((res) => { this.$router.push({ path: "/knowledge/templateku/configurat/measurement", - query: { id: this.id, name: this.ruleForm.templateName }, + query: { id: this.id, name: this.ruleForm.templateName,timeout:this.ruleForm.silencetime }, }); }) .catch(() => {}); diff --git a/src/views/repositoryai/templateku/configurat/measurement.vue b/src/views/repositoryai/templateku/configurat/measurement.vue index a4f6ead..12e468a 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,9 @@ isEat: 1, }); } + timerId = setTimeout(() => { + this.sendFn(); // 涓夌鍚庤皟鐢╢allbackFunction + },this.timeout*1000); // 浼樺厛鍔犲叆閫氱敤搴撳尮閰嶆枃鏈� if (dataJson.nowQuestion.submoduleText) { this.Answerline.push({ @@ -216,6 +222,8 @@ }, sendFn() { + console.log('鍙戦��'); + // 娑堟伅鍙戦�� const obj = { type: "text", -- Gitblit v1.9.3