修复 FlowTabs 组件中的子流程管理:将 removeFlow 方法中的 flows 替换为 subFlows,以正确处理子流程的删除逻辑,并简化 saveFlows 方法以直接展开 flow 对象。此更改提高了子流程的管理和数据处理的准确性。

This commit is contained in:
fofolee 2025-01-22 12:05:26 +08:00
parent 839ea69921
commit 11225985df

View File

@ -248,7 +248,7 @@ export default defineComponent({
this.activeTab = id;
},
removeFlow(flow) {
const index = this.flows.findIndex((f) => f.id === flow.id);
const index = this.subFlows.findIndex((f) => f.id === flow.id);
if (index > -1) {
this.subFlows.splice(index, 1);
this.activeTab = this.flows[0].id;
@ -290,8 +290,7 @@ export default defineComponent({
},
saveFlows() {
const flowsData = this.flows.map((flow) => ({
id: flow.id,
name: flow.name,
...flow,
commands: flow.commands.map((cmd) => {
const cmdCopy = { ...cmd };
//