Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front

This commit is contained in:
X1627315083@163.com
2026-02-26 16:51:14 +08:00
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>

View File

@@ -76,8 +76,8 @@
// }
// return self.renderToken(tokens, idx, options, env, self)
// }
const str = md.render(props.content.text)
// console.log('str',str)
const str = md.render(props.content.text)
// console.log('str',str)
return str
})
@@ -167,10 +167,10 @@
border-radius: 50%;
}
}
.message-context{
line-height: 2rem;
font-size: 1.4rem;
}
.message-context {
line-height: 2rem;
font-size: 1.4rem;
}
}
.operate {
margin-top: 1.3rem;
@@ -215,3 +215,11 @@
}
}
</style>
<style lang="less">
.message-txt {
ul {
list-style-position: inside;
}
}
</style>

View File

@@ -19,8 +19,9 @@ const props = defineProps({
}
})
//const emit = defineEmits([
//])
const emit = defineEmits([
'restore'
])
const versionsList = ref([])
@@ -70,7 +71,8 @@ const openTree = (state)=>{
treeState.value = state
}
const versionRestore = ()=>{
const versionRestore = () => {
let id = ''
if(selectItem.value?.children?.length > 0){
function findMaxForYourFormat(items) {
@@ -99,6 +101,7 @@ const versionRestore = ()=>{
findAndAddChild(versionsList.value, selectItem.value?.versionId, addObj)
selectItem.value = {...addObj}
treeKey.value++
emit('restore')
}
const versionDelete = (versionDetail)=>{
if(!selectItem.value?.versionId)return