feat: 回车检测&restore添加标签

This commit is contained in:
2026-02-26 16:48:08 +08:00
parent 6ac21c278c
commit 13ba5dd939
8 changed files with 148 additions and 69 deletions

View File

@@ -10,6 +10,7 @@
<div class="agent-body flex-1 flex flex-col">
<List ref="listRef" :message-list="messageList" @regenerate="handleRegenerate" />
<Input
ref="inputRef"
is-agent-mode
:generating="isGenerating"
@send="handleSendMessage"
@@ -20,7 +21,7 @@
</template>
<script setup lang="ts">
import { ref, reactive, computed, onUnmounted, onMounted, nextTick,watch } from 'vue'
import { ref, reactive, computed, onUnmounted, onMounted, nextTick, watch } from 'vue'
import List from './List.vue'
import Input from '../../components/Input.vue'
import { fetchAgentReply } from '@/api/agent'
@@ -45,6 +46,7 @@
const messageList = ref([])
const listRef = ref()
const inputRef = ref()
const isGenerating = ref(false)
const isPaused = ref(false) // 标记是否为主动暂停
const params = reactive<AgentParamsType>({
@@ -62,11 +64,15 @@
})
const sketchList = ref([])
watch(sketchList, (newVal) => {
console.log('添加图片链接--------');
emits('update:sketchList', newVal)
}, { deep: true })
watch(
sketchList,
(newVal) => {
console.log('添加图片链接--------')
emits('update:sketchList', newVal)
},
{ deep: true }
)
// 每次请求时创建新的 AbortController
let abort: AbortController
@@ -255,8 +261,8 @@ watch(sketchList, (newVal) => {
try {
const jsonData = JSON.parse(jsonText)
console.log('jsonData', jsonData);
console.log('jsonData', jsonData)
// 赋值 project_id 和 version_id
// if (jsonData.project_id) params.projectID = jsonData.project_id
// if (jsonData.version_id) params.versionID = jsonData.version_id
@@ -354,6 +360,10 @@ watch(sketchList, (newVal) => {
true
)
}
defineExpose({
inputRef
})
</script>
<style lang="less" scoped>