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

This commit is contained in:
X1627315083@163.com
2026-03-27 09:37:09 +08:00
30 changed files with 585 additions and 325 deletions

View File

@@ -495,6 +495,7 @@
let combinedContent = item.content || ''
let combinedThinkingText = item.reasoning || ''
let combinedImageUrl = item.image_url || null
let webAddress = item.webAddress || null
// 继续往后找连续的 assistant 消息
let j = i + 1
while (j < dialogue.length && dialogue[j].role === 'assistant') {
@@ -504,6 +505,12 @@
if (dialogue[j].image_url) {
combinedImageUrl = dialogue[j].image_url
}
if (dialogue[j].webAddress) {
combinedContent += `<slot slot-name="url"></slot>`
webAddress = dialogue[j].webAddress
// console.log('webAddress22222222222222', dialogue[j].webAddress)
// debugger
}
j++
}
@@ -518,6 +525,7 @@
thinkingText: combinedThinkingText,
text: combinedContent,
image_url: combinedImageUrl,
webAddress: !!webAddress ? JSON.parse(webAddress) : null,
isUser: false,
id: result.length + 1,
sessionId: sessionId
@@ -601,6 +609,11 @@
return
}
const { ancestors, current } = data
current.dialogue.forEach((item) => {
if (item.webAddress) {
console.log(item)
}
})
const imgList = []
const ancestorsList = []

View File

@@ -73,7 +73,7 @@
<span>{{ content.webAddress?.length }} web pages have been retrieved.</span>
</div>
</div>
<Pause v-show="showStop && isLast" />
<Pause v-show="showStop" :key="props.content.createTime" />
<div
v-show="!content.streaming"
class="operate flex"
@@ -133,6 +133,14 @@
isLast: Boolean
}>()
// watch(
// () => props.content,
// (newVal) => {
// console.log('props', newVal)
// },
// { deep: true,immediate: true }
// )
const emit = defineEmits(['regenerate'])
const userAvatar = computed(() => {
@@ -318,12 +326,14 @@
width: 100%;
height: 100%;
border-radius: 50%;
object-fit: cover;
}
}
.message-context {
line-height: 2rem;
font-size: 1.4rem;
width: 82%;
word-break: break-word;
}
&.is-user .message-context {
width: fit-content;

View File

@@ -13,11 +13,12 @@
width: 100%;
height: 3.6rem;
line-height: 3.6rem;
column-gap: 0.6rem;
padding: 0 1.2rem;
column-gap: 0.6rem;
padding: 0 1.2rem;
background-color: #fffcf4;
border-radius: 0.4rem;
margin-top: 1rem;
border-radius: 0.4rem;
margin-top: 1rem;
color: #ff7a51;
&::before {
content: '';
@@ -30,22 +31,18 @@
rgba(233, 121, 60, 0.3) 1.61%,
rgba(255, 207, 144, 0.3) 101.01%
);
-webkit-mask:
linear-gradient(#fff 0 0) content-box,
linear-gradient(#fff 0 0);
mask:
linear-gradient(#fff 0 0) content-box,
linear-gradient(#fff 0 0);
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
}
.c-svg{
width: initial;
.svg-icon{
width: 1.2rem;
height: 1.2rem;
}
}
.c-svg {
width: initial;
.svg-icon {
width: 1.2rem;
height: 1.2rem;
}
}
}
</style>

View File

@@ -1,8 +1,8 @@
<template>
<div class="report-card" :class="{ 'is-url': isUrl, 'is-sketch': isSketch }">
<div class="report-card-header">
<span v-if="!isUrl && !isSketch">{{ title || '' }}</span>
<div v-else class="web-sources flex align-center">
<!-- <span v-if="!isUrl && !isSketch">{{ title || '' }}</span> -->
<div class="web-sources flex align-center">
<span>{{ title || '' }}</span>
<img src="@/assets/images/link.png" class="link-icon" />
</div>
@@ -35,16 +35,19 @@
.report-card {
cursor: pointer;
width: 100%;
margin: 2.4rem 0;
height: 11.2rem;
margin: 1.2rem 0 0;
min-height: 11.2rem;
background: url('@/assets/images/report-card.png') no-repeat;
background-size: 100% 100%;
padding: 2.9rem;
overflow: hidden;
position: relative;
margin-bottom: 0;
&.is-url {
background: url('@/assets/images/link-card.png') no-repeat;
background-size: 100% 100%;
margin: 2.4rem 0;
}
&.is-sketch {
background: url('@/assets/images/sketch-card.png') no-repeat;
@@ -61,7 +64,7 @@
&-header {
font-family: 'Medium';
font-size: 1.6rem;
font-size: 1.2rem;
margin-bottom: 1.3rem;
overflow: hidden;
text-overflow: ellipsis;
@@ -80,7 +83,7 @@
&-content {
font-family: 'Regular';
font-weight: 300;
font-size: 1.6rem;
font-size: 1.2rem;
color: #7c7c7c;
}
}

View File

@@ -16,7 +16,7 @@
class="preview-image"
@click="previewImage(image.url)"
/>
<div class="image-remove-btn" @click="removeImage(index)">
<div class="image-remove-btn" @click="removeImage(index, image)">
<SvgIcon name="delete" size="16" />
</div>
</div>
@@ -305,8 +305,16 @@
}
// 移除图片
const removeImage = (index: number) => {
uploadedImages.value.splice(index, 1)
const removeImage = (index: number, item: any) => {
if (quoteList.value.includes(item)) {
const quoteIndex = quoteList.value.indexOf(item)
if (quoteIndex > -1) {
quoteList.value.splice(quoteIndex, 1)
}
return
} else {
uploadedImages.value.splice(index, 1)
}
}
const styleKeys: string[] = [
@@ -472,8 +480,7 @@
customPlaceholder.value = placeholderSpan
// 打字机效果显示placeholder文本
const placeholderText =
'Generate a furniture trending report for 2026, including popular styles and design directions.'
const placeholderText = t('Input.reportPlaceholder')
typeWriterEffect(placeholderSpan, placeholderText)
const removePlaceholderOnInput = () => {
@@ -815,6 +822,8 @@
}
const handleQuote = (url: string) => {
const hasQuoted = quoteList.value.includes(url)
if (hasQuoted) return
quoteList.value.push(url)
}
onUnmounted(() => {

View File

@@ -16,13 +16,13 @@
<span class="title" v-show="!isCollapse">{{ $t('Home.home') }}</span>
</div> -->
<div class="menu-item" @click="onHistory" :class="{ active: showHistory }">
<span class="icon"><svg-icon name="history" size="24" /></span>
<span class="icon"><svg-icon name="history" size="16" /></span>
<span class="title" v-show="!isCollapse">{{ $t('Home.history') }}</span>
<span class="icon jiantou" v-show="!isCollapse"
><svg-icon name="arrow-right" size="14" />
</span>
</div>
<div class="history-list" v-show="!isCollapse && showHistory">
<div class="history-list mini-scrollbar" v-show="!isCollapse && showHistory">
<div v-for="item in list" :key="item.name" class="history-item">
<div v-if="item.title" class="title">{{ item.name }}</div>
<div
@@ -307,7 +307,8 @@
> .history-list {
flex: 1;
overflow-y: auto;
width: 23.2rem;
width: 26.4rem;
padding: 0 1.5rem;
margin: 1rem auto 0;
> .history-item {
width: 100%;