CMVR-IOT-UI/src/views/flow/components/params/useQuote.js
lixiaolong b3dae8db39 feat(flow): 添加子流程功能并优化参数引用逻辑
- 新增子流程节点类型,支持在同一项目中执行已发布工作流
- 添加子流程节点UI组件和相关配置选项
- 重构参数引用逻辑,使用getUpstreamInput替代getInput方法
- 优化cascader组件属性设置,统一使用props配置checkStrictly
- 修正多个参数组件中的handleTypeChange和cascaderChange函数参数传递
- 添加流程输出参数管理功能,支持引用来源选择和类型识别
- 实现子流程运行时状态管理和迭代输出处理
- 增加循环引用检测和资源验证功能
- 更新API接口,添加子流程选项获取方法
- 修复流程引用和依赖关系处理逻辑
2026-08-21 11:48:10 +08:00

44 lines
1014 B
JavaScript

import { ref } from 'vue'
import { getUpstreamInput } from '@/utils/flow'
export function useQuote(nodeId) {
const quoteOptions = ref([])
const cascaderRefs = ref([])
const refreshQuoteOptions = () => {
quoteOptions.value = getUpstreamInput(nodeId) || []
}
// The option tree must exist before Cascader can render a persisted path.
refreshQuoteOptions()
const handleTypeChange = (property) => {
if (!property) return
if (property.type === 'input') {
property.quote = []
} else {
property.input = ''
refreshQuoteOptions()
}
}
const cascaderChange = (value, property) => {
if (!property) return
property.quote = Array.isArray(value) ? [...value] : []
property.quoteType = value?.[1] === 'input' ? 'input' : 'output'
}
const visibleChange = (visible) => {
if (visible) refreshQuoteOptions()
}
return {
quoteOptions,
cascaderRefs,
handleTypeChange,
cascaderChange,
visibleChange,
refreshQuoteOptions,
}
}