Merge branch 'develop' of http://25.13.9.101:9000/K17_AITS/tra-app into develop
This commit is contained in:
@@ -58,6 +58,7 @@ export const chatVoice = (data) => {
|
||||
return request({
|
||||
url: '/traask/traTestchat/chatVoice',
|
||||
method: 'post',
|
||||
timeout: 120000,
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
@@ -11,23 +11,9 @@
|
||||
<MarkdownPreview :mdString="mdText" />
|
||||
</view>
|
||||
<view class="talking-link">
|
||||
<view :class="['link-cont', activeNames.indexOf(1) >= 0 ? 'is-active' : '']" v-if="fileList.length > 0">
|
||||
<view class="link-info" @click="changeActive(1)">
|
||||
<view class="info-text"> 引用知识库{{ fileList.length }}篇相关资料 </view>
|
||||
</view>
|
||||
<view class="link-items">
|
||||
<view class="link-item" v-for="(item, index) in fileList" @click.stop="previewFile(item)">{{ index + 1 }}. {{ item.docName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="!props.isAnswering" class="link-cont-desc">本次回答参考资料来源于网络</view>
|
||||
<view :class="['link-cont', activeNames.indexOf(2) >= 0 ? 'is-active' : '']" v-if="crsList.length > 0">
|
||||
<view class="link-info" @click="changeActive(2)">
|
||||
<view class="info-text"> 发现{{ crsList.length }}个关联课程 </view>
|
||||
</view>
|
||||
<view class="link-items">
|
||||
<view class="link-item" v-for="(item, index) in crsList" @click.stop="previewCrs(item)">{{ index + 1 }}. {{ item.crsName }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="link-cont-desc">大模型请求时长:{{ dataInfo.aiAskTime }}ms</view>
|
||||
<view class="link-cont-desc">生成语音文件时长:{{ dataInfo.transVoice }}ms</view>
|
||||
<view class="link-cont-desc">本次回答参考资料来源于网络</view>
|
||||
</view>
|
||||
<view class="btns-cont">
|
||||
<view class="replay-btn" >
|
||||
@@ -87,7 +73,28 @@ watch(
|
||||
)
|
||||
watch(
|
||||
() => props.isLoading,
|
||||
() => {},
|
||||
(val) => {
|
||||
if(!val){
|
||||
setTimeout(()=> {
|
||||
playVoice()
|
||||
},500)
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
const isPlaying = ref(false)
|
||||
watch(
|
||||
() => props.activeVoiceId,
|
||||
(val) => {
|
||||
if(val === props.dataInfo.id){
|
||||
isPlaying.value = true
|
||||
}else{
|
||||
isPlaying.value = false
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
immediate: true
|
||||
@@ -100,7 +107,6 @@ const mdText = computed(() => {
|
||||
const fileList = computed(() => props.dataInfo?.talkingFiles || [])
|
||||
const crsList = computed(() => props.dataInfo?.talkingCrsList || [])
|
||||
const activeNames = ref([1, 2])
|
||||
const isPlaying = ref(false)
|
||||
|
||||
const talkVoiceObj = ref(null)
|
||||
const voiceLoading = ref(false)
|
||||
@@ -118,11 +124,6 @@ const isPlaying = ref(false)
|
||||
talkVoiceObj.value.src = ''
|
||||
isPlaying.value = false
|
||||
})
|
||||
// itemVoice.value = unref(dataInfo).talkingVoice
|
||||
// talkVoiceObj.value.src = itemVoice.value
|
||||
// setTimeout(()=>{
|
||||
// setVoiceTime(0)
|
||||
// },100)
|
||||
}
|
||||
const setVoiceTime = (sum) => {
|
||||
sum += 1
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
isLoading: true,
|
||||
id: _id + 'loading'
|
||||
});
|
||||
scrollToBottomNow()
|
||||
chatVoice({
|
||||
chatVoice: data.body.intrctContent
|
||||
}).then(res => {
|
||||
@@ -360,8 +361,10 @@
|
||||
talkingFiles: [],
|
||||
talkingCrsList: [],
|
||||
talkingVoice: '',
|
||||
talkingVoiceId: res.body.fileId
|
||||
talkingVoiceId: res.body.fileId,
|
||||
...res.body
|
||||
});
|
||||
scrollToBottomNow()
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user