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