From 22e71a24d3bba67068f8fe739a4b0cfceb6a1d94 Mon Sep 17 00:00:00 2001 From: libertyspy Date: Sun, 15 Mar 2026 16:15:23 +0800 Subject: [PATCH] UPDATE: VERSION-20260315 --- .../decision/communication/communication.vue | 30 +++++++++---------- .../src/views/decision/communication/graph.ts | 8 +++++ 2 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 modeler/src/views/decision/communication/graph.ts diff --git a/modeler/src/views/decision/communication/communication.vue b/modeler/src/views/decision/communication/communication.vue index ea142f1..eacb8a2 100644 --- a/modeler/src/views/decision/communication/communication.vue +++ b/modeler/src/views/decision/communication/communication.vue @@ -7,8 +7,8 @@
(null); const graph = ref(null); const currentZoom = ref(1); - const draggedNodeData = ref(null); + const draggedNodeData = ref(null); const isDraggingOver = ref(false); const currentTreeEditing = ref(false); - const currentScenario = ref(null); + const currentScenario = ref(null); const currentNodeGraph = ref(null); const selectedModelNode = ref | null>(null); const selectedNodeTaskElement = ref(null); @@ -105,7 +105,7 @@ export default defineComponent({ } = useGraphCanvas(); // 处理拖动开始 - const handleDragStart = (nm: NodeDragTemplate) => { + const handleDragStart = (nm: Scenario) => { draggedNodeData.value = nm; }; @@ -156,14 +156,14 @@ export default defineComponent({ try { // 获取拖动的数据 - const template = draggedNodeData.value as NodeDragTemplate; + const template = draggedNodeData.value as Scenario; - if (!hasElements(graph.value as Graph) && template.type !== 'root') { + if (!hasElements(graph.value as Graph)) { message.error('请先添加根节点.'); return; } - if (hasRootElementNode(graph.value as Graph) && template.type === 'root') { + if (hasRootElementNode(graph.value as Graph)) { message.error('根节点已经存在.'); return; } @@ -193,8 +193,8 @@ export default defineComponent({ } }; - const handleSelectTree = (tree: currentScenario) => { - console.info('handleSelectTree', tree); + const handleSelect = (tree: Scenario) => { + console.info('handleSelect', tree); findOneTreeById(tree.id).then(r => { if (r.data) { let nodeGraph: NodeGraph | null = null; @@ -254,7 +254,7 @@ export default defineComponent({ }); }; - const handleCreateTree = () => { + const handleCreate = () => { currentScenario.value = { id: 0, name: '行为树', @@ -404,7 +404,7 @@ export default defineComponent({ return { treesCardRef, - handleCreateTree, + handleCreate, currentTreeEditing, currentScenario, currentNodeGraph, @@ -424,7 +424,7 @@ export default defineComponent({ isDraggingOver, handleSave, handleUpdateElement, - handleSelectTree, + handleSelect, }; }, }); diff --git a/modeler/src/views/decision/communication/graph.ts b/modeler/src/views/decision/communication/graph.ts new file mode 100644 index 0000000..a47cc82 --- /dev/null +++ b/modeler/src/views/decision/communication/graph.ts @@ -0,0 +1,8 @@ +/* + * This file is part of the kernelstudio package. + * + * (c) 2014-2026 zlin + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */