|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
<script setup lang='ts'>
|
|
|
|
|
import type { Ref } from 'vue'
|
|
|
|
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
|
@ -40,6 +41,7 @@ const conversationList = computed(() => dataSources.value.filter(item => (!item.
|
|
|
|
|
|
|
|
|
|
const prompt = ref<string>('')
|
|
|
|
|
const loading = ref<boolean>(false)
|
|
|
|
|
const inputRef = ref<Ref | null>(null)
|
|
|
|
|
|
|
|
|
|
// 添加PromptStore
|
|
|
|
|
const promptStore = usePromptStore()
|
|
|
|
@ -452,6 +454,8 @@ const footerClass = computed(() => {
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
scrollToBottom()
|
|
|
|
|
if (inputRef.value)
|
|
|
|
|
inputRef.value?.focus()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
@ -532,6 +536,7 @@ onUnmounted(() => {
|
|
|
|
|
<NAutoComplete v-model:value="prompt" :options="searchOptions" :render-label="renderOption">
|
|
|
|
|
<template #default="{ handleInput, handleBlur, handleFocus }">
|
|
|
|
|
<NInput
|
|
|
|
|
ref="inputRef"
|
|
|
|
|
v-model:value="prompt"
|
|
|
|
|
type="textarea"
|
|
|
|
|
:placeholder="placeholder"
|
|
|
|
|