UPDATE: VERSION-20260331
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user