| | |
| | | <div class="flex flex-col gap-y-2 min-w-[400px]"> |
| | | <div class="flex justify-between flex-0"> |
| | | <div class="flex items-center gap-x-2"> |
| | | <img src="/@/components/vue-flow/ui/assets/images/icon_Start.png" class="h-4 w-4" alt="Start icon" /> |
| | | <YWIcon |
| | | :name="VueFlowConfig.nodeStyleMap.get(NodeType.Condition).icon" |
| | | :fontSize="VueFlowConfig.nodeStyleMap.get(NodeType.Condition).fontSize" |
| | | :color="VueFlowConfig.nodeStyleMap.get(NodeType.Condition).color" |
| | | class="rounded-lg p-1.5" |
| | | :class="VueFlowConfig.nodeStyleMap.get(NodeType.Condition).class" |
| | | /> |
| | | <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 class="flex flex-col gap-y-2" v-if="item.conditions"> |
| | | <div v-for="(subItem, subIndex) in item.conditions" class="ml-5 flex-items-center gap-x-2 group/conditionItem pr-8"> |
| | | <el-input filterable class="w-[120px] flex-0" v-model="subItem.left_value" placeholder="输入变量"> </el-input> |
| | | <el-select v-model="subItem.comparison_operation" class="flex-0 w-[120px]" placeholder="选择条件"> |
| | | <el-select filterable v-model="subItem.comparison_operation" class="flex-0 w-[120px]" placeholder="选择条件"> |
| | | <el-option |
| | | v-for="item in Object.keys(compareOperationMap)" |
| | | :key="item" |
| | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { Handle, Position, useNode, useVueFlow } from '@vue-flow/core'; |
| | | import { ref, watchEffect } from 'vue'; |
| | | |
| | | import type { NodeProps } from '@vue-flow/core'; |
| | | import { computed } from 'vue'; |
| | | import { Handle, Position, useNode, useVueFlow } from '@vue-flow/core'; |
| | | import { computed, ref, watchEffect } from 'vue'; |
| | | import { VueFlowConstant } from '../../VueFlowConstant'; |
| | | import { ConditionHelper, VueFlowHelper } from '../../VueFlowHelper'; |
| | | import { CompareOperation, VarType, compareOperationMap, conditionOperatorMap, varTypeMap } from '../../vueFlowEnum'; |
| | | import { CompareOperation, VarType, compareOperationMap, conditionOperatorMap } from '../../vueFlowEnum'; |
| | | import { LLMNodeData, LLMNodeEvents } from './index'; |
| | | import { deepClone } from '/@/utils/other'; |
| | | import { VueFlowConfig } from '../VueFlowConfig'; |
| | | import { NodeType } from '../../vueFlowEnum'; |
| | | |
| | | defineProps<NodeProps<LLMNodeData, LLMNodeEvents>>(); |
| | | |
| | | const node = useNode(); |
| | |
| | | const otherHandleId = VueFlowHelper.genId(); |
| | | |
| | | const isShowRight = (item) => { |
| | | const yes = ![CompareOperation.empty, CompareOperation.notEmpty].includes(item.comparison_operation); |
| | | const yes = ![CompareOperation.empty, CompareOperation.notEmpty].includes(item.comparison_operation); |
| | | return yes; |
| | | }; |
| | | |