|
@@ -3,8 +3,10 @@
|
|
<div class="window-list-wrap">
|
|
<div class="window-list-wrap">
|
|
<div class="window-title">
|
|
<div class="window-title">
|
|
<div class="title-wrap">
|
|
<div class="title-wrap">
|
|
|
|
+ <p class="text-ellipsis" style="color: #333333;font-size: 20px;font-weight: 600;">{{companyName}}</p>
|
|
<span style="color: #666666;font-size: 16px;">研究AI问答小助手</span>
|
|
<span style="color: #666666;font-size: 16px;">研究AI问答小助手</span>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="icon"><img src="~@/assets/img/icons/ai_company.png"/></div>
|
|
</div>
|
|
</div>
|
|
<div class="add-btn" @click="handleAddNewWindow"><i class="el-icon-circle-plus-outline"></i>新建对话窗口</div>
|
|
<div class="add-btn" @click="handleAddNewWindow"><i class="el-icon-circle-plus-outline"></i>新建对话窗口</div>
|
|
<div class="list-wrap hidden-scrollbar">
|
|
<div class="list-wrap hidden-scrollbar">
|
|
@@ -72,6 +74,7 @@ import NewWindowHint from './components/newWindowHint.vue';
|
|
import WindowListItem from './components/windowListItem';
|
|
import WindowListItem from './components/windowListItem';
|
|
/* api */
|
|
/* api */
|
|
import {aiQAInterence} from '@/api/modules/aiApi.js';
|
|
import {aiQAInterence} from '@/api/modules/aiApi.js';
|
|
|
|
+import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
|
|
export default {
|
|
export default {
|
|
components: { WindowListItem,NewWindowHint, MessageItem },
|
|
components: { WindowListItem,NewWindowHint, MessageItem },
|
|
data() {
|
|
data() {
|
|
@@ -111,6 +114,8 @@ export default {
|
|
showHint:false,//选择模型提示
|
|
showHint:false,//选择模型提示
|
|
isTyping:false,//是否处于打字动画中
|
|
isTyping:false,//是否处于打字动画中
|
|
windowContentLoading:null,
|
|
windowContentLoading:null,
|
|
|
|
+ answerLoading:false,//回答中
|
|
|
|
+ companyName:'',
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch:{
|
|
watch:{
|
|
@@ -159,7 +164,7 @@ export default {
|
|
this.historyList = List||[]
|
|
this.historyList = List||[]
|
|
this.windowContentLoading&&this.windowContentLoading.close()
|
|
this.windowContentLoading&&this.windowContentLoading.close()
|
|
//使用模型
|
|
//使用模型
|
|
- this.model = this.historyList.length?this.historyList[this.historyList.length-1].Model:''
|
|
|
|
|
|
+ this.model = this.historyList.length?this.historyList[this.historyList.length-1].Model:'GPT-4 Turbo'
|
|
//如果有历史记录,则滚动到底部
|
|
//如果有历史记录,则滚动到底部
|
|
this.$nextTick(()=>{
|
|
this.$nextTick(()=>{
|
|
const windowContentWrap = document.querySelector('.window-content-wrap')
|
|
const windowContentWrap = document.querySelector('.window-content-wrap')
|
|
@@ -205,7 +210,7 @@ export default {
|
|
this.activeWindowId=0
|
|
this.activeWindowId=0
|
|
this.activeWindow=null
|
|
this.activeWindow=null
|
|
this.historyList=[]
|
|
this.historyList=[]
|
|
- this.model=''
|
|
|
|
|
|
+ this.model='GPT-4 Turbo'
|
|
//this.inputText=''
|
|
//this.inputText=''
|
|
this.isTyping = false
|
|
this.isTyping = false
|
|
},
|
|
},
|
|
@@ -291,23 +296,24 @@ export default {
|
|
this.inputText+='\n'
|
|
this.inputText+='\n'
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(this.isTyping){
|
|
|
|
|
|
+ if(this.isTyping||this.answerLoading){
|
|
this.$message.warning('请等待回答完成')
|
|
this.$message.warning('请等待回答完成')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
//新建窗口,未选择模型
|
|
//新建窗口,未选择模型
|
|
- if(this.activeWindowId===0&&this.model===''){
|
|
|
|
- this.showHint = true
|
|
|
|
- this.$message.error('请选择模型')
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
- this.$refs.modelSelect.focus()
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ // if(this.activeWindowId===0&&this.model===''){
|
|
|
|
+ // this.showHint = true
|
|
|
|
+ // this.$message.error('请选择模型')
|
|
|
|
+ // this.$nextTick(()=>{
|
|
|
|
+ // this.$refs.modelSelect.focus()
|
|
|
|
+ // })
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
if(this.inputText.length===0){
|
|
if(this.inputText.length===0){
|
|
this.$message.warning('请输入提问')
|
|
this.$message.warning('请输入提问')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ this.answerLoading=true
|
|
this.activeWindowId===0&&(this.activeWindowId = -1)
|
|
this.activeWindowId===0&&(this.activeWindowId = -1)
|
|
//this.activeWindowId!==0&&this.getWindowDetail()
|
|
//this.activeWindowId!==0&&this.getWindowDetail()
|
|
//mock 加入到historyList中
|
|
//mock 加入到historyList中
|
|
@@ -337,6 +343,7 @@ export default {
|
|
Ask:inputText,
|
|
Ask:inputText,
|
|
// Model:this.model
|
|
// Model:this.model
|
|
}).then(res=>{
|
|
}).then(res=>{
|
|
|
|
+ this.answerLoading=false
|
|
//在回答未获取前切换了新窗口
|
|
//在回答未获取前切换了新窗口
|
|
if(this.historyList.length===0){
|
|
if(this.historyList.length===0){
|
|
this.getWindowList()
|
|
this.getWindowList()
|
|
@@ -371,6 +378,8 @@ export default {
|
|
msg.Model = Model
|
|
msg.Model = Model
|
|
msg.isPlay = true
|
|
msg.isPlay = true
|
|
this.historyList.splice(this.historyList.length-1,1,msg)
|
|
this.historyList.splice(this.historyList.length-1,1,msg)
|
|
|
|
+ }).catch(()=>{
|
|
|
|
+ this.answerLoading=false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//获取窗口列表
|
|
//获取窗口列表
|
|
@@ -384,10 +393,19 @@ export default {
|
|
this.windowList = res.Data.List||[]
|
|
this.windowList = res.Data.List||[]
|
|
this.listWrapLoading&&this.listWrapLoading.close()
|
|
this.listWrapLoading&&this.listWrapLoading.close()
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getBaseConfig(){
|
|
|
|
+ etaBaseConfigInterence.getBaseConfig().then(res=>{
|
|
|
|
+ if(res.Ret===200){
|
|
|
|
+ this.companyName=res.Data.CompanyName||''
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
this.getWindowList()
|
|
this.getWindowList()
|
|
|
|
+ this.getBaseConfig()
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -428,10 +446,19 @@ $border-color:#3D52A1;
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
+ // overflow: hidden;
|
|
.icon img{
|
|
.icon img{
|
|
width:58px;
|
|
width:58px;
|
|
height:58px;
|
|
height:58px;
|
|
}
|
|
}
|
|
|
|
+ .title-wrap{
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ }
|
|
|
|
+ .text-ellipsis{
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.add-btn{
|
|
.add-btn{
|
|
border:2px dashed $border-color;
|
|
border:2px dashed $border-color;
|