This commit is contained in:
lzp
2026-03-03 11:10:45 +08:00
8 changed files with 77 additions and 52 deletions

Binary file not shown.

View File

@@ -37,7 +37,7 @@ export default {
wechatLogin: '使用微信登录',
indexTip: '一个多智能体画布,用于快速、趋势驱动的设计迭代。',
sendCodeError: '发送验证码失败',
retrievePassword: '找回密码',
retrievePassword: '找回密码'
},
Nuic: {
hiName: '你好,{name}。这是 Fiphant。',
@@ -104,9 +104,9 @@ export default {
Input: {
placeholder: '请输入',
selectPlaceholder: '请选择',
type: '类型',
area: '地区',
style: '风格',
typePlaceholder: '类型',
areaPlaceholder: '地区',
stylePlaceholder: '风格',
types: {
sofa: '沙发',
desk: '书桌',
@@ -138,7 +138,7 @@ export default {
france: '法国',
japan: '日本',
canada: '加拿大',
germany: '德国',
germany: '德国'
},
agent: {
copySuccess: '文本已复制到剪贴板',
@@ -165,7 +165,7 @@ export default {
restoreHint: '恢复后将显示该对话。',
cancel: '取消',
Confirm: '确认',
export: '导出',
export: '导出'
},
//generateSketch
generateSketch: {

View File

@@ -113,7 +113,7 @@
const handleSendMessage = async (
message: {
text: string
images: Array<{ url: string; name: string }>,
images: Array<{ url: string; name: string }>
tempImages: any[]
},
skipUserMessage = false
@@ -129,7 +129,7 @@
id: messageList.value.length + 1,
text: message.text,
isUser: true,
imageUrls:message.tempImages
imageUrls: message.tempImages
})
}
@@ -360,9 +360,32 @@
)
}
const setChatInfo = (data) => {
// messageList.value = list
const setChatInfo = (info) => {
const initialData = agentStore.getInitialProjectData
if (isGenerating.value || initialData) return
const data = info.conversation
let project = info.project
if (info.id) {
project = info
}
params.versionID = ''
sketchList.value = []
if (project) {
params.configParams.type = project.type
params.configParams.region = project.area
params.configParams.style = project.style
params.configParams.temperature = project.temperature
}
// 如果没有数据,直接返回
if (!data) {
messageList.value = []
return
}
const { ancestors, current } = data
const imgList = []
const ancestorsList = []
if (ancestors) {
@@ -395,11 +418,12 @@
}
}) || []
messageList.value = [...ancestorsList, ...currentList]
params.versionID = current.id
sketchList.value = imgList
// console.log('messagelist:', messageList.value)
// debugger
// 延迟设置新数据,确保 UI 有时间响应清空操作
nextTick(() => {
messageList.value = [...ancestorsList, ...currentList]
params.versionID = current?.id
sketchList.value = imgList
})
}
defineExpose({
@@ -423,7 +447,6 @@
.agent-header {
height: 7.4rem;
border-bottom: 0.1rem solid #c9c9c9;
font-family: 'GeneralMedium';
padding: 1.4rem 3.4rem 1.4rem 3.1rem;
.agent-title {

View File

@@ -1,6 +1,9 @@
<template>
<div class="agent-item">
<div class="message-wrapper flex" :class="{ 'is-user': content.isUser }">
<div
class="message-wrapper flex"
:class="{ 'is-user': content.isUser, 'is-loading': content.loading }"
>
<div class="thumb">
<img :src="content.isUser ? userThumb : agentThumb" class="thumb-icon" />
</div>
@@ -8,7 +11,7 @@
class="message-context"
v-show="!content.loading && !content.thinking && !content.streaming"
>
<div class="img-list flex">
<div class="img-list flex" v-if="imageList.length > 0">
<img
v-for="(item, index) in imageList"
:key="'img-' + index"
@@ -35,8 +38,15 @@
</template>
</div>
</div>
<div class="message-context" v-show="content.loading">
<div class="generating">Generating...</div>
<div class="message-context loading" v-show="content.loading">
<!-- <img src="@/assets/images/generate-loading.gif" alt="loading" class="loading-gif" /> -->
<video
src="@/assets/images/generate-loading.mp4"
autoplay
loop
muted
class="loading-gif"
></video>
</div>
<div class="message-context" v-show="content.thinking">
<div class="thinking">
@@ -111,7 +121,7 @@
{
name: 'refreshTransparent',
action: () => {
emit('regenerate')
// emit('regenerate')
}
},
{
@@ -166,6 +176,9 @@
flex-direction: row-reverse;
column-gap: 1.3rem;
}
&.is-loading {
align-items: center;
}
.thumb {
flex-shrink: 0;
@@ -200,18 +213,12 @@
height: 6.8rem;
border: 0.1rem solid #cdcdcd;
border-radius: 1.5rem;
object-fit: contain;
}
}
.generating {
font-family: 'GeneralBold';
font-weight: 600;
font-size: 1.55rem;
background: linear-gradient(45deg, #f2ab4a, #ff6b75, #fe3b55);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
text-fill-color: transparent;
.loading-gif {
width: 13.7rem;
}
.thinking {

View File

@@ -187,7 +187,6 @@
border-radius: 2rem;
background-color: #fff;
border: 0.2rem solid #e5e5e5;
font-family: 'GeneralMedium';
font-size: 1.4rem;
padding: 0 0.9rem 0 1.4rem;
cursor: pointer;

View File

@@ -54,18 +54,16 @@
)
}
const handleSelectNode = () => {
console.log('handleSelectNode')
getNodeAncestors({ projectId: projectStore.state.id, id: projectStore.state.nodeId }).then(
(res) => {
console.log('res', res)
agentRef.value.setChatInfo(res)
agentRef.value.setChatInfo({ conversation: res, project: {} })
}
)
}
const handleGetProjectInfoAndHistory = () => {
getProjectInfo({ id: route.params.id }).then((res) => {
if (res?.conversation) agentRef.value.setChatInfo(res.conversation)
if (res) agentRef.value.setChatInfo(res)
let data = res?.project || res
if (data?.latestNodeId) data.nodeId = data.latestNodeId
projectStore.setProject({

View File

@@ -232,15 +232,15 @@
formData.append('file', file)
uploadImage(formData).then((res) => {
const reader = new FileReader()
reader.onload = (e) => {
uploadedImages.value.push({
url: e.target?.result as string,
name: file.name,
path: res
})
}
reader.readAsDataURL(file)
const reader = new FileReader()
reader.onload = (e) => {
uploadedImages.value.push({
url: e.target?.result as string,
name: file.name,
path: res
})
}
reader.readAsDataURL(file)
})
}
})
@@ -565,6 +565,9 @@
const handleCreateProject = async () => {
// 这里可以添加创建项目的逻辑
if (!inputValue.value.trim()) {
return
}
const params = {
type: typeValue.value,
area: areaValue.value,
@@ -674,7 +677,7 @@
.preview-image {
width: 100%;
height: 100%;
object-fit: cover;
object-fit: contain;
border-radius: 0.8rem;
}
@@ -723,7 +726,6 @@
height: 100%;
box-shadow: none;
border: 0.1rem solid rgba(0, 0, 0, 0.1);
font-family: 'GeneralMedium';
font-weight: 500;
font-size: 1.4rem;
.el-select__placeholder {
@@ -846,7 +848,6 @@
}
.fida-style-popover-header {
font-family: 'GeneralMedium';
font-weight: 500;
font-size: 1.6rem;
color: #000;
@@ -900,7 +901,6 @@
}
.fida-style-popover-item .fida-option-label {
font-family: 'GeneralMedium';
font-weight: 500;
font-size: 1.2rem;
color: #fff;
@@ -926,7 +926,6 @@
color: #fff;
border: none;
border-radius: 3.8rem;
font-family: 'GeneralMedium';
font-weight: 500;
font-size: 1.4rem;
cursor: pointer;
@@ -1023,7 +1022,6 @@
height: 4.4rem;
display: inline-flex;
border: 0.11rem solid #0000001a;
font-family: 'GeneralMedium';
font-weight: 500;
font-size: 1.8rem;
column-gap: 0;

View File

@@ -19,12 +19,12 @@ import Input from './components/Input.vue'
.slogan{
color: #000;
font-size: 6rem;
font-family: 'GeneralMedium';
font-family: 'Medium';
font-weight: 500;
text-align: center;
margin-bottom: 5.6rem;
.fiDA{
font-family: 'GeneralBold';
font-family: 'Bold';
font-weight: 600;
}
}