|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="detail" :data="params" :change:data="renderjs.renderjsGet" :imgArr="imgArr" |
|
|
|
|
:change:imgArr="renderjs.getImgArr"> |
|
|
|
|
:change:imgArr="renderjs.getImgArr" :check="check" :change:check="renderjs.checkGet" :taskId="taskId" :change:taskId="renderjs.taskIdGet" > |
|
|
|
|
<!-- <view class="Content BorderBox Width100"> |
|
|
|
|
<top-title |
|
|
|
|
:is-show-left="true" |
|
|
|
@ -155,7 +155,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<vVoice :disabled="loading" v-model="inputValue" @confirm="handleSend" @imageChoose="chooseImage" |
|
|
|
|
:showUpload="true" @dataSend="receiveRenderData" :taskId="taskId"/> |
|
|
|
|
:showUpload="true" @dataSend="receiveRenderData" :taskId="taskId" :params="params" /> |
|
|
|
|
<u-popup :show="showYinDao" @close="showYinDao = false"> |
|
|
|
|
<view class="custom-pop-head"> |
|
|
|
|
<view class="title">{{ dataYinDao.title }}</view> |
|
|
|
@ -230,7 +230,8 @@ |
|
|
|
|
timer: '', |
|
|
|
|
tempStr: '', |
|
|
|
|
imgArr: [], |
|
|
|
|
taskId:'' |
|
|
|
|
taskId: '', |
|
|
|
|
check: '' |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -244,6 +245,7 @@ |
|
|
|
|
// params.taskId = "000001"; |
|
|
|
|
// params.userId = "admin1"; |
|
|
|
|
this.params = params; |
|
|
|
|
console.log(this.params, 'paramsparamsparamsparamsparamsparamsparams') |
|
|
|
|
this.getChatHistory() |
|
|
|
|
let str = ""; |
|
|
|
|
if (params.roadName) { |
|
|
|
@ -294,7 +296,6 @@ |
|
|
|
|
// watch第一次绑定值的时候不会执行监听,修改数据才会触发函数 |
|
|
|
|
timerCount(newVal, oldVal) { |
|
|
|
|
if (this.tempStr[newVal]) { |
|
|
|
|
console.log('newValnewValnewValnewVal', this.tempStr, newVal, this.tempStr[newVal]) |
|
|
|
|
this.msgList[this.msgList.length - 1].data += this.tempStr[newVal] |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
@ -338,6 +339,7 @@ |
|
|
|
|
data: '', |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
console.log('contentcontentcontent', content) |
|
|
|
|
this.tempStr = content |
|
|
|
|
if (!this.timer) { |
|
|
|
|
this.timer = setInterval(() => { |
|
|
|
@ -391,7 +393,6 @@ |
|
|
|
|
sseBack(ev) { |
|
|
|
|
let answerId = '1' |
|
|
|
|
let res = JSON.parse(ev.data); |
|
|
|
|
console.log('resresresresresresresres', res) |
|
|
|
|
this.taskId = res.result.taskId |
|
|
|
|
if (res?.code == 200 && res.result) { |
|
|
|
|
let content = res.result.data.content |
|
|
|
@ -563,7 +564,6 @@ |
|
|
|
|
// signal: ctrl.signal, |
|
|
|
|
// openWhenHidden: true, |
|
|
|
|
// onopen: () => { |
|
|
|
|
// console.log('onopneSSE') |
|
|
|
|
// uni.showToast({ |
|
|
|
|
// title: 'open触发' |
|
|
|
|
// }) |
|
|
|
@ -984,6 +984,7 @@ |
|
|
|
|
filePath: url, |
|
|
|
|
name: "file", |
|
|
|
|
success: (res) => { |
|
|
|
|
console.log('********************', res) |
|
|
|
|
resolve(res.data); |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
@ -996,6 +997,8 @@ |
|
|
|
|
} else { |
|
|
|
|
text = item; |
|
|
|
|
} |
|
|
|
|
this.check = text |
|
|
|
|
return |
|
|
|
|
this.handleSend(text); |
|
|
|
|
}, |
|
|
|
|
handleGroup2(i) { |
|
|
|
@ -1014,7 +1017,8 @@ |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
firstFlag: false, |
|
|
|
|
params: {} |
|
|
|
|
params: {}, |
|
|
|
|
taskId:'' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted(option) { |
|
|
|
@ -1022,14 +1026,12 @@ |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getImgArr(res) { |
|
|
|
|
console.log('图片变化', res) |
|
|
|
|
if (res.length) { |
|
|
|
|
this.newSSE(res.join(), '0') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
renderjsGet(val) { |
|
|
|
|
if (this.firstFlag) { |
|
|
|
|
return |
|
|
|
|
} else { |
|
|
|
|
this.params = val; |
|
|
|
|
let str = ""; |
|
|
|
|
if (this.params.roadName) { |
|
|
|
@ -1039,11 +1041,36 @@ |
|
|
|
|
if (this.params.id != "undefined") { |
|
|
|
|
str += ",id:" + this.params.id; //params.id |
|
|
|
|
} |
|
|
|
|
if (this.firstFlag) { |
|
|
|
|
return |
|
|
|
|
} else { |
|
|
|
|
this.newSSE('开始隐患排查' + str, '1') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
taskIdGet(taskId){ |
|
|
|
|
this.taskId = taskId |
|
|
|
|
}, |
|
|
|
|
checkGet(check) { |
|
|
|
|
if (check) { |
|
|
|
|
this.newSSE(check, '0') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
newSSE(voiceText, answerId = '') { |
|
|
|
|
console.log('排查chat发送', voiceText, { |
|
|
|
|
voiceText, |
|
|
|
|
sceneFlag: "", |
|
|
|
|
// sessionId: $.getData('sessionId'), |
|
|
|
|
multiType: "", |
|
|
|
|
userId: this.params.userId || '', |
|
|
|
|
deptId: this.params.deptId && this.params.deptId != 'undefined' ? this.params |
|
|
|
|
.deptId : '', |
|
|
|
|
stream: true, |
|
|
|
|
type: "1", |
|
|
|
|
id: this.params.id || '', |
|
|
|
|
taskId: this.taskId , |
|
|
|
|
sectionId: this.params.sectionId || '', |
|
|
|
|
sectionType: this.params.sectionType || '', |
|
|
|
|
}) |
|
|
|
|
// const ctrl = new AbortController(); |
|
|
|
|
fetchEventSource($.chatUrl + "/chat", { |
|
|
|
|
method: "POST", |
|
|
|
@ -1056,21 +1083,21 @@ |
|
|
|
|
sceneFlag: "", |
|
|
|
|
// sessionId: $.getData('sessionId'), |
|
|
|
|
multiType: "", |
|
|
|
|
userId: this.params.userId, |
|
|
|
|
deptId: this.params.deptId, |
|
|
|
|
userId: this.params.userId || '', |
|
|
|
|
deptId: this.params.deptId && this.params.deptId != 'undefined' ? this.params |
|
|
|
|
.deptId : '', |
|
|
|
|
stream: true, |
|
|
|
|
type: "1", |
|
|
|
|
id: this.params.id, |
|
|
|
|
taskId: this.params.taskId, |
|
|
|
|
sectionId: this.params.sectionId, |
|
|
|
|
sectionType: this.params.sectionType, |
|
|
|
|
id: this.params.id || '', |
|
|
|
|
taskId: this.params.taskId || '', |
|
|
|
|
sectionId: this.params.sectionId || '', |
|
|
|
|
sectionType: this.params.sectionType || '', |
|
|
|
|
}), |
|
|
|
|
// signal: ctrl.signal, |
|
|
|
|
openWhenHidden: true, |
|
|
|
|
onopen: () => { |
|
|
|
|
console.log('onopneSSE') |
|
|
|
|
}, |
|
|
|
|
onopen: () => {}, |
|
|
|
|
onmessage: (ev) => { |
|
|
|
|
console.log('chat内容返回', ev); |
|
|
|
|
//发送数据到逻辑层 |
|
|
|
|
this.$ownerInstance.callMethod('sseBack', ev); |
|
|
|
|
}, |
|
|
|
|