UPDATE: VERSION-20260331

This commit is contained in:
libertyspy
2026-03-31 14:32:54 +08:00
parent 705021b391
commit a0d8f555f9
6 changed files with 110 additions and 11 deletions

View File

@@ -43,6 +43,7 @@
<Properties
v-if="graph"
:platforms="platforms"
:nodeCommands="nodeCommands"
:element="selectedNodeTaskElement"
:graph="graph as any"
:node="selectedModelNode as any"
@@ -72,7 +73,7 @@ import { createGraphTaskElementFromTemplate } from './utils';
import { createGraphTaskElement, createLineOptions, type GraphContainer, type GraphTaskElement, hasElements, hasRootElementNode, resolveGraph, useGraphCanvas } from '../graph';
import { registerNodeElement } from './register';
import { findAllBasicPlatforms } from '../api';
import { findAllBasicPlatforms, findAllNodeCommands } from '../api';
import type { Platform } from '../types';
import { createTree, findOneTreeById, findOneTreeByPlatformId, updateTree } from './api';
import TressCard from './trees-card.vue';
@@ -111,6 +112,7 @@ export default defineComponent({
const changed = ref<boolean>(false);
const treesCardRef = ref<InstanceType<typeof TressCard> | null>(null);
const platforms = ref<Platform[]>([]);
const nodeCommands = ref<NodeCommand[]>([])
const currentScenarioId = ref<number | null>(null);
const {
@@ -138,6 +140,18 @@ export default defineComponent({
});
};
const loadNodeCommands = ()=> {
nodeCommands.value = []
findAllNodeCommands().then(r=> {
nodeCommands.value = r.data ?? []
})
}
const loadDatasource = ()=> {
loadPlatforms();
loadNodeCommands();
}
// 处理拖动开始
const handleDragStart = (nm: NodeDragTemplate) => {
draggedNodeData.value = nm;
@@ -449,13 +463,14 @@ export default defineComponent({
// 初始化
onMounted(() => {
init();
loadPlatforms();
loadDatasource();
});
// 清理
onBeforeUnmount(() => destroy());
return {
nodeCommands,
currentScenarioId,
platforms,
treesCardRef,