From c4004648da4014c8777e4f4bd887ca28cb7afd97 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期一, 30 十二月 2024 15:02:35 +0800 Subject: [PATCH] 提示词放大编辑 --- src/components/vue-flow/ui/nodes/EndNode.vue | 82 ++++++----------------------------------- 1 files changed, 12 insertions(+), 70 deletions(-) diff --git a/src/components/vue-flow/ui/nodes/EndNode.vue b/src/components/vue-flow/ui/nodes/EndNode.vue index c3ee5cb..2c665af 100644 --- a/src/components/vue-flow/ui/nodes/EndNode.vue +++ b/src/components/vue-flow/ui/nodes/EndNode.vue @@ -1,86 +1,28 @@ <template> - <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" + <NodeBasicLayout + v-model:title="data.title" + :type="NodeType.End" + + :showOffset="false" + :description="VueFlowHelper.getConfigValue(data, 'description', '宸ヤ綔娴佽繍琛屽埌姝ょ粨鏉熴��')" > - <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%]" - style="box-shadow: 0 0 15px #dbdee6" - > - <el-tooltip effect="dark" content="澶嶅埗" placement="top"> - <div - class="flex content-center items-center border-x-0 p-1 hover:bg-gray-200 active:bg-gray-300 cursor-pointer" - @click="handleClickDuplicateBtn" - > - <span class="ywifont !text-[20px] mb-1 p-1.5 ywicon-copy"></span> - </div> - </el-tooltip> - <el-tooltip effect="dark" content="鍒犻櫎" placement="top"> - <div - @click="clickDeleteBtn" - class="flex content-center items-center border-x-0 p-1 hover:bg-gray-200 active:bg-gray-300 hover:text-red-400 cursor-pointer" - > - <span class="ywifont !text-[20px] mb-1 p-1.5 ywicon-shanchu"></span> - </div> - </el-tooltip> - </div> - <div class="flex flex-col gap-y-2"> - <div class="flex justify-between flex-0"> - <div class="flex items-center gap-x-2"> - <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-elInputFocus="false" v-else v-model="data.title" @blur="() => (titleIsEdit = false)"></el-input> - </div> - </div> - </div> - - <p>宸ヤ綔娴佽繍琛屽埌姝ょ粨鏉�</p> - </div> - </div> - - <!-- <div> - <Handle type="target" :position="Position.Left" /> - <span>缁撴潫</span> - </div> --> + <Handle :id="handleId" type="target" :position="Position.Left" /> + </NodeBasicLayout> </template> <script lang="ts" setup> import type { NodeProps } from '@vue-flow/core'; import { Handle, Position, useNode, useVueFlow } from '@vue-flow/core'; -import { computed, ref } from 'vue'; -import { VueFlowConstant } from '../../VueFlowConstant'; +import { ref } from 'vue'; import { VueFlowHelper } from '../../VueFlowHelper'; -import { LLMNodeData, LLMNodeEvents } from './index'; -import { deepClone } from '/@/utils/other'; +import { NodeType } from '../../vueFlowEnum'; +import { LLMNodeData, LLMNodeEvents } from './index'; +import NodeBasicLayout from './components/NodeBasicLayout.vue'; 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.GROUP_PARAMS_KEY]); -const { removeNodes, nodes, addNodes } = useVueFlow(); - -function handleClickDuplicateBtn() { - const { type, position, data } = node.node; - const newNode = { - id: VueFlowHelper.genGeometryId(), - type, - position: { - x: position.x + 100, - y: position.y + 100, - }, - data: deepClone(data), - }; - addNodes(newNode); -} -const clickDeleteBtn = () => { - removeNodes(node.id); -}; - -// const { clickDeleteBtn, handleClickDuplicateBtn } = useNodeOpt(node); </script> -- Gitblit v1.9.3