diff --git a/src/assets/css/style.css b/src/assets/css/style.css index f479d8b..ac0dcd0 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -79,3 +79,20 @@ body, --el-color-primary-light-9: #fff2ec; --el-color-primary-dark-2: #cc6241; } +.el-select, +.el-popper { + --el-color-primary: #6c6c6c; + /* 主灰色 */ + --el-color-primary-light-3: #8a8a8a; + /* 较浅的灰色(混合20%白) */ + --el-color-primary-light-5: #a8a8a8; + /* 更浅的灰色(混合33%白) */ + --el-color-primary-light-7: #c6c6c6; + /* 浅灰色(混合47%白) */ + --el-color-primary-light-8: #d4d4d4; + /* 很浅的灰色(混合53%白) */ + --el-color-primary-light-9: #e3e3e3; + /* 极浅的灰色(混合60%白) */ + --el-color-primary-dark-2: #565656; + /* 深灰色(加深20%) */ +} diff --git a/src/assets/css/style.less b/src/assets/css/style.less index 22d4fcd..fd26490 100644 --- a/src/assets/css/style.less +++ b/src/assets/css/style.less @@ -95,4 +95,13 @@ body, --el-color-primary-light-8: #ffe8df; // 很浅的橙红(混合53%白) --el-color-primary-light-9: #fff2ec; // 极浅的橙红(混合60%白) --el-color-primary-dark-2: #cc6241; // 深橙红(加深20%) -} \ No newline at end of file +} +.el-select, .el-popper{ + --el-color-primary: #6c6c6c; /* 主灰色 */ + --el-color-primary-light-3: #8a8a8a; /* 较浅的灰色(混合20%白) */ + --el-color-primary-light-5: #a8a8a8; /* 更浅的灰色(混合33%白) */ + --el-color-primary-light-7: #c6c6c6; /* 浅灰色(混合47%白) */ + --el-color-primary-light-8: #d4d4d4; /* 很浅的灰色(混合53%白) */ + --el-color-primary-light-9: #e3e3e3; /* 极浅的灰色(混合60%白) */ + --el-color-primary-dark-2: #565656; /* 深灰色(加深20%) */ +} diff --git a/src/assets/icons/textToolsDecoration.svg b/src/assets/icons/textToolsDecoration.svg new file mode 100644 index 0000000..725777a --- /dev/null +++ b/src/assets/icons/textToolsDecoration.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/icons/textToolsStyle.svg b/src/assets/icons/textToolsStyle.svg new file mode 100644 index 0000000..8c9a101 --- /dev/null +++ b/src/assets/icons/textToolsStyle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/icons/textToolsweight.svg b/src/assets/icons/textToolsweight.svg new file mode 100644 index 0000000..2cbd3b4 --- /dev/null +++ b/src/assets/icons/textToolsweight.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/Canvas/FlowCanvas/components/header-tools.vue b/src/components/Canvas/FlowCanvas/components/header-tools.vue index 2f840b0..ecfe5fd 100644 --- a/src/components/Canvas/FlowCanvas/components/header-tools.vue +++ b/src/components/Canvas/FlowCanvas/components/header-tools.vue @@ -44,7 +44,7 @@ const tools = ref([ { name: TOOLS.SELECT, icon: 'c-select', iconSize: 16, disabled: ref(false) }, { name: TOOLS.MOVE, icon: 'c-move', iconSize: 18, disabled: ref(false) }, - { name: TOOLS.TEXT, icon: 'c-text', iconSize: 18, disabled: ref(false) }, + { name: TOOLS.TEXT, icon: 'c-text', iconSize: 22, disabled: ref(false) }, { type: 'line' }, { name: TOOLS.UNDO, diff --git a/src/components/Canvas/FlowCanvas/components/nodes/text.vue b/src/components/Canvas/FlowCanvas/components/nodes/text.vue index 331a930..c4b5892 100644 --- a/src/components/Canvas/FlowCanvas/components/nodes/text.vue +++ b/src/components/Canvas/FlowCanvas/components/nodes/text.vue @@ -4,6 +4,7 @@
+
+ +
@@ -19,6 +23,7 @@ + + diff --git a/src/components/Canvas/FlowCanvas/manager/NodeManager.ts b/src/components/Canvas/FlowCanvas/manager/NodeManager.ts index ee1298b..50b202c 100644 --- a/src/components/Canvas/FlowCanvas/manager/NodeManager.ts +++ b/src/components/Canvas/FlowCanvas/manager/NodeManager.ts @@ -47,7 +47,7 @@ export class NodeManager { //获取上级节点所生成的最后一个node,设置位置为最后一个节点的xy 加上 节点间距 const superiorGenerateNodes = this.stateManager.getSubordNodes(superiorID) const currentNode = superiorGenerateNodes.find((node) => { - return node.data.createIndexPosition === options?.data?.createIndexPosition + return (node.data.createIndexPosition === options?.data?.createIndexPosition && options?.data?.createIndexPosition) }) const endGenerateNode = superiorGenerateNodes.reduce((max, current) => { return current.data.createIndexPosition > max.data.createIndexPosition ? current : max diff --git a/src/components/Canvas/FlowCanvas/manager/StateManager.ts b/src/components/Canvas/FlowCanvas/manager/StateManager.ts index 5165bb4..8b6c546 100644 --- a/src/components/Canvas/FlowCanvas/manager/StateManager.ts +++ b/src/components/Canvas/FlowCanvas/manager/StateManager.ts @@ -127,7 +127,7 @@ export class StateManager { getNodeById(id: string) { return this.nodes.value.find((node: NodesItem) => node.id === id) } /** 获取下级节点 */ getSubordNodeById(id: string) { return this.nodes.value.find((node: NodesItem) => node.data.superiorID === id) } - getLastNode() { console.log(this.nodes.value); return this.nodes.value[this.nodes.value.length - 1] } + getLastNode() { return this.nodes.value[this.nodes.value.length - 1] } /** 获取上级生成节点的图片 */ getSuperiorNodeImage(superiorID: string) { diff --git a/src/lang/en.ts b/src/lang/en.ts index 0db9570..31f6a52 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -36,7 +36,7 @@ export default { wechatLogin: 'Sign in with Wechat', indexTip: 'A multi-agent canvas for rapid, trend driven design iteration.', sendCodeError: 'Send code error', - retrievePassword: 'Retrieve password', + retrievePassword: 'Retrieve password' }, Nuic: { hiName: 'Hi, {name}. This is Fiphant.', @@ -51,7 +51,7 @@ export default { basedIn: 'Based in', role: 'Role', allSet: 'All set!', - loadingTip: 'We’re customizing your dashboard.', + loadingTip: 'We’re customizing your dashboard.' }, Home: { creditsNum: 'Credits: {num}', @@ -81,9 +81,9 @@ export default { userAgreement: 'User Agreement', privacyPolicy: 'Privacy Policy', view: 'View', - remainingNum: 'Remaining number of times to upload profile picture:', + remainingNum: 'Remaining number of times to upload profile picture:' }, - Country:{ + Country: { unitedStates: 'United States', singapore: 'Singapore', australia: 'Australia', @@ -93,17 +93,18 @@ export default { france: 'France', japan: 'Japan', canada: 'Canada', - germany: 'Germany', + germany: 'Germany' }, Role: { designer: 'Designer', student: 'Student', teacher: 'Teacher', parent: 'Parent', - other: 'Other', + other: 'Other' }, Input: { - placeholder: 'Describe the design you want to create... e.g. Modern wooden chair, Bauhaus style', + placeholder: + 'Describe the design you want to create... e.g. Modern wooden chair, Bauhaus style', selectPlaceholder: 'Please select', typePlaceholder: 'Type', areaPlaceholder: 'Region', @@ -146,11 +147,12 @@ export default { france: 'France', japan: 'Japan', canada: 'Canada', - germany: 'Germany', + germany: 'Germany' }, agent: { copySuccess: 'Text copied to clipboard', - copyFaild: 'Copy failed. Your browser may be restricting clipboard access. Please try copying manually.', + copyFaild: + 'Copy failed. Your browser may be restricting clipboard access. Please try copying manually.', Download: 'Download', deleteSuccess: 'Successfully deleted', thinking: 'Thinking...', @@ -158,6 +160,8 @@ export default { quote: 'Quote', delete: 'Delete', edit: 'Edit', + generatingReport: + 'We are generating your report. This may take a few minutes, but you can continue with other tasks while it’s being generated.' }, // Version Tree @@ -172,13 +176,13 @@ export default { restore: 'Restore', newChat: 'New Chat', delete: 'Delete', - deleteChat:'Delete chat?', - deleteHint:'Once deleted, you won’t be able to view this conversation again.', - restoreChat:'Restore chat?', - restoreHint:'Once deleted, you won’t be able to view this conversation again.', + deleteChat: 'Delete chat?', + deleteHint: 'Once deleted, you won’t be able to view this conversation again.', + restoreChat: 'Restore chat?', + restoreHint: 'Once deleted, you won’t be able to view this conversation again.', Cancel: 'Cancel', Confirm: 'Confirm', - export: 'Export', + export: 'Export' }, flowCanvas: { deleteCardConfirm: 'Are you sure you want to delete this function card?', @@ -187,14 +191,14 @@ export default { confirmLeave: 'Are you sure you want to leave? You may have unsaved changes.', cannotFindSuperiorImage: 'Cannot find the superior image', deleteSubordinateCard: 'After deletion, all the function cards will also be deleted.', - initialNodeProhibited: 'Initial node is prohibited from being deleted.', + initialNodeProhibited: 'Initial node is prohibited from being deleted.' }, assistant: { - inputPlaceholder: 'Ask anything', + inputPlaceholder: 'Ask anything' }, //3d面板 threeModel: { loading: 'Loading', - download: 'Download', + download: 'Download' } } diff --git a/src/lang/zh-cn.ts b/src/lang/zh-cn.ts index 44e444c..e7e33e4 100644 --- a/src/lang/zh-cn.ts +++ b/src/lang/zh-cn.ts @@ -82,7 +82,7 @@ export default { userAgreement: '用户协议', privacyPolicy: '隐私政策', view: '查看', - remainingNum: '剩余上传头像次数:', + remainingNum: '剩余上传头像次数:' }, Country: { unitedStates: '美国', @@ -148,11 +148,12 @@ export default { '复制失败。您的浏览器可能限制了剪贴板访问,请允许浏览器访问剪贴板或尝试手动复制。', Download: '下载', deleteSuccess: '删除成功', - thinking:'已思考', + thinking: '已思考', thinkComplete: '思考完成。', quote: '引用', delete: '删除', edit: '编辑', + generatingReport:'正在为您生成报告,可能需要几分钟时间,生成期间你可以继续进行其他任务' }, // Version Tree @@ -173,7 +174,7 @@ export default { restoreHint: '恢复后将显示该对话。', Cancel: '取消', Confirm: '确认', - export: '导出', + export: '导出' }, //generateSketch generateSketch: { @@ -187,7 +188,7 @@ export default { cancel: '取消', confirmLeave: '您可能有未保存的更改,确定要离开吗?', cannotFindSuperiorImage: '找不到上级图片', - initialNodeProhibited: 'Initial node is prohibited from being deleted.', + initialNodeProhibited: 'Initial node is prohibited from being deleted.' }, assistant: { inputPlaceholder: '请输入' diff --git a/src/views/home/agent/components/Agent.vue b/src/views/home/agent/components/Agent.vue index 8c5fedb..c248b5f 100644 --- a/src/views/home/agent/components/Agent.vue +++ b/src/views/home/agent/components/Agent.vue @@ -28,6 +28,9 @@ import type { AgentParamsType } from '@/api/agent' import { useUserInfoStore, useProjectStore, useAgentStore } from '@/stores' import MyEvent from '@/utils/myEvent' + import { useI18n } from 'vue-i18n' + + const { t } = useI18n() const userStore = useUserInfoStore() const agentStore = useAgentStore() @@ -267,6 +270,7 @@ hasReportEvent = true // contentBody += `` hasReportStarted = true + ElMessage.success(t('agent.generatingReport')) } if ( @@ -337,6 +341,7 @@ } if (jsonData.title) { emits('setTitle', jsonData.title) + MyEvent.emit('newTitle', jsonData.title) } if (hasSketch) { @@ -460,7 +465,13 @@ } // 处理对话列表,将连续的 assistant 消息合并为一条 - const processDialogue = (dialogue, startIndex, existingImgList, sessionId) => { + const processDialogue = ( + dialogue, + startIndex, + existingImgList, + sessionId, + firstReportIndex = -1 + ) => { if (!dialogue || dialogue.length === 0) return [] const result = [] @@ -495,6 +506,11 @@ j++ } + // 如果 firstReportIndex 在当前合并范围内,则把 slot 追加到末尾 + if (firstReportIndex >= i && firstReportIndex < j) { + combinedContent += `` + } + result.push({ ...item, content: combinedContent, @@ -525,13 +541,12 @@ const processSession = (session, imgList, ancestorsList, idCounterRef) => { if (!session) return - // 1. 在 dialogue 第一个 report 有值的项的 content 中插入报告卡片 + // 1. 找到第一个 report 项的索引,供 processDialogue 使用 + let firstReportIndex = -1 if (session.dialogue) { for (let i = 0; i < session.dialogue.length; i++) { if (session.dialogue[i].report) { - session.dialogue[i].content = - `123` + - (session.dialogue[i].content || '') + firstReportIndex = i break } } @@ -554,10 +569,11 @@ } // 4. 处理 dialogue - const list = processDialogue(session.dialogue, 0, imgList, session.id) + const list = processDialogue(session.dialogue, 0, imgList, session.id, firstReportIndex) list.forEach((el) => { el.id = idCounterRef.value++ }) + ancestorsList.push(...list) } diff --git a/src/views/home/agent/components/Item.vue b/src/views/home/agent/components/Item.vue index b892d75..6ea5d8e 100644 --- a/src/views/home/agent/components/Item.vue +++ b/src/views/home/agent/components/Item.vue @@ -5,7 +5,7 @@ :class="{ 'is-user': content.isUser, 'is-loading': content.loading }" >
- +
@@ -120,6 +120,9 @@ import type { CustomAttrs } from '@crazydos/vue-markdown' import rehypeRaw from 'rehype-raw' import MyEvent from '@/utils/myEvent' + import { useUserInfoStore } from '@/stores' + + const userStore = useUserInfoStore() const { t } = useI18n() @@ -128,16 +131,12 @@ isLast: Boolean }>() - // watch( - // () => props, - // (newVal) => { - // console.log('newVal-----', newVal) - // }, - // { immediate: true } - // ) - const emit = defineEmits(['regenerate']) + const userAvatar = computed(() => { + return userStore.state.userInfo?.avatar || userThumb + }) + const imageList = computed(() => { const { imageUrls, role } = props.content const list = [] @@ -340,6 +339,7 @@ .img-list { column-gap: 1rem; margin-bottom: 1.4rem; + justify-content: flex-end; .img-item { width: 6.8rem; height: 6.8rem; diff --git a/src/views/home/agent/components/versionTree/index.vue b/src/views/home/agent/components/versionTree/index.vue index 9448ee0..7edfbbc 100644 --- a/src/views/home/agent/components/versionTree/index.vue +++ b/src/views/home/agent/components/versionTree/index.vue @@ -5,6 +5,7 @@ import Tree from './tree/index.vue' import { findAndAddChild, findAndRemoveChild } from '../../../../../utils/treeDiagram' import { useProjectStore } from '@/stores' import { versionTree } from '@/api/versitonTree' +import { downloadImage } from '@/components/Canvas/tools/tools' const props = defineProps({ versionTreeData: { @@ -138,7 +139,7 @@ const {} = toRefs(data)
-
+
@@ -211,8 +212,10 @@ const {} = toRefs(data) margin-left: auto; margin-top: 2.2rem; margin-right: 3rem; + height: 3.3rem; > .btn{ - padding: .6rem 1.8rem; + padding: 0 1.8rem; + line-height: 3rem; cursor: pointer; display: flex; align-items: center; diff --git a/src/views/home/left-nav.vue b/src/views/home/left-nav.vue index 4278c53..9f47937 100644 --- a/src/views/home/left-nav.vue +++ b/src/views/home/left-nav.vue @@ -84,7 +84,7 @@ - +