| | |
| | | ></el-option> |
| | | </el-select> |
| | | |
| | | <el-select v-model="subItem.right_value_type" class="flex-0 w-[90px]" placeholder="请选择"> |
| | | <!-- <el-select v-model="subItem.right_value_type" class="flex-0 w-[90px]" placeholder="请选择"> |
| | | <el-option v-for="item in Object.keys(varTypeMap)" :key="item" :value="item" :label="varTypeMap[item]"></el-option> |
| | | </el-select> |
| | | </el-select> --> |
| | | <template v-if="isShowRight(subItem)"> |
| | | <el-input |
| | | v-if="subItem.right_value_type === VarType.Input" |
| | | v-model="subItem.right_value" |
| | | class="w-[180px]" |
| | | placeholder="输入值" |
| | | > |
| | | </el-input> |
| | | |
| | | <el-input |
| | | v-if="subItem.right_value_type === VarType.Input" |
| | | v-model="subItem.right_value" |
| | | class="w-[120px]" |
| | | placeholder="输入值" |
| | | > |
| | | </el-input> |
| | | |
| | | <el-tree-select |
| | | v-else |
| | | filterable |
| | | class="w-[120px] flex-0" |
| | | v-model="subItem.right_value" |
| | | :data="treeReferOptions" |
| | | node-key="id" |
| | | :clearable="true" |
| | | :accordion="false" |
| | | :expandNode="false" |
| | | :check-strictly="false" |
| | | placeholder="选择变量" |
| | | > |
| | | </el-tree-select> |
| | | <el-tree-select |
| | | v-else |
| | | filterable |
| | | class="w-[120px] flex-0" |
| | | v-model="subItem.right_value" |
| | | :data="treeReferOptions" |
| | | node-key="id" |
| | | :clearable="true" |
| | | :accordion="false" |
| | | :expandNode="false" |
| | | :check-strictly="false" |
| | | placeholder="选择变量" |
| | | > |
| | | </el-tree-select> |
| | | </template> |
| | | |
| | | <span |
| | | class="ywifont ywicon-shanchu text-red-400 invisible group-hover/conditionItem:visible cursor-pointer" |
| | |
| | | <el-button v-else @click="addConditionBranch" class="w-fit mt-3" type="success">添加分支</el-button> |
| | | <Handle class="!right-0 !-translate-y-4" :id="item.id" type="source" :position="Position.Right" /> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | <!-- <Handle :id="handleId" type="source" :position="Position.Right" /> --> |
| | | </div> |
| | | |
| | | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | |
| | | import { computed } from 'vue'; |
| | | import { VueFlowConstant } from '../../VueFlowConstant'; |
| | | import { ConditionHelper, VueFlowHelper } from '../../VueFlowHelper'; |
| | | import { VarType, compareOperationMap, conditionOperatorMap, varTypeMap } from '../../vueFlowEnum'; |
| | | import { CompareOperation, VarType, compareOperationMap, conditionOperatorMap, varTypeMap } from '../../vueFlowEnum'; |
| | | import { LLMNodeData, LLMNodeEvents } from './index'; |
| | | import { deepClone } from '/@/utils/other'; |
| | | defineProps<NodeProps<LLMNodeData, LLMNodeEvents>>(); |
| | |
| | | const { findNode } = useVueFlow(); |
| | | const referenceOptions = ref([]); |
| | | const otherHandleId = VueFlowHelper.genId(); |
| | | |
| | | const isShowRight = (item) => { |
| | | const yes = ![CompareOperation.empty, CompareOperation.notEmpty].includes(item.comparison_operation); |
| | | return yes; |
| | | }; |
| | | |
| | | const treeReferOptions = computed(() => { |
| | | const result = []; |
| | | for (const item of referenceOptions.value) { |
| | |
| | | }); |
| | | |
| | | const data = ref(node.node.data); |
| | | |
| | | const conditionGroupList = ref(VueFlowHelper.getFieldValue(data.value, 'condition')); |
| | | const titleIsEdit = ref(false); |
| | | |
| | |
| | | const addConditionBranch = () => { |
| | | const conditionGroup = ConditionHelper.getDefaultConditionGroup(); |
| | | // 不能删除其他分支 |
| | | conditionGroupList.value.splice(-1,0,conditionGroup) |
| | | conditionGroupList.value.splice(-1, 0, conditionGroup); |
| | | }; |
| | | |
| | | const delConditionBranch = (index) => { |