This commit is contained in:
lzp
2026-03-27 16:07:14 +08:00
7 changed files with 45 additions and 16 deletions

View File

@@ -62,7 +62,7 @@
<threeModel :currentData="currentData" />
</template>
</baseModal>
<Assistant />
<!-- <Assistant /> -->
</template>
<script setup lang="ts">

View File

@@ -2,6 +2,7 @@
<el-dialog
class="base-modal"
v-model="showDialog"
destroy-on-close
align-center
:show-close="false"
:width="modalWidth"

View File

@@ -81,7 +81,8 @@ 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:',
notFound: 'Project not found',
},
Country: {
unitedStates: 'United States',

View File

@@ -82,7 +82,8 @@ export default {
userAgreement: '用户协议',
privacyPolicy: '隐私政策',
view: '查看',
remainingNum: '剩余上传头像次数:'
remainingNum: '剩余上传头像次数:',
notFound: '项目不存在',
},
Country: {
unitedStates: '美国',

View File

@@ -36,10 +36,13 @@
import { useProjectStore } from '@/stores'
import { getProjectInfo } from '@/api/agent'
import { clearNodeChat, getNodeAncestors } from '@/api/versitonTree'
import { useRoute } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import MyEvent from '@/utils/myEvent'
import { useI18n } from 'vue-i18n'
const route = useRoute()
const router = useRouter()
const { t } = useI18n()
const projectStore = useProjectStore()
const previewRef = ref(null)
@@ -90,6 +93,11 @@
const handleGetProjectInfoAndHistory = () => {
handleOpenSketch()
getProjectInfo({ id: route.params.id }).then((res) => {
if(!res) {
router.push({ name: 'mainInput' })
ElMessage.warning(t('Home.notFound'))
return
}
if (res) agentRef.value.setChatInfo(res)
let data = res?.project || res
if (data?.latestNodeId) data.nodeId = data.latestNodeId
@@ -124,6 +132,7 @@
projectStore.clearProject()
if (newVal) {
handleGetProjectInfoAndHistory()
MyEvent.emit('projectChange')
}
}
)

View File

@@ -494,12 +494,12 @@
editorRef.value?.addEventListener('input', removePlaceholderOnInput)
}
const toogltReportTag = () => {
const toogltReportTag = (clear = false) => {
stopTypewriter() // 移除标签时停止打字机效果
// 清理掉已被删除的标签引用(从 DOM 中移除的元素)
reportTags.value = reportTags.value.filter((tag) => tag.parentNode !== null)
if (reportTags.value.length > 0) {
if (reportTags.value.length > 0 ) {
// 移除所有标签及其关联的零宽空格
reportTags.value.forEach((tag) => {
if (
@@ -722,14 +722,6 @@
})
})
// 初始化编辑器高度
onMounted(() => {
MyEvent.add('quote', handleQuote)
nextTick(() => {
autoResizeEditor()
})
})
const typeValue = ref<string>('')
const areaValue = ref<string>('')
const styleValue = ref<string>('')
@@ -826,8 +818,27 @@
if (hasQuoted) return
quoteList.value[0] = url
}
const handleInitInput = () => {
inputValue.value = ''
uploadedImages.value = []
quoteList.value = []
toogltReportTag(true)
if (editorRef.value) {
editorRef.value.innerHTML = ''
}
}
onMounted(() => {
MyEvent.add('quote', handleQuote)
MyEvent.add('projectChange', handleInitInput)
nextTick(() => {
autoResizeEditor()
})
})
onUnmounted(() => {
MyEvent.remove('quote', handleQuote)
MyEvent.remove('projectChange', handleInitInput)
})
// 暴露方法给父组件
defineExpose({

View File

@@ -44,7 +44,7 @@
<span class="label" v-show="!item.edit">{{ item.name }}</span>
<el-popover
placement="right"
trigger="hover"
trigger="contextmenu"
width="10rem"
popper-style="
padding: .6rem 0.7rem;
@@ -54,7 +54,7 @@
v-model:visible="item.visible"
>
<template #reference>
<span @click.stop class="icon">
<span @click.stop="openPopover(item)" class="icon">
<svg-icon name="more" size="16" />
</span>
</template>
@@ -207,6 +207,12 @@
}
})
}
const openPopover = (item: any) => {
list.value.forEach((item: any) => {
item.visible = false
})
item.visible = !item.visible
}
onMounted(() => {
MyEvent.add('newTitle', replaceTitle)
})