zhangqun 11 months ago
parent 71027731ef
commit 1950f47e09
  1. 4
      common/globalJs/globalJs.js
  2. 4
      manifest.json
  3. 39
      pages/index/detail.vue
  4. 3
      pages/knowledge/index.vue

@ -2,8 +2,8 @@
// #ifdef APP-PLUS || MP // #ifdef APP-PLUS || MP
// const baseUrl = "http://116.62.210.143:9002"; // const baseUrl = "http://116.62.210.143:9002";
// const baseUrl = "http://118.89.79.160:8800/HiatmpPro"; // const baseUrl = "http://118.89.79.160:8800/HiatmpPro";
const baseUrl = "http://49.235.207.167:8800/HiatmpPro"; // const baseUrl = "http://49.235.207.167:8800/HiatmpPro";
// const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro"; const baseUrl = "http://219.147.31.25:30001/tht-app-api/HiatmpPro";
const chatUrl = "http://219.147.31.25:30001/hitap"; const chatUrl = "http://219.147.31.25:30001/hitap";
// #endif // #endif
// #ifdef H5 // #ifdef H5

@ -135,8 +135,8 @@
"https" : false, "https" : false,
"proxy" : { "proxy" : {
"/HiatmpPro" : { "/HiatmpPro" : {
"target" : "http://49.235.207.167:8800", // "target" : "http://49.235.207.167:8800",
// "target" : "http://219.147.31.25:30001/tht-app-api", "target" : "http://219.147.31.25:30001/tht-app-api",
"changeOrigin" : true, "changeOrigin" : true,
"secure" : false, "secure" : false,
"pathRewrite" : { "pathRewrite" : {

@ -229,7 +229,7 @@ export default {
}; };
}, },
onLoad(options) { onLoad(options) {
console.log(options) console.log(options);
let params = options; let params = options;
// params.deptId = "3702000000"; // params.deptId = "3702000000";
// params.id = "37020017609"; // params.id = "37020017609";
@ -243,7 +243,7 @@ export default {
str += "路段名:" + params.roadName; str += "路段名:" + params.roadName;
this.title = params.roadName + "智能排查"; this.title = params.roadName + "智能排查";
} }
if (params.id) { if (params.id != "undefined") {
str += ",id:" + params.id; //params.id str += ",id:" + params.id; //params.id
} }
console.log(params); console.log(params);
@ -251,7 +251,12 @@ export default {
this.queryChat("开始隐患排查," + str); this.queryChat("开始隐患排查," + str);
} else { } else {
// this.SSE("," + str, "1"); // this.SSE("," + str, "1");
this.queryChat("开始隐患排查," + str); if (params.id != "undefined") {
this.queryChat("开始隐患排查," + str);
} else {
this.$.toast('缺少相关信息');
}
// if(this.msgListA.length==0){ // if(this.msgListA.length==0){
// this.SSE("," + str, '1') // this.SSE("," + str, '1')
// }else{ // }else{
@ -373,7 +378,7 @@ export default {
async queryChat(voiceText) { async queryChat(voiceText) {
// console.log(voiceText,"voiceText"); // console.log(voiceText,"voiceText");
this.loading = true; this.loading = true;
const [err, res] = await uni.request({ const [err, res] = await uni.request({
// url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', // url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat',
url: $.chatUrl + "/chat", url: $.chatUrl + "/chat",
@ -403,7 +408,7 @@ export default {
// "history": [] // "history": []
}, },
}); });
if (res && res.data && res.data.code == 200) { if (res && res.data && res.data.code == 200) {
// console.log('request success', res.data) // console.log('request success', res.data)
const { result = {} } = res.data; const { result = {} } = res.data;
@ -445,20 +450,17 @@ export default {
}; };
this.msgList.push(newQuestion); // this.msgList.push(newQuestion); //
// this.$store.commit('setMSg_List', this.msgList); // this.$store.commit('setMSg_List', this.msgList);
}, },
scrollBottom() { scrollBottom() {
this.$nextTick(() => { this.$nextTick(() => {
// const height = // const height =
// this.$refs.scrollView && // this.$refs.scrollView &&
// this.$refs.scrollView.$refs && // this.$refs.scrollView.$refs &&
// this.$refs.scrollView.$refs.content // this.$refs.scrollView.$refs.content
// ? this.$refs.scrollView.$refs.content.scrollHeight // ? this.$refs.scrollView.$refs.content.scrollHeight
// : 0; // : 0;
// this.scrollTop = height; // this.scrollTop = height;
this.scrollTop = this.scrollTop + 1 this.scrollTop = this.scrollTop + 1;
}); });
}, },
// //
@ -525,7 +527,6 @@ export default {
} }
clearInterval(timer); clearInterval(timer);
} }
}, 50); }, 50);
} else { } else {
this.msgList = [ this.msgList = [
@ -584,7 +585,9 @@ export default {
// this.addQuestion(str, "0"); // this.addQuestion(str, "0");
// this.SSE(jsonArr, "0"); // this.SSE(jsonArr, "0");
this.changeMsgList("0", str); this.changeMsgList("0", str);
this.queryChat(jsonArr);
let j = jsonArr.join(",");
this.queryChat(j);
} }
} }
}, },

@ -336,7 +336,8 @@ export default {
// this.addQuestion(str, "0"); // this.addQuestion(str, "0");
// this.SSE(jsonArr, "0"); // this.SSE(jsonArr, "0");
this.changeMsgList("0", str); this.changeMsgList("0", str);
this.queryChat(jsonArr); let j = jsonArr.join(',')
this.queryChat(j);
} }
} }
}, },

Loading…
Cancel
Save