Merge branch 'dev-20250930' of http://25.13.9.101:9000/K17_AITS/tra-app into dev-20250930

This commit is contained in:
田岩
2025-08-28 16:55:00 +08:00
7 changed files with 163 additions and 81 deletions
+4 -5
View File
@@ -24,14 +24,12 @@ VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
# 线上
# VITE_APP_BASE_H5_API_Url = 'https://aitstest.jlbank.com.cn:7001'
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.66:9786'
VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601'
#VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
#VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605'
VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
# VITE_APP_BASE_H5_API_Url_TRAASK = 'http://25.64.16.144:9605'
# 王洋洋
@@ -40,3 +38,4 @@ VITE_APP_BASE_H5_API_Url = 'http://25.18.122.66:9786'
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.143:9604'
# 孙宇
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.139:9604'
+20
View File
@@ -158,6 +158,26 @@ export const textChartApi = (data) => {
});
};
// 预览 对话
export const textChartPreviewApi = (data) => {
return request({
url: base_url + '/traStdyInfoPreview/previewCrsInfo',
method: 'post',
toastErrors: true,
data
});
};
export const previewAfreshStudyCourse = (data) => {
return request({
url: base_url + '/traStdyInfo/previewAfreshStudyCourse',
method: 'post',
toastErrors: true,
data
});
};
// 设置学习顾问音色/traStdyTeacher/setStudyTeacher
export const setStudyTeacherApi = (data) => {
return request({
+26 -4
View File
@@ -25,7 +25,7 @@
></uv-tabs>
</view>
<view class="list-view">
<view class="filter-btn" @click="showFilterList = !showFilterList">筛选
<view class="filter-btn" @click="()=>{showFilterList = !showFilterList; activeTagPop = activeTag}">筛选
<uv-icon class="filter-icon" name="list"/>
</view>
<view :class="['filter-list',showFilterList?'show':'']">
@@ -34,14 +34,15 @@
<!-- .filter(t=>(t.children||[]).length>0) -->
<view class="filter-type-title">{{item.label}}</view>
<scroll-view :scroll-x="true" class="filter-type-list">
<view :class="['filter-type-item', activeTag.includes(itemT.value)?'is-active':'']" v-for="itemT in (item.children||[])" @click="chooseTag(itemT)">
<view :class="['filter-type-item', activeTagPop.includes(itemT.value)?'is-active':'']" v-for="itemT in (item.children||[])" @click="chooseTagPop(itemT)">
{{itemT.label}}
</view>
</scroll-view>
</view>
</scroll-view>
<view class="btns-box">
<view class="btn-sub" @click="showFilterList = false">确定</view>
<view class="btn-sub cencle-btn" @click="showFilterList = false">取消</view>
<view class="btn-sub" @click="() => {showFilterList = false;activeTag = activeTagPop}">筛选</view>
</view>
</view>
<uv-scroll-list class="tags-view" :indicator="false">
@@ -170,6 +171,21 @@ import { onShow } from "@dcloudio/uni-app"
} = uni.getWindowInfo()
const pageTopPadding = computed(() => statusBarHeight + 'px')
const activeTagPop = ref([])
const chooseTagPop = (item) => {
if(!item.value){
activeTagPop.value = ['']
return
}
activeTagPop.value = activeTagPop.value.filter((t=>!!t))
if(activeTagPop.value.includes(item.value)){
activeTagPop.value = activeTagPop.value.filter((t=>t !== item.value))
}else{
activeTagPop.value.push(item.value)
}
}
// 点击标签
const chooseTag = (item)=>{
if(!item.value){
@@ -472,10 +488,16 @@ import { onShow } from "@dcloudio/uni-app"
text-align: center;
background-color: #06f;
height: 60rpx;
line-height: 60rpx;
line-height: 58rpx;
border: 1rpx solid #06f;
padding: 0 40rpx;
color: #fff;
border-radius: 8rpx;
&.cencle-btn{
background-color: #fff;
color: #06f;
margin-right: 40rpx;
}
}
}
}
+91 -67
View File
@@ -150,7 +150,9 @@
afreshStudyCourseApi,
queryQuestionEvalateApi,
textChartApi,
setStudyTeacherApi
setStudyTeacherApi,
textChartPreviewApi,
previewAfreshStudyCourse
} from "@/api/study.js"
import common from '@/common/common';
import TalkingItem from '@/pages/course/components/talkingItem.vue'
@@ -189,6 +191,9 @@
const inputRef = ref('')
const flagVal = ref('1')
const isUploadingVoice = ref(false)
const isPreview = ref(false)
const ajaxApi = computed(()=> isPreview.value ? textChartPreviewApi: textChartApi)
const {
statusBarHeight
@@ -209,54 +214,44 @@
voicePath: '',
voiceObj: null
}))
if (body.stdyProgressFlag === 'N') {
step.value = 1
} else {
choiceTeacher.value = body.choiceTeacher
if (startPgrphId.value) {
sendMessage({
"commond": 'STDY',
"body": {
crsId: crsId.value,
teacherNo: choiceTeacher.value
}
})
return
}
common.show('提示', '系统检测到您已存在学习记录,要继续学习吗?', true, '重新学习', '继续学习').then((res) => {
if (res) {
// 继续学习 获取学习历史接口
// 滚动到最下面
scrollToBottomNow()
if(isPreview.value){
resStartStudyNow()
}else{
if (body.stdyProgressFlag === 'N') {
step.value = 1
} else {
choiceTeacher.value = body.choiceTeacher
if (startPgrphId.value) {
sendMessage({
"commond": 'STDY',
"body": {
crsId: crsId.value,
teacherNo: choiceTeacher.value
teacherNo: choiceTeacher.value,
studyType: isPreview.value ? 'P' : 'S'
}
})
step.value = 2
} else {
// 重新学习
afreshStudyCourseApi({
crsId: crsId.value,
}).then(res => {
step.value = 1
teacherList.value = body.teacheList.map(t => ({
...t,
voicePath: '',
voiceObj: null
}))
}).catch(t => {
step.value = 1
teacherList.value = body.teacheList.map(t => ({
...t,
voicePath: '',
voiceObj: null
}))
})
return
}
}).finally(() => {})
common.show('提示', '系统检测到您已存在学习记录,要继续学习吗?', true, '重新学习', '继续学习').then((res) => {
if (res) {
// 继续学习 获取学习历史接口
// 滚动到最下面
scrollToBottomNow()
sendMessage({
"commond": 'STDY',
"body": {
crsId: crsId.value,
teacherNo: choiceTeacher.value,
studyType: isPreview.value ? 'P' : 'S'
}
})
step.value = 2
} else {
// 重新学习
resStartStudyNow()
}
}).finally(() => {})
}
}
} catch {
@@ -264,7 +259,28 @@
watchFlag.value += 1
}
};
// 重新学习
const resStartStudyNow = () => {
let _ajax = isPreview.value ? previewAfreshStudyCourse : afreshStudyCourseApi
_ajax({
crsId: crsId.value,
}).then(res => {
step.value = 1
teacherList.value = body.teacheList.map(t => ({
...t,
voicePath: '',
voiceObj: null
}))
}).catch(t => {
step.value = 1
teacherList.value = body.teacheList.map(t => ({
...t,
voicePath: '',
voiceObj: null
}))
})
}
const showChangeSeekModelNow = () => {
// changePlayItemId()
showSeekModel.value = true
@@ -347,7 +363,8 @@
"commond": 'STDY',
"body": {
crsId: crsId.value,
teacherNo: choiceTeacher.value
teacherNo: choiceTeacher.value,
studyType: isPreview.value ? 'P' : 'S'
}
})
step.value = 2
@@ -383,7 +400,7 @@
if (flag === 1 && !!startPgrphId.value) {
_data.pgrphId = startPgrphId.value
}
textChartApi({
unref(ajaxApi)({
processType: 'PRGH-STDY',
requestBody: JSON.stringify(_data)
}).then(res => {
@@ -392,18 +409,25 @@
return
}
if (Number(_body.bodyTyp) === 7) {
common.show('恭喜你已学完全部知识点', '有什么心得跟我们分享吗?', true, '取消', '去评论').then((res) => {
if (res) {
// 去评论
common.redirectTo(
`/pages/courseDetail/submit?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&imgId=${imageId.value}`
)
} else {
// 取消
common.redirectTo(
`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
}
}).finally(() => {})
if(isPreview.value){
common.show('提示', '您已学完全部知识点', false, '取消', '确定').then((res) => {
common.redirectTo(
`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&isPreview=true`)
}).finally(() => {})
}else{
common.show('恭喜你已学完全部知识点', '有什么心得跟我们分享吗?', true, '取消', '去评论').then((res) => {
if (res) {
// 去评论
common.redirectTo(
`/pages/courseDetail/submit?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study&imgId=${imageId.value}`
)
} else {
// 取消
common.redirectTo(
`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
}
}).finally(() => {})
}
return
}
lastTalkingInfo.value = {
@@ -433,7 +457,7 @@
// 获取问题
const getQuestionInfoUnStudy = (pgrphId) => {
console.log(pgrphId)
textChartApi({
unref(ajaxApi)({
processType: 'QNS-ANSER',
requestBody: JSON.stringify({
crsId: crsId.value,
@@ -504,7 +528,7 @@
scrollToBottomNow()
getQuestionInfoUnStudy(info.pgrphId)
} else if (type === 'overGraph') {
textChartApi({
unref(ajaxApi)({
processType: 'PRGH-OVER',
requestBody: JSON.stringify({
pgrphId: info?.pgrphId,
@@ -540,7 +564,7 @@
id: _id
})
// 重新回答
textChartApi({
unref(ajaxApi)({
processType: 'NEW-ANSER', //NEW-KNOW
requestBody: info.qnsId
}).then(res => {
@@ -548,7 +572,6 @@
if (!_body.chatBody) {
return
}
console.log(info, 222222)
lastTalkingInfo.value = {
crsId: info.crsId,
qstLogId: _body.chatBody,
@@ -577,7 +600,7 @@
id: _id
})
console.log(unref(logId))
textChartApi({
unref(ajaxApi)({
processType: 'NEW-KNOW',
requestBody: JSON.stringify({
logId: unref(logId),
@@ -680,6 +703,7 @@
const imageId = ref('')
onLoad((params) => {
watchFlag.value = 1
isPreview.value = params.isPreview === 'preview'
crsId.value = params.crsId || '';
crsNum.value = params.crsNum || '';
imageId.value = params.imgId || ''
@@ -841,7 +865,7 @@
ansterContent: val, // 回答文本内容 必输项:false 类型:String
asrStartTm: unref(lastTalkingInfo).asrStartTm
}
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-TEXT',
requestBody: JSON.stringify(_data)
})
@@ -874,7 +898,7 @@
}
// 撤回
const withdrawNow = (data) => {
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-WITHDRAW',
requestBody: JSON.stringify({
recordId: data.recordId
@@ -908,7 +932,7 @@
type: 0
})
scrollToBottomNow(0)
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-CHOICE',
requestBody: JSON.stringify(_data)
}).then(res => {
@@ -938,7 +962,7 @@
}
// 完成
const finishQuestionNow = (data) => {
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-OVER',
requestBody: JSON.stringify({
qnsId: data.qnsId,
@@ -983,7 +1007,7 @@
// 查询问题回答评分
const getQuestionEvalateRequest = (id, data, num) => {
if (loadingExecLogId.value) {
textChartApi({
unref(ajaxApi)({
processType: 'ANSER-RESULT',
requestBody: JSON.stringify({
execLogId: loadingExecLogId.value
+2 -2
View File
@@ -262,7 +262,7 @@
height: 12rpx;
border-right: 4rpx solid #333;
border-bottom: 4rpx solid #333;
transform: rotate(45deg);
transform: rotate(135deg);
}
}
@@ -270,7 +270,7 @@
.link-info {
&::after {
top: 18rpx;
transform: rotate(135deg);
transform: rotate(45deg);
}
}
+19 -2
View File
@@ -321,8 +321,9 @@
answerIsOver.value = true
} else if (body.event === 'sourceDocuments') {
console.log('回答返回文件列表!')
console.log('body: ',body)
if (talkingList.value.length === 0) return
let _data = JSON.parse(body.data) || {}
let _data = body.data
talkingList.value[talkingList.value.length - 1].talkingFiles = _data.knowledgeList||[]
talkingList.value[talkingList.value.length - 1].talkingCrsList = _data.crsList||[]
}
@@ -472,7 +473,21 @@
console.log(res)
talkingList.value = (res.body || []).map((t,index)=> {
let _text = t.respContent.replace(/\\n/g, `\n`);
// let _obj = JSON.parse( t.respContent)
// console.log(_obj,0)
// if(t.chatRole === 'TCH'){
// console.log(JSON.parse(_obj),1)
// }
let _text
let _talkingCrsList
let _talkingFiles
if(t.chatRole === 'TCH'){
_text = t.respContentVo?.messageBuileder|| ''
_talkingCrsList = t.respContentVo?.resultMap?.crsList||[]
_talkingFiles = t.respContentVo?.resultMap?.knowledgeList||[]
}else{
_text = t.respContent
}
return {
type: t.chatRole === 'TCH'? 'answer':'question',
talkingText: _text,
@@ -487,6 +502,8 @@
bucketKey: '',
downvoteStat: t.downvoteStat,
likeStat: t.likeStat,
talkingCrsList: _talkingCrsList,
talkingFiles: _talkingFiles
}
})
historyRef.value.close()
+1 -1
View File
@@ -21,7 +21,7 @@ export const useSocketStore = defineStore('socketStore',{
if(this.SocketObj?.isClose){
this.SocketObj.isClose = false
}
let _baseUrl = get_base_url().split('http').join('ws')
let _baseUrl = get_base_url(url).split('http').join('ws')
this.SocketObj = new SocketClass(_baseUrl + url + getToken());
},
closeSocket() {