UPDATE: VERSION-20260331
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import {useRouter} from 'vue-router';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { getTeleport } from '@antv/x6-vue-shape';
|
||||
import { Graph, Node, type NodeProperties } from '@antv/x6';
|
||||
@@ -64,7 +64,7 @@ import { createGraphScenarioElement, createGraphTaskElementFromScenario } from '
|
||||
|
||||
import PlatformCard from './platform-card.vue';
|
||||
import NodesCard from './nodes-card.vue';
|
||||
import { saveScenario } from './api';
|
||||
import { findOneScenarioById, saveScenario } from './api';
|
||||
import { resolveConnectionRelation } from './relation';
|
||||
|
||||
const TeleportContainer = defineComponent(getTeleport());
|
||||
@@ -84,7 +84,7 @@ export default defineComponent({
|
||||
TeleportContainer,
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
const currentRoute = useRoute();
|
||||
const canvas = ref<HTMLDivElement | null>(null);
|
||||
const graph = ref<Graph | null>(null);
|
||||
const currentZoom = ref<number>(1);
|
||||
@@ -97,6 +97,7 @@ export default defineComponent({
|
||||
const selectedNodeTaskElement = ref<GraphTaskElement | null>(null);
|
||||
const changed = ref<boolean>(false);
|
||||
const scenariosCardRef = ref<InstanceType<typeof PlatformCard> | null>(null);
|
||||
const currentScenarioId = ref<number | null>(null);
|
||||
|
||||
const {
|
||||
handleGraphEvent,
|
||||
@@ -313,11 +314,7 @@ export default defineComponent({
|
||||
const node = args.node as Node<NodeProperties>;
|
||||
const element = node.getData() as GraphTaskElement;
|
||||
console.error('element',element)
|
||||
if(element && element.platformId ){
|
||||
window.location.href = `/app/decision/designer?platform=${element.platformId}`
|
||||
} else {
|
||||
window.location.href = '/app/decision/designer'
|
||||
}
|
||||
window.location.href = `/app/decision/designer?scenario=${currentScenario.value?.id}&platform=${element?.platformId?? ''}`
|
||||
|
||||
// destroy()
|
||||
// window.location.href = '/app/decision/designer'
|
||||
@@ -358,6 +355,15 @@ export default defineComponent({
|
||||
initGraph();
|
||||
window.addEventListener('resize', handleResize);
|
||||
console.log('节点挂载完成');
|
||||
|
||||
let scenarioId = Number(currentRoute.query.scenario);
|
||||
if (!isNaN(scenarioId)) {
|
||||
findOneScenarioById(scenarioId).then(r=> {
|
||||
if(r.data){
|
||||
handleSelect(r.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user