接口联调
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!-- type: 3, 段落信息 4 问题信息 5 统计信息 1,语音回答 , 2 文本回答 ,0,纯文本信息 不翻译 6: 发送loading状态-->
|
||||
<!-- type: 0,纯文本信息不翻译 1,语音回答 , 2 文本回答 3, 段落信息 4 问题信息 5 统计信息 6: 发送loading状态 -->
|
||||
<template>
|
||||
<view class="ai-answer" v-if="[3,4,5].indexOf(type) >= 0">
|
||||
<view class="user-info">
|
||||
@@ -233,6 +233,10 @@ const audioCacheObj = computed(() => storageStore.audioObj)
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
watch(() => props.dataInfo,()=>{},{
|
||||
deep: true,
|
||||
immediate: true
|
||||
})
|
||||
|
||||
const transformContent = ref('')
|
||||
const showContentBase = computed(() => {
|
||||
|
||||
+47
-19
@@ -117,8 +117,6 @@ import { get_base_url, goto_login_fun } from '@/api/request'
|
||||
import {
|
||||
getCourseStudyInfoApi,
|
||||
afreshStudyCourseApi,
|
||||
withdrawalAnswerApi,
|
||||
waitMakeEvaluateApi,
|
||||
queryQuestionEvalateApi,
|
||||
textChartApi
|
||||
} from "@/api/study.js"
|
||||
@@ -331,7 +329,8 @@ const getQuestionInfoUnStudy = (pgrphId) => {
|
||||
.then(res=>{
|
||||
let _id = new Date().getTime() + 'id'
|
||||
let _body = res.body || {}
|
||||
if(res.body.stdyStat !== 'N'){
|
||||
console.log(_body.chatBody)
|
||||
if(_body.chatBody && _body.chatBody?.stdyStat !== 'N'){
|
||||
let _id = new Date().getTime() + 'id'
|
||||
lastTalkingInfo.value = {
|
||||
crsId: crsId.value,
|
||||
@@ -348,7 +347,7 @@ const getQuestionInfoUnStudy = (pgrphId) => {
|
||||
isQuestion: true
|
||||
}
|
||||
talkingList.value.push(lastTalkingInfo.value)
|
||||
qstLogId.value = lastTalkingInfo.value.qstLogId
|
||||
qstLogId.value = _body.chatBody?.qstLogId
|
||||
scrollToBottomNow()
|
||||
}else{
|
||||
getGraphInfoUnStudy()
|
||||
@@ -409,6 +408,7 @@ const nextQuestionSuccess = (info, type='next') => {
|
||||
isQuestion: true
|
||||
}
|
||||
talkingList.value.push(lastTalkingInfo.value)
|
||||
qstLogId.value = _body.chatBody.qstLogId
|
||||
scrollToBottomNow()
|
||||
})
|
||||
}
|
||||
@@ -523,8 +523,12 @@ const uploadRecordNow = (voicePath) => {
|
||||
id: _id
|
||||
})
|
||||
scrollToBottomNow()
|
||||
commonUploadVoiceFile(voicePath, '/trastudy/traStdyInfo/studyAnswerVoiceUp', _data).then(res=>{
|
||||
commonUploadVoiceFile(voicePath, '/trastudy/traStdychat/voiceChart', {
|
||||
processType: 'ANSER-VOICE',
|
||||
requestBody: JSON.stringify(_data)
|
||||
}).then(res=>{
|
||||
let _res = JSON.parse(res.data)
|
||||
console.log(_res)
|
||||
if(_res.rtnCode === '0000'){
|
||||
talkingList.value = talkingList.value.map(t=>{
|
||||
if(t.id === _id){
|
||||
@@ -535,7 +539,7 @@ const uploadRecordNow = (voicePath) => {
|
||||
qnsId: _data.qnsId,
|
||||
talkingContent: '',
|
||||
talkingVoice: voicePath,
|
||||
intrctId: res.body||'',
|
||||
intrctId: _res.chatBody,
|
||||
type: 1,
|
||||
userInfo: {...choiceTeacherInfo.value},
|
||||
id: _id
|
||||
@@ -593,9 +597,13 @@ const submitAnswerNow = (val, cb) => {
|
||||
}
|
||||
// 撤回
|
||||
const withdrawNow = (data) => {
|
||||
withdrawalAnswerApi({
|
||||
intrctId: data.intrctId
|
||||
}).then(res=> {
|
||||
textChartApi({
|
||||
processType: 'ANSER-WITHDRAW',
|
||||
requestBody: JSON.stringify({
|
||||
intrctId: data.intrctId
|
||||
})
|
||||
})
|
||||
.then(res=> {
|
||||
// 删除撤回的数据item
|
||||
common.msg('撤回成功!')
|
||||
talkingList.value = talkingList.value.filter(t => t.intrctId !== data.intrctId)
|
||||
@@ -611,11 +619,20 @@ const finishQuestionNow = (data) => {
|
||||
userInfo: {...choiceTeacherInfo.value},
|
||||
type: 0
|
||||
})
|
||||
waitMakeEvaluateApi({
|
||||
qstLogId: data.qstLogId
|
||||
}).then(res=> {
|
||||
// waitMakeEvaluateApi({
|
||||
// qstLogId: data.qstLogId
|
||||
// })
|
||||
|
||||
textChartApi({
|
||||
processType: 'ANSER-OVER',
|
||||
requestBody: JSON.stringify({
|
||||
qstLogId: data.qstLogId
|
||||
})
|
||||
})
|
||||
.then(res=> {
|
||||
// common.msg('完成成功,开始获取评分维度数据!')
|
||||
loadingQstLogId.value = res.body.qstLogId
|
||||
loadingQstLogId.value = res.body.chatBody.qstLogId
|
||||
qstLogId.value = loadingQstLogId.value
|
||||
let _id = new Date().getTime() + 'id'
|
||||
lastTalkingInfo.value = {
|
||||
isLoading: true,
|
||||
@@ -631,15 +648,26 @@ const finishQuestionNow = (data) => {
|
||||
// 查询问题回答评分
|
||||
const getQuestionEvalateRequest = (id, data) => {
|
||||
if(loadingQstLogId.value){
|
||||
queryQuestionEvalateApi({
|
||||
qstLogId:loadingQstLogId.value
|
||||
}).then(res=>{
|
||||
if(res.body && res.body.evalOver === 'Y'){
|
||||
let _body = res.body
|
||||
// queryQuestionEvalateApi({
|
||||
// qstLogId:loadingQstLogId.value
|
||||
// })
|
||||
|
||||
textChartApi({
|
||||
processType: 'ANSER-RESULT',
|
||||
requestBody: JSON.stringify({
|
||||
qstLogId:loadingQstLogId.value
|
||||
})
|
||||
})
|
||||
.then(res=>{
|
||||
let _body = res.body|| {}
|
||||
if(!_body.chatBody) {
|
||||
return
|
||||
}
|
||||
if(_body.chatBody && _body.chatBody.evalOver === 'Y'){
|
||||
talkingList.value = talkingList.value.map(t=>{
|
||||
if(t.id === id){
|
||||
lastTalkingInfo.value = {
|
||||
..._body,
|
||||
..._body.chatBody,
|
||||
pgrphId: data.pgrphId,
|
||||
qstLogId: loadingQstLogId.value,
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user