调整行为树保存信息

This commit is contained in:
2026-04-16 10:44:46 +08:00
parent 012939829c
commit b56d57af44

View File

@@ -85,6 +85,7 @@ import { createTree, findOneTreeById, findOneTreeByPlatformId, updateTree, findS
import TressCard from './trees-card.vue';
import ScenariosCard from './scenarios-card.vue';
import NodesCard from './nodes-card.vue';
import { generateKey } from '@/utils/strings';
const TeleportContainer = defineComponent(getTeleport());
@@ -317,6 +318,7 @@ export default defineComponent({
// 将节点添加到画布
graph.value?.addNode(node as Node);
});
fitToScreen();
}
if (currentBehaviorTree.value?.graph.edges) {
// 然后添加所有边,确保包含桩点信息
@@ -376,10 +378,11 @@ export default defineComponent({
id: 0,
name: '行为树',
description: null,
englishName: null,
englishName: generateKey('scenario'),
xmlContent: null,
createdAt: null,
platformId: currentPlatformId.value,
scenarioId: currentScenarioId.value,
graph: {
edges: [],
nodes: [],