Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/FiDA_Front
This commit is contained in:
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: '请输入'
|
||||
|
||||
@@ -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 += `<slot slot-name="card" title="Report" content="Report"></slot>`
|
||||
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 += `<slot slot-name="card" title="Report" content="Report"></slot>`
|
||||
}
|
||||
|
||||
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 =
|
||||
`<slot slot-name="card" title="123" content="123">123</slot>` +
|
||||
(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)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
:class="{ 'is-user': content.isUser, 'is-loading': content.loading }"
|
||||
>
|
||||
<div class="thumb">
|
||||
<img :src="content.isUser ? userThumb : agentThumb" class="thumb-icon" />
|
||||
<img :src="content.isUser ? userAvatar : agentThumb" class="thumb-icon" />
|
||||
</div>
|
||||
<div class="message-context" v-show="!content.loading">
|
||||
<div class="img-list flex" v-if="imageList.length > 0">
|
||||
@@ -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;
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, nextTick } from 'vue'
|
||||
import { computed, ref, nextTick, onMounted, onUnmounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { getProjectList, updateProject, deleteProject } from '@/api/agent'
|
||||
@@ -93,7 +93,8 @@
|
||||
const { t: $t } = useI18n()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
import { useGlobalStore } from '@/stores'
|
||||
import { useGlobalStore, useProjectStore } from '@/stores'
|
||||
const projectStore = useProjectStore()
|
||||
const id = computed(() => route.params.id)
|
||||
const globalStore = useGlobalStore()
|
||||
const isCollapse = computed(() => globalStore.state.homeLeftNavCollapse)
|
||||
@@ -198,8 +199,22 @@
|
||||
}
|
||||
MyEvent.add('updateProjectList', GetProjectList)
|
||||
GetProjectList()
|
||||
|
||||
const replaceTitle = (title: string) => {
|
||||
list.value.forEach((item: any) => {
|
||||
if (String(item.id) === String(projectStore.state.id)) {
|
||||
item.name = title
|
||||
}
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
MyEvent.add('newTitle', replaceTitle)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
MyEvent.remove('newTitle', replaceTitle)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="less" scoped>
|
||||
.left-nav {
|
||||
width: var(--left-nav-collapse-width, 30rem);
|
||||
|
||||
Reference in New Issue
Block a user