mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
improve: chat list order during chat
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import BaseAnswer from './BaseAnswer.vue'
|
||||
import { chatApi, ChatInfo, type ChatMessage, ChatRecord } from '@/api/chat.ts'
|
||||
import { Chat, chatApi, ChatInfo, type ChatMessage, ChatRecord } from '@/api/chat.ts'
|
||||
import { computed, nextTick, onBeforeUnmount, ref } from 'vue'
|
||||
import MdComponent from '@/views/chat/component/MdComponent.vue'
|
||||
const props = withDefaults(
|
||||
@@ -95,6 +95,13 @@ const sendMessage = async () => {
|
||||
if (error) return
|
||||
|
||||
try {
|
||||
_currentChat.value.latest_record_time = new Date()
|
||||
_chatList.value.forEach((c: Chat) => {
|
||||
if (c.id === _currentChat.value.id) {
|
||||
c.latest_record_time = _currentChat.value.latest_record_time
|
||||
}
|
||||
})
|
||||
|
||||
const controller: AbortController = new AbortController()
|
||||
const response = await chatApi.analysis(currentRecord.analysis_record_id, controller)
|
||||
const reader = response.body.getReader()
|
||||
|
||||
@@ -102,6 +102,13 @@ const sendMessage = async () => {
|
||||
if (error) return
|
||||
|
||||
try {
|
||||
_currentChat.value.latest_record_time = new Date()
|
||||
_chatList.value.forEach((c: Chat) => {
|
||||
if (c.id === _currentChat.value.id) {
|
||||
c.latest_record_time = _currentChat.value.latest_record_time
|
||||
}
|
||||
})
|
||||
|
||||
const controller: AbortController = new AbortController()
|
||||
const param = {
|
||||
question: currentRecord.question,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import BaseAnswer from './BaseAnswer.vue'
|
||||
import { chatApi, ChatInfo, type ChatMessage, ChatRecord } from '@/api/chat.ts'
|
||||
import { Chat, chatApi, ChatInfo, type ChatMessage, ChatRecord } from '@/api/chat.ts'
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import MdComponent from '@/views/chat/component/MdComponent.vue'
|
||||
import ChartBlock from '@/views/chat/chat-block/ChartBlock.vue'
|
||||
@@ -100,6 +100,13 @@ const sendMessage = async () => {
|
||||
if (error) return
|
||||
|
||||
try {
|
||||
_currentChat.value.latest_record_time = new Date()
|
||||
_chatList.value.forEach((c: Chat) => {
|
||||
if (c.id === _currentChat.value.id) {
|
||||
c.latest_record_time = _currentChat.value.latest_record_time
|
||||
}
|
||||
})
|
||||
|
||||
const controller: AbortController = new AbortController()
|
||||
const response = await chatApi.predict(currentRecord.predict_record_id, controller)
|
||||
const reader = response.body.getReader()
|
||||
|
||||
Reference in New Issue
Block a user