|
|
|
@ -24,8 +24,6 @@ const { metasWithIdAsKey } = useMetas()
|
|
|
|
|
|
|
|
|
|
const { $destroy, fitView } = useVueFlow() |
|
|
|
|
|
|
|
|
|
const isTransitioning = ref(true) |
|
|
|
|
|
|
|
|
|
const nodes = ref<Node[]>([]) |
|
|
|
|
const edges = ref<Edge[]>([]) |
|
|
|
|
|
|
|
|
@ -180,9 +178,7 @@ const layoutNodes = () => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const init = (reset = false) => { |
|
|
|
|
if (reset) { |
|
|
|
|
initDagre() |
|
|
|
|
} |
|
|
|
|
populateInitialNodes() |
|
|
|
|
populateEdges() |
|
|
|
|
layoutNodes() |
|
|
|
@ -192,22 +188,15 @@ const init = (reset = false) => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
initDagre() |
|
|
|
|
|
|
|
|
|
onBeforeMount(init) |
|
|
|
|
init() |
|
|
|
|
|
|
|
|
|
onScopeDispose($destroy) |
|
|
|
|
|
|
|
|
|
watch([() => tables, () => config], () => init(true), { deep: true, flush: 'pre' }) |
|
|
|
|
|
|
|
|
|
useEventListener('transitionend', () => { |
|
|
|
|
isTransitioning.value = false |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|
<Transition name="layout" mode="in-out"> |
|
|
|
|
<VueFlow v-if="!isTransitioning" :nodes="nodes" :edges="edges" fit-view-on-init elevate-edges-on-select> |
|
|
|
|
<VueFlow :nodes="nodes" :edges="edges" fit-view-on-init elevate-edges-on-select> |
|
|
|
|
<Controls class="!left-auto right-2 !top-3.5 !bottom-auto" :show-fit-view="false" :show-interactive="false" /> |
|
|
|
|
|
|
|
|
|
<template #node-custom="props"> |
|
|
|
@ -235,5 +224,4 @@ useEventListener('transitionend', () => {
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</VueFlow> |
|
|
|
|
</Transition> |
|
|
|
|
</template> |
|
|
|
|