|
|
@@ -55,11 +55,12 @@ export default {
|
|
|
var chatRecord = {}
|
|
|
await this.$api.saveChatRecord(params).then(response=>{
|
|
|
if(response.code == 200){
|
|
|
- let id = response.data
|
|
|
- chatRecord = {
|
|
|
- id:id,
|
|
|
- ...params
|
|
|
- }
|
|
|
+ // let id = response.data
|
|
|
+ // chatRecord = {
|
|
|
+ // id:id,
|
|
|
+ // ...params
|
|
|
+ // }
|
|
|
+ chatRecord = response.data
|
|
|
}
|
|
|
})
|
|
|
return chatRecord
|
|
|
@@ -75,46 +76,44 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- let inputs = {
|
|
|
- fileUrl:'http://192.168.2.24:8803/fileManager/downloadFile?fileId='+this.notice_file.guid,
|
|
|
- patent_fileUrls:JSON.stringify(patent_fileUrls),
|
|
|
- app_file_guid:this.relevant_file.app_file.guid,
|
|
|
- modify_file_guid:this.relevant_file.modify_file.guid,
|
|
|
- changeClaim:this.changeClaim.changeClaim + '',
|
|
|
- claim:this.changeClaim.claim,
|
|
|
- near_index:this.changeClaim.near_index,
|
|
|
- main_claim_reason:JSON.stringify(this.main_claim_reason),
|
|
|
- claimChangeSuggestion:this.changeClaim.claimChangeSuggestion,
|
|
|
- operation:operation+'',
|
|
|
- query:this.difyQuery
|
|
|
- }
|
|
|
- // if(lastMessage){
|
|
|
- // switch(operation){
|
|
|
- // case 4:
|
|
|
- // inputs.claimChangeSuggestion = lastMessage.answer
|
|
|
- // break;
|
|
|
- // case 5:
|
|
|
- // inputs.claim = lastMessage.answer
|
|
|
- // break;
|
|
|
- // case 6:
|
|
|
- // inputs.main_claim_reason = JSON.stringify(lastMessage.answer)
|
|
|
- // break;
|
|
|
- // }
|
|
|
+ // let inputs = {
|
|
|
+ // fileUrl:'http://192.168.2.24:8803/fileManager/downloadFile?fileId='+this.notice_file.guid,
|
|
|
+ // patent_fileUrls:JSON.stringify(patent_fileUrls),
|
|
|
+ // app_file_guid:this.relevant_file.app_file.guid,
|
|
|
+ // modify_file_guid:this.relevant_file.modify_file.guid,
|
|
|
+ // changeClaim:this.changeClaim.changeClaim + '',
|
|
|
+ // claim:this.changeClaim.claim,
|
|
|
+ // near_index:this.changeClaim.near_index,
|
|
|
+ // main_claim_reason:JSON.stringify(this.main_claim_reason),
|
|
|
+ // claimChangeSuggestion:this.changeClaim.claimChangeSuggestion,
|
|
|
+ // operation:operation+''
|
|
|
+ // }
|
|
|
+ // var params = {
|
|
|
+ // inputs:inputs,
|
|
|
+ // query:this.difyQuery || 'OA答辩',
|
|
|
+ // conversation_id:this.currentConversation.conversationId,
|
|
|
+ // response_mode:'streaming',
|
|
|
+ // user:this.userinfo.id
|
|
|
// }
|
|
|
-
|
|
|
-
|
|
|
var params = {
|
|
|
- inputs:inputs,
|
|
|
+ confessionSessionId:this.currentConversation.id,
|
|
|
+ patentFileUrls:JSON.stringify(patent_fileUrls),
|
|
|
+ appFileGuid:this.relevant_file.app_file.guid,
|
|
|
+ modifyFileGuid:this.relevant_file.modify_file.guid,
|
|
|
+ changeClaim:this.changeClaim.changeClaim + '',
|
|
|
+ claim:this.changeClaim.claim.trim(),
|
|
|
+ nearIndex:this.changeClaim.near_index,
|
|
|
+ mainClaimReason:JSON.stringify(this.main_claim_reason),
|
|
|
+ claimChangeSuggestion:this.changeClaim.claimChangeSuggestion.trim(),
|
|
|
+ operation:operation+'',
|
|
|
+ messageId:message.id,
|
|
|
query:this.difyQuery || 'OA答辩',
|
|
|
- conversation_id:this.currentConversation.conversationId,
|
|
|
- response_mode:'streaming',
|
|
|
- user:this.userinfo.id
|
|
|
}
|
|
|
this.difyQuery = ''
|
|
|
this.$set(message,'loading',true)
|
|
|
this.loading = true
|
|
|
this.result = null
|
|
|
- const response = await fetch('https://ai.xsip.cn/v1/chat-messages', {
|
|
|
+ const response = await fetch('/api/xiaoshi/dify/sendOADefense2', {
|
|
|
method: 'POST',
|
|
|
headers: {
|
|
|
'Content-Type': 'application/json',
|
|
|
@@ -129,6 +128,7 @@ export default {
|
|
|
const decoder = new TextDecoder('utf-8');
|
|
|
let noFinishMessage = ''
|
|
|
message.answer = ''
|
|
|
+ let answer_code = ''
|
|
|
while (true) {
|
|
|
const { done, value } = await reader.read();
|
|
|
if (done){
|
|
|
@@ -140,19 +140,25 @@ export default {
|
|
|
let params = {
|
|
|
...message
|
|
|
}
|
|
|
- if(typeof (params.answer) != "string"){
|
|
|
- params.answer = JSON.stringify(params.answer)
|
|
|
- }else{
|
|
|
- params.answer = params.answer.replace('undefined','')
|
|
|
+ // if(typeof (params.answer) != "string"){
|
|
|
+ // params.answer = JSON.stringify(params.answer)
|
|
|
+ // }else{
|
|
|
+ // params.answer = params.answer.replace('undefined','')
|
|
|
+ // }
|
|
|
+ // this.addChatRecord(params)
|
|
|
+ if(params.operation == 1){
|
|
|
+ if(answer_code == 203){
|
|
|
+ this.sendMessage(null,2)
|
|
|
+ }
|
|
|
}
|
|
|
- this.addChatRecord(params)
|
|
|
+
|
|
|
if(params.operation == 3){
|
|
|
this.changeClaim.claimChangeSuggestion = params.answer
|
|
|
- this.updateContent()
|
|
|
+ // this.updateContent()
|
|
|
}
|
|
|
if(params.operation == 4){
|
|
|
this.changeClaim.claim = params.answer
|
|
|
- this.updateContent()
|
|
|
+ // this.updateContent()
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
@@ -169,7 +175,7 @@ export default {
|
|
|
if(json.event == 'message'){
|
|
|
if(!this.currentConversation.conversationId){
|
|
|
this.currentConversation.conversationId = json.conversation_id
|
|
|
- this.saveConversationId(json.conversation_id)
|
|
|
+ // this.saveConversationId(json.conversation_id)
|
|
|
}
|
|
|
if(message.loading){
|
|
|
this.$set(message,'loading',false)
|
|
|
@@ -183,6 +189,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
if(operation == 1){
|
|
|
+ answer_code = answer_json.code
|
|
|
if(answer_json.code == 1001){//缺少专利文件
|
|
|
this.$refs.errorTip.open(answer_json)
|
|
|
}else if(answer_json.code == 203){//文件输出
|
|
|
@@ -194,20 +201,20 @@ export default {
|
|
|
modify_file:this.modify_file,
|
|
|
contrast_file:this.contrast_file
|
|
|
}
|
|
|
- this.updateContent()
|
|
|
- this.sendMessage(null,2)
|
|
|
+ // this.updateContent()
|
|
|
+
|
|
|
}
|
|
|
}else if(operation == 2){
|
|
|
this.changeClaim.near_index = answer_json.nearIndex
|
|
|
this.changeClaim.nearNo = answer_json.nearNo
|
|
|
this.changeClaim.changeClaim = answer_json.changeClaim
|
|
|
this.changeClaim.novelty_innovative = answer_json.novelty_innovative
|
|
|
- this.updateContent()
|
|
|
+ // this.updateContent()
|
|
|
}else if(operation == 5){
|
|
|
this.main_claim_reason = answer_json
|
|
|
- this.updateContent()
|
|
|
+ // this.updateContent()
|
|
|
}else if(operation == 6){
|
|
|
- this.updateContent(operation,answer_json)
|
|
|
+ // this.updateContent(operation,answer_json)
|
|
|
}
|
|
|
|
|
|
}catch(e){
|
|
|
@@ -244,6 +251,7 @@ export default {
|
|
|
this.$set(message,'answer',answer_json)
|
|
|
}
|
|
|
if(operation == 1){
|
|
|
+ answer_code = answer_json.code
|
|
|
if(answer_json.code == 1001){//缺少专利文件
|
|
|
this.$refs.errorTip.open(answer_json)
|
|
|
}else if(answer_json.code == 203){//文件输出
|
|
|
@@ -255,7 +263,7 @@ export default {
|
|
|
modify_file:this.modify_file,
|
|
|
contrast_file:this.contrast_file
|
|
|
}
|
|
|
- this.updateContent()
|
|
|
+ // this.updateContent()
|
|
|
this.sendMessage(null,2)
|
|
|
}
|
|
|
}else if(operation == 2){
|
|
|
@@ -263,12 +271,12 @@ export default {
|
|
|
this.changeClaim.nearNo = answer_json.nearNo
|
|
|
this.changeClaim.changeClaim = answer_json.changeClaim
|
|
|
this.changeClaim.novelty_innovative = answer_json.novelty_innovative
|
|
|
- this.updateContent()
|
|
|
+ // this.updateContent()
|
|
|
}else if(operation == 5){
|
|
|
this.main_claim_reason = answer_json
|
|
|
- this.updateContent()
|
|
|
+ // this.updateContent()
|
|
|
}else if(operation == 6){
|
|
|
- this.updateContent(operation,answer_json)
|
|
|
+ // this.updateContent(operation,answer_json)
|
|
|
}
|
|
|
}catch(e){
|
|
|
message.answer += answer.replace(/\n|\\n|\\\n|\\\\n/g,'<br>');
|
|
|
@@ -315,7 +323,7 @@ export default {
|
|
|
}
|
|
|
this.$api.updateConfessionSession(params).then(response=>{
|
|
|
if(response.code == 200){
|
|
|
- this.queryConfessionSession(true)
|
|
|
+ // this.queryConfessionSession(true)
|
|
|
}
|
|
|
}).catch(error=>{
|
|
|
|