| | |
| | | .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(() => {}); |
| | |
| | | drawer: false, |
| | | radio: "2", |
| | | code: "", |
| | | timeout: "5", |
| | | Answerline: [], |
| | | questionList: [], |
| | | }; |
| | |
| | | requstWs(message, next, file) { |
| | | console.log("连接"); |
| | | this.id = this.$route.query.id; |
| | | this.timeout = this.$route.query.timeout; |
| | | // 防止用户多次连续点击发起请求,所以要先关闭上次的ws请求。 |
| | | closeWebsocket(); |
| | | console.log(this.id); |
| | |
| | | // 接收ws返回的数据 |
| | | wsMessage(data) { |
| | | let dataJson = data; |
| | | let timerId = null; |
| | | dataJson = JSON.parse(dataJson); |
| | | dataJson = JSON.parse(dataJson); |
| | | console.log(dataJson, "数据"); |
| | |
| | | isEat: 1, |
| | | }); |
| | | } |
| | | timerId = setTimeout(() => { |
| | | this.sendFn(); // 三秒后调用fallbackFunction |
| | | },this.timeout*1000); |
| | | // 优先加入通用库匹配文本 |
| | | if (dataJson.nowQuestion.submoduleText) { |
| | | this.Answerline.push({ |
| | |
| | | }, |
| | | |
| | | sendFn() { |
| | | console.log('发送'); |
| | | |
| | | // 消息发送 |
| | | const obj = { |
| | | type: "text", |