111
This commit is contained in:
26
src/views/canvas/components/node/InputNode.vue
Normal file
26
src/views/canvas/components/node/InputNode.vue
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
const props = defineProps<{
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({
|
||||||
|
id: '',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}>()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="node start">
|
||||||
|
<Handle type="source" style="top: 40px;" id="Right" :position="Position.Right" />
|
||||||
|
<div class="item">
|
||||||
|
<slot name="content"></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
33
src/views/canvas/components/node/secondaryNode.vue
Normal file
33
src/views/canvas/components/node/secondaryNode.vue
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
const props = defineProps<{
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({
|
||||||
|
id: '',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}>()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<!-- source输入,target输出 -->
|
||||||
|
<template>
|
||||||
|
<div class="node">
|
||||||
|
<Handle type="target" style="top: 40px;" id="Left" :position="Position.Left" />
|
||||||
|
<Handle type="source" style="top: 40px;" id="Right" :position="Position.Right" />
|
||||||
|
<!-- <Handle type="source" id="Right" :position="Position.Right" />
|
||||||
|
<Handle type="target" id="Left" :position="Position.Left" /> -->
|
||||||
|
<!-- <div>{{ props.data.id }}</div> -->
|
||||||
|
<div class="item">
|
||||||
|
<slot name="content"></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.node{
|
||||||
|
.item{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -3,7 +3,7 @@ import { ref, onMounted, onUnmounted, reactive, toRefs, watch } from 'vue'
|
|||||||
import Tree from './tree/index.vue'
|
import Tree from './tree/index.vue'
|
||||||
import Detail from './detail/index.vue'
|
import Detail from './detail/index.vue'
|
||||||
// import { versionsList } from './tools/versionsData'
|
// import { versionsList } from './tools/versionsData'
|
||||||
import { findAndAddChild, findAndRemoveChild } from './tools/tools'
|
import { findAndAddChild, findAndRemoveChild } from '../../../../../utils/treeDiagram'
|
||||||
import { useProjectStore } from '@/stores'
|
import { useProjectStore } from '@/stores'
|
||||||
import { versionTree, getChatNodeDetail } from '@/api/versitonTree'
|
import { versionTree, getChatNodeDetail } from '@/api/versitonTree'
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { VueFlow, useVueFlow } from '@vue-flow/core'
|
|||||||
import SpecialEdge from './speciaiEdge.vue'
|
import SpecialEdge from './speciaiEdge.vue'
|
||||||
import InputNode from './InputNode.vue'//主
|
import InputNode from './InputNode.vue'//主
|
||||||
import SecondaryNode from './secondaryNode.vue'//分支
|
import SecondaryNode from './secondaryNode.vue'//分支
|
||||||
import { useLayout } from '../../tools/tools'
|
import { useLayout } from '@/utils/treeDiagram'
|
||||||
import dialogVue from "../../components/dialog.vue";
|
import dialogVue from "../../components/dialog.vue";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
selectItem: {
|
selectItem: {
|
||||||
|
|||||||
Reference in New Issue
Block a user