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

View File

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

View File

@@ -1,6 +1,9 @@
<template> <template>
<div class="agent-item"> <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"> <div class="thumb">
<img :src="content.isUser ? userThumb : agentThumb" class="thumb-icon" /> <img :src="content.isUser ? userThumb : agentThumb" class="thumb-icon" />
</div> </div>
@@ -8,7 +11,7 @@
class="message-context" class="message-context"
v-show="!content.loading && !content.thinking && !content.streaming" v-show="!content.loading && !content.thinking && !content.streaming"
> >
<div class="img-list flex"> <div class="img-list flex" v-if="imageList.length > 0">
<img <img
v-for="(item, index) in imageList" v-for="(item, index) in imageList"
:key="'img-' + index" :key="'img-' + index"
@@ -35,8 +38,15 @@
</template> </template>
</div> </div>
</div> </div>
<div class="message-context" v-show="content.loading"> <div class="message-context loading" v-show="content.loading">
<div class="generating">Generating...</div> <!-- <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>
<div class="message-context" v-show="content.thinking"> <div class="message-context" v-show="content.thinking">
<div class="thinking"> <div class="thinking">
@@ -111,7 +121,7 @@
{ {
name: 'refreshTransparent', name: 'refreshTransparent',
action: () => { action: () => {
emit('regenerate') // emit('regenerate')
} }
}, },
{ {
@@ -166,6 +176,9 @@
flex-direction: row-reverse; flex-direction: row-reverse;
column-gap: 1.3rem; column-gap: 1.3rem;
} }
&.is-loading {
align-items: center;
}
.thumb { .thumb {
flex-shrink: 0; flex-shrink: 0;
@@ -200,18 +213,12 @@
height: 6.8rem; height: 6.8rem;
border: 0.1rem solid #cdcdcd; border: 0.1rem solid #cdcdcd;
border-radius: 1.5rem; border-radius: 1.5rem;
object-fit: contain;
} }
} }
.generating { .loading-gif {
font-family: 'GeneralBold'; width: 13.7rem;
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;
} }
.thinking { .thinking {

View File

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

View File

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

View File

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

View File

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