修复对话生成没有更新树

This commit is contained in:
X1627315083@163.com
2026-03-02 13:40:17 +08:00
parent 1d318f4094
commit 4857376736
4 changed files with 10 additions and 22 deletions

View File

@@ -63,11 +63,10 @@
}
const handleGetProjectInfoAndHistory = () => {
getProjectInfo({ id: projectStore.state.id }).then((res) => {
// console.log('1111111',res);
agentRef.value.setChatInfo(res.conversation)
let data = res.project
if(data.latestNodeId)data.nodeId = data.latestNodeId
getProjectInfo({ id: route.params.id }).then((res) => {
if(res?.conversation)agentRef.value.setChatInfo(res.conversation)
let data = res?.project || res
if(data?.latestNodeId)data.nodeId = data.latestNodeId
projectStore.setProject({
...data,
})
@@ -79,15 +78,7 @@
watch(
() => proJectId.value,
(newVal, oldVal) => {
if (newVal) {
projectStore.clearProject()
projectStore.setId(newVal)
}
}
)
watch(
() => projectStore.state.id,
(newVal, oldVal) => {
projectStore.clearProject()
if (newVal) {
handleGetProjectInfoAndHistory()
}
@@ -95,7 +86,8 @@
)
onMounted(() => {
if (projectStore.state.id) {
projectStore.clearProject()
if (proJectId.value) {
handleGetProjectInfoAndHistory()
}
})