wujingjing
2024-12-13 667c08a39b523e7afdf00a6af17ac2d4274b659a
src/components/vue-flow/ui/nodes/EndNode.vue
@@ -2,7 +2,7 @@
   <div
      class="w-max-[520px] border-2 rounded-lg border-solid border-gray-100 bg-white p-3 shadow-md relative hover:border-blue-500 group"
   >
      <Handle type="source" :position="Position.Left" />
      <Handle :id="handleId" type="target" :position="Position.Left" />
      <div
         class="group-hover:visible invisible flex absolute divide-y-[1.5px] divide-solid divide-gray-100 rounded-lg right-0 -top-0.5 translate-y-[-100%]"
@@ -31,7 +31,7 @@
               <img src="/@/components/vue-flow/ui/assets/images/icon_End.png" class="h-4 w-4" alt="Start icon" />
               <div class="flex flex-col gap-y-1">
                  <p v-if="!titleIsEdit" class="text-xl font-bold text-gray-500" @click="titleIsEdit = true">{{ data.title }}</p>
                  <el-input v-else v-model="data.title" @blur="() => (titleIsEdit = false)"></el-input>
                  <el-input v-elInputFocus="false" v-else v-model="data.title" @blur="() => (titleIsEdit = false)"></el-input>
               </div>
            </div>
         </div>
@@ -41,7 +41,7 @@
   </div>
   <!-- <div>
      <Handle type="source" :position="Position.Left" />
      <Handle type="target" :position="Position.Left" />
      <span>结束</span>
   </div> -->
</template>
@@ -51,22 +51,24 @@
import { Handle, Position, useNode, useVueFlow } from '@vue-flow/core';
import { computed, ref } from 'vue';
import { VueFlowConstant } from '../../VueFlowConstant';
import { VueFlowHelper } from '../../VueFlowHelper';
import { LLMNodeData, LLMNodeEvents } from './index';
import { deepClone } from '/@/utils/other';
defineProps<NodeProps<LLMNodeData, LLMNodeEvents>>();
const node = useNode();
const handleId = ref(VueFlowHelper.getHandleId(node.node, 'target'));
const data = ref(node.node.data);
const titleIsEdit = ref(false);
const parameterTable = computed(() => data.value[VueFlowConstant.PARAMS_KEY]);
const parameterTable = computed(() => data.value[VueFlowConstant.GROUP_PARAMS_KEY]);
const { removeNodes, nodes, addNodes } = useVueFlow();
function handleClickDuplicateBtn() {
   const { type, position, data } = node.node;
   const newNode = {
      id: (nodes.value.length + 1).toString(),
      id: VueFlowHelper.genGeometryId(),
      type,
      position: {
         x: position.x + 100,