wujingjing
2024-12-12 91c536145f64a34c3d87ac0724973e1c0bfb4400
src/components/vue-flow/ui/nodes/AgentNode.vue
@@ -30,7 +30,7 @@
               <img src="/@/components/vue-flow/ui/assets/images/icon_Start.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 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,8 +41,9 @@
            <div class="min-w-[340px] flex-items-center gap-x-2">
               <div class="flex-column gap-y-1.5">
                  <!-- <span class="text-gray-500">模型</span> -->
                  <el-input v-model="agentParams.value" placeholder="请输入代理"> </el-input>
                  <el-select filterable placeholder="请选择代理"  v-model="agentParams.value" @change="agentParamsValueChange">
                     <el-option v-for="item in agentNames"  :key="item.id" :value="item.id" :label="item.title"></el-option>
                  </el-select>
               </div>
            </div>
         </div>
@@ -66,8 +67,13 @@
import { LLMNodeData, LLMNodeEvents } from './index';
import { deepClone } from '/@/utils/other';
defineProps<NodeProps<LLMNodeData, LLMNodeEvents>>();
// defineProps<NodeProps<LLMNodeData, LLMNodeEvents>>();
const props = defineProps(['agentNames'])
const agentParamsValueChange = () => {
   // const foundNames = props.agentNames.find(item=>item.id == agentParams.value);
   // agentParams.value.value_label =  foundNames?.title ??'';
};
const node = useNode();
const sourceHandleId = ref(VueFlowHelper.getHandleId(node.node, 'source'));
const targetHandleId = ref(VueFlowHelper.getHandleId(node.node, 'target'));