Browse Source

助手优化

master
xueyinfei 3 weeks ago
parent
commit
80661f6fda
  1. 30
      vue-fastapi-frontend/src/views/aichat/aichat.vue

30
vue-fastapi-frontend/src/views/aichat/aichat.vue

@ -293,7 +293,6 @@ const scorll = ref(true)
const dialogScrollbar = ref()
const loading = ref(false)
const inputValue = ref('')
const currentQuestion = ref({})
const chartOpenId = ref('')
const chatList = ref([])
const controller = ref(null)
@ -415,7 +414,6 @@ const handleFileSuccess = (response, file, fileList) => {
upload.open = false;
upload.isUploading = false;
proxy.$modal.msgSuccess(response.msg);
// proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "", { dangerouslyUseHTMLString: true });
};
/** 提交上传文件 */
@ -447,31 +445,6 @@ watch(
watch(() => props.cookieSessionId, value => upload.data = {sessionId:value})
// function regenerationChart(index){
//
// if (currentQuestion.value.query){
// sendChatMessage(currentQuestion.value)
// }else{
// // let question = chatList.value[index - 1]
// // let chat = {
// // "chatId":uuidv4(),
// // "type":"question",
// // "content":question.content,
// // "time": formatDate(new Date()),
// // "file": question.file}
// // chatList.value.push(chat)
// // let data = {
// // "query": chat.content,
// // "user_id": cache.local.get("username"),
// // "robot": currentMachine.value.length>0?currentMachine.value[0]:"",
// // "session_id": Cookies.get("chatSessionId"),
// // "doc": chat.file,
// // }
// sendChatMessage(data)
// }
//
// }
function changeThumb(index,chat){
chatList.value[index].operate = chat.operate
chatList.value[index].thumbDownReason = chat.thumbDownReason
@ -607,7 +580,7 @@ async function sendChatHandle(event) {
//checkpointer
data.checkpointer = chatList.value[chatList.value.length - 1].content.checkpointer
}
currentQuestion.value = data
currentChatData.value = data
inputValue.value = ''
sendChatMessage(data)
}
@ -625,7 +598,6 @@ function sendChatMessage(data){
currentError.value = "服务异常,错误码:"+res.status +",请联系管理员!"
}else {
currentError.value = ''
currentChatData.value = {}
currentFiles.value = []
chatList.value.push({"chatId":uuidv4(),"type":"answer","content":[],"isEnd":false,"isStop":false,"sessionId":chatList.value[0].sessionId,"sessionName":chatList.value[0].sessionName, "operate":'',"thumbDownReason":''})
const reader = res.body.getReader()

Loading…
Cancel
Save