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 | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/views/repositoryai/templateku/configurat/measurement.vue b/src/views/repositoryai/templateku/configurat/measurement.vue
index e631cc8..eef021a 100644
--- a/src/views/repositoryai/templateku/configurat/measurement.vue
+++ b/src/views/repositoryai/templateku/configurat/measurement.vue
@@ -66,7 +66,7 @@
:key="item.aaa"
>
<div class="dev-text">
- {{ index + 1 }}銆�<span>{{ item.questionText }}</span>
+ {{ index + 1 }}銆�<span>{{ item.scriptContent }}</span>
</div>
<div class="dev-xx" v-if="item.valueType == 1">
@@ -105,13 +105,14 @@
return {
answer: "", //鍥炵瓟
id: null,
- TemplateName: "闅忚妯$増鍚嶇О", //妯$増鍚�
+ TemplateName: "闅忚妯℃澘鍚嶇О", //妯℃澘鍚�
radio: "1",
userid: "",
input: "杩樹笉閿�",
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);
@@ -158,7 +160,7 @@
};
// 鍙戣捣ws璇锋眰
sendWebsocket(
- "ws://localhost:8089/chat?userId=1",
+ "ws://192.168.2.10:8095/chat?userId=1",
obj,
this.wsMessage,
this.wsError
@@ -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({
@@ -190,9 +198,9 @@
value: dataJson.jsy,
isEat: 1,
});
- } else if (dataJson.nowQuestion.questionText) {
+ } else if (dataJson.nowQuestion.scriptContent) {
this.Answerline.push({
- value: dataJson.nowQuestion.questionText,
+ value: dataJson.nowQuestion.scriptContent,
isEat: 1,
});
}
@@ -205,6 +213,8 @@
});
return item;
});
+ console.log(this.questionList);
+
// IMUI.appendMessage(data);
},
@@ -214,6 +224,8 @@
},
sendFn() {
+ console.log('鍙戦��');
+
// 娑堟伅鍙戦��
const obj = {
type: "text",
@@ -224,7 +236,7 @@
console.log(obj, "鍏ュ弬");
// 鍙戣捣ws璇锋眰
sendWebsocket(
- "ws://localhost:8089/chat?userId=1",
+ "ws://192.168.2.10:8095/chat?userId=1",
obj,
this.wsMessage,
this.wsError
--
Gitblit v1.9.3