Merge branch 'develop' into 'sit'
Develop See merge request K17_AITS/tra-app!178
This commit is contained in:
+3
-3
@@ -2,7 +2,7 @@
|
||||
ENV = 'development'
|
||||
# 'development'
|
||||
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7002'
|
||||
VITE_APP_BASE_API_Url = 'https://aitstest.jlbank.com.cn:7001'
|
||||
# VITE_APP_BASE_API_Url = ' http://25.18.122.66:9786'
|
||||
#sit
|
||||
# VITE_APP_BASE_API_Url = 'http://25.18.122.91:9786'
|
||||
@@ -24,7 +24,7 @@ VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.92:9786'
|
||||
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
|
||||
|
||||
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'
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# 开发环境
|
||||
ENV = 'development'
|
||||
# 'development'
|
||||
|
||||
VITE_APP_BASE_API_Url = ''
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
ENV = 'production'
|
||||
|
||||
# base api
|
||||
VITE_APP_BASE_API_Url = 'http://localhost:7000'
|
||||
VITE_APP_BASE_API_Url = 'https://aits.jlbank.com.cn:7001'
|
||||
@@ -12,6 +12,7 @@
|
||||
"build:app-plus:sit": "uni build -p app-plus --mode sit",
|
||||
"build:app-plus:uat": "uni build -p app-plus --mode uat",
|
||||
"build:app-plus:prod": "uni build -p app-plus",
|
||||
"build:h5:dev": "uni build -p app-plus --mode development_h5",
|
||||
"build:h5": "uni build"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -58,6 +58,7 @@ export const chatVoice = (data) => {
|
||||
return request({
|
||||
url: '/traask/traTestchat/chatVoice',
|
||||
method: 'post',
|
||||
timeout: 120000,
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import common from '@/common/common.js'
|
||||
const ENV = import.meta.env
|
||||
|
||||
export const get_base_url = (url = '') => {
|
||||
|
||||
return ''
|
||||
if (ENV.MODE === 'development') { // 开发环境
|
||||
// #ifdef H5
|
||||
if (url) {
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
<text class="tr">{{ item.gradeDimens }}:</text>
|
||||
<text class="td">{{ item.anlyGrade }}</text>
|
||||
<view class="your_answer" v-if="item.dimensCode === '01' && passKeyword">
|
||||
关键词:{{ passKeyword }}
|
||||
<!-- <rich-text :nodes="highlightedText" class="content" /> -->
|
||||
<rich-text :nodes="highlightedText" class="content" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -50,20 +49,20 @@
|
||||
if (!props.value.relKeyword) return [];
|
||||
return props.value.relKeyword.split(/[,、]/).map((key) => key.trim());
|
||||
});
|
||||
|
||||
const highlightedText = computed(() => {
|
||||
// 如果没有关键词,直接返回原文本
|
||||
if (!keywords.value.length) return '你的答案:' + props.answerText;
|
||||
// 构建正则表达式,匹配所有关键词(不区分大小写)
|
||||
// 对关键词进行转义,避免特殊字符影响正则
|
||||
const escapedKeywords = keywords.value.map((keyword) => keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
|
||||
|
||||
// const highlightedText = computed(() => {
|
||||
// // 如果没有关键词,直接返回原文本
|
||||
// if (!keywords.value.length) return '你的答案:' + props.answerText;
|
||||
// // 构建正则表达式,匹配所有关键词(不区分大小写)
|
||||
// // 对关键词进行转义,避免特殊字符影响正则
|
||||
// const escapedKeywords = keywords.value.map((keyword) => keyword.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
|
||||
// 创建正则表达式,g表示全局匹配,i表示不区分大小写
|
||||
const regex = new RegExp(`(${escapedKeywords.join('|')})`, 'gi');
|
||||
|
||||
// // 创建正则表达式,g表示全局匹配,i表示不区分大小写
|
||||
// const regex = new RegExp(`(${escapedKeywords.join('|')})`, 'gi');
|
||||
|
||||
// // 替换匹配到的关键词,用span包裹并添加高亮样式
|
||||
// return '你的答案:' + props.answerText.replace(regex, (match) => `<span class="highlight">${match}</span>`);
|
||||
// });
|
||||
// 替换匹配到的关键词,用span包裹并添加高亮样式
|
||||
return '你的答案:' + props.answerText.replace(regex, (match) => `<span class="highlight">${match}</span>`);
|
||||
});
|
||||
const dimension_all_score = computed(() => {
|
||||
return (
|
||||
evalSettingVos.value
|
||||
|
||||
+4
-4
@@ -2,16 +2,16 @@
|
||||
"name" : "tra-app",
|
||||
"appid" : "__UNI__EDE0E52",
|
||||
"description" : "",
|
||||
"versionName" : "0.0.1",
|
||||
"versionCode" : 1,
|
||||
"versionName" : "0.0.2",
|
||||
"versionCode" : 2,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"renderer": "auto",
|
||||
"orientation": ["portrait-primary"],
|
||||
"renderer" : "auto",
|
||||
"orientation" : [ "portrait-primary" ],
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : false,
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
};
|
||||
@@ -604,6 +607,7 @@
|
||||
commonUploadVoiceFile(voicePath, '/traask/traAskchat/voiceTrans', {})
|
||||
.then((_res) => {
|
||||
if (!!(_res.body.transContent || '').trim()) {
|
||||
talkingList.value.pop();
|
||||
askData.value = {
|
||||
reqBatch: reqBatch.value,
|
||||
intrctWay: '02', //01-文本;02-语音;03-图片
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
</view>
|
||||
<view class="cell_div">
|
||||
<uv-cell-group :border="false">
|
||||
<uv-cell title="问答演示" :isLink="true" @click="common.navigateTo('/pages/example/dialog')"></uv-cell>
|
||||
<uv-cell title="问答演示" v-if="user_info.loginName === 'ADMIN'" :isLink="true" @click="common.navigateTo('/pages/example/dialog')"></uv-cell>
|
||||
<uv-cell
|
||||
title="消息通知"
|
||||
:isLink="true"
|
||||
@@ -208,7 +208,8 @@
|
||||
const user_info = reactive({
|
||||
userName: '',
|
||||
userId: '',
|
||||
imageAddr: ''
|
||||
imageAddr: '',
|
||||
loginName: ''
|
||||
});
|
||||
const goTest = () => {
|
||||
console.log('goTest');
|
||||
|
||||
Reference in New Issue
Block a user