Initial commit
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<div class="ks-model-builder-left">
|
||||
<TressCard
|
||||
ref="treesCardRef"
|
||||
@create-tree="handleCreateTree"
|
||||
@select-tree="handleSelectTree"
|
||||
/>
|
||||
<NodesCard
|
||||
@@ -271,6 +272,30 @@ export default defineComponent({
|
||||
});
|
||||
};
|
||||
|
||||
const handleCreateTree = ()=> {
|
||||
currentBehaviorTree.value = {
|
||||
id: 0,
|
||||
name: '行为树',
|
||||
description: null,
|
||||
englishName: null,
|
||||
xmlContent: null,
|
||||
createdAt: null,
|
||||
graph: {
|
||||
edges: [],
|
||||
nodes: [],
|
||||
},
|
||||
updatedAt: null,
|
||||
}
|
||||
currentNodeGraph.value = {
|
||||
edges: [],
|
||||
nodes: [],
|
||||
}
|
||||
selectedModelNode.value = null;
|
||||
selectedNodeTaskElement.value = null;
|
||||
|
||||
createElements();
|
||||
}
|
||||
|
||||
// 初始化X6画布
|
||||
const initGraph = () => {
|
||||
if (!canvas.value) {
|
||||
@@ -352,6 +377,14 @@ export default defineComponent({
|
||||
graph: graphData,
|
||||
xmlContent: JSON.stringify(graphData),
|
||||
};
|
||||
if(! newTree.name){
|
||||
message.error('行为树名称不能为空.');
|
||||
return;
|
||||
}
|
||||
if(! newTree.englishName){
|
||||
message.error('行为树英文名称不能为空.');
|
||||
return;
|
||||
}
|
||||
let res = null;
|
||||
if (currentBehaviorTree.value.id > 0) {
|
||||
res = createTree(newTree);
|
||||
@@ -389,6 +422,7 @@ export default defineComponent({
|
||||
|
||||
return {
|
||||
treesCardRef,
|
||||
handleCreateTree,
|
||||
currentTreeEditing,
|
||||
currentBehaviorTree,
|
||||
currentNodeGraph,
|
||||
|
||||
Reference in New Issue
Block a user