重构Composer组件中的变量管理:改为FlowManager,支持函数名和标识的修改,新增函数时自动弹出管理界面

This commit is contained in:
fofolee
2025-01-22 18:28:07 +08:00
parent 957c6021b8
commit b33ef1be7f
7 changed files with 131 additions and 86 deletions

View File

@@ -92,8 +92,8 @@ export default defineComponent({
},
},
setup() {
const getCurrentVariables = inject("getCurrentVariables");
return { getCurrentVariables };
const getCurrentExistingVar = inject("getCurrentExistingVar");
return { getCurrentExistingVar };
},
emits: ["update:modelValue", "add-command", "action"],
data() {
@@ -296,7 +296,7 @@ export default defineComponent({
if (newCommand.saveOutput && newCommand.outputVariable) {
newCommand.outputVariable = processVariable({
value: newCommand.outputVariable,
existingVars: this.getCurrentVariables().map((v) => v.name),
existingVars: this.getCurrentExistingVar().map((v) => v.name),
}).processedValue;
}
return newCommand;