Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front
This commit is contained in:
@@ -224,7 +224,13 @@
|
||||
try {
|
||||
const urlParams = new URLSearchParams<AgentParamsType>({
|
||||
...params,
|
||||
configParams: JSON.stringify(params.configParams)
|
||||
// configParams: JSON.stringify(params.configParams)
|
||||
configParams: JSON.stringify({
|
||||
type: params.configParams.type||'',
|
||||
region: params.configParams.region||'',
|
||||
style: params.configParams.style||'',
|
||||
temperature: params.configParams.temperature
|
||||
})
|
||||
})
|
||||
const BASEURL = import.meta.env.VITE_APP_URL
|
||||
|
||||
@@ -668,14 +674,14 @@
|
||||
})
|
||||
}
|
||||
|
||||
// 防止插入重复图片
|
||||
const mergeUniqueKeys = (targetArr, newData) => {
|
||||
// 提取现有数组中所有的 key,存入 Set 以实现 O(1) 查询
|
||||
const existingKeys = new Set(targetArr.flatMap((item) => Object.keys(item)))
|
||||
|
||||
Object.entries(newData).forEach(([key, value]) => {
|
||||
if (!existingKeys.has(key)) {
|
||||
targetArr.push({ [key]: value })
|
||||
existingKeys.add(key) // 防止 newData 内部有重复 key 时重复插入
|
||||
targetArr.unshift({ [key]: value })
|
||||
existingKeys.add(key)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
&-header {
|
||||
font-family: 'Medium';
|
||||
font-size: 1.2rem;
|
||||
margin-bottom: 1.3rem;
|
||||
// margin-bottom: 1.3rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
const projectStore = useProjectStore()
|
||||
|
||||
const previewRef = ref(null)
|
||||
|
||||
const proJectId = computed(() => route.params.id)
|
||||
const agentTitle = ref('Conversation')
|
||||
const previewType = ref<'sketch' | 'report'>('sketch')
|
||||
const VersionTreeIndexRef = ref()
|
||||
@@ -116,8 +116,6 @@
|
||||
})
|
||||
}
|
||||
|
||||
const proJectId = computed(() => route.params.id)
|
||||
|
||||
const handleOpenReport = (data) => {
|
||||
previewRef.value.setSessionId(data.sessionId)
|
||||
previewRef.value.setReport(data.reportName, data.report)
|
||||
@@ -145,10 +143,17 @@
|
||||
}
|
||||
)
|
||||
|
||||
const handleRenameConversation = (item) => {
|
||||
if (String(item.id) === String(proJectId.value)) {
|
||||
handleSetTitle(item.name)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
MyEvent.add('openReport', handleOpenReport)
|
||||
MyEvent.add('openUrls', handleOpenUrls)
|
||||
MyEvent.add('openSketch', handleOpenSketch)
|
||||
MyEvent.add('renameConversation', handleRenameConversation)
|
||||
projectStore.clearProject()
|
||||
if (proJectId.value) {
|
||||
handleGetProjectInfoAndHistory()
|
||||
@@ -158,6 +163,7 @@
|
||||
MyEvent.remove('openReport', handleOpenReport)
|
||||
MyEvent.remove('openUrls', handleOpenUrls)
|
||||
MyEvent.remove('OpenSketch', handleOpenSketch)
|
||||
MyEvent.remove('renameConversation', handleRenameConversation)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -499,7 +499,7 @@
|
||||
// 清理掉已被删除的标签引用(从 DOM 中移除的元素)
|
||||
reportTags.value = reportTags.value.filter((tag) => tag.parentNode !== null)
|
||||
|
||||
if (reportTags.value.length > 0 ) {
|
||||
if (reportTags.value.length > 0) {
|
||||
// 移除所有标签及其关联的零宽空格
|
||||
reportTags.value.forEach((tag) => {
|
||||
if (
|
||||
@@ -783,9 +783,9 @@
|
||||
}
|
||||
|
||||
const params = {
|
||||
type: typeValue.value,
|
||||
area: areaValue.value,
|
||||
style: styleValue.value,
|
||||
type: typeValue.value || '',
|
||||
area: areaValue.value || '',
|
||||
style: styleValue.value || '',
|
||||
useReport: reportTags.value.length > 0,
|
||||
temperature: 0.7
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@
|
||||
const name = e.target.value
|
||||
if (!name) return console.warn('未输入名称,不允许重命名')
|
||||
item.name = name
|
||||
MyEvent.emit('renameConversation', item)
|
||||
updateProject(item.id, { name }).then(() => {
|
||||
GetProjectList()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user