From f9cba7fdc9d60bbb2eee6d4eeff3556daea3e2ef Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期四, 12 十二月 2024 16:35:25 +0800 Subject: [PATCH] feat(flow): 优化流程编辑功能 --- src/views/project/yw/systemManage/flowApp/FlowApp.vue | 20 +++++++++----------- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/views/project/yw/systemManage/flowApp/FlowApp.vue b/src/views/project/yw/systemManage/flowApp/FlowApp.vue index 346f810..4ff428f 100644 --- a/src/views/project/yw/systemManage/flowApp/FlowApp.vue +++ b/src/views/project/yw/systemManage/flowApp/FlowApp.vue @@ -5,7 +5,7 @@ <main class="relative flex h-full w-full flex-1"> <Sidebar @dragstart="handleOnDragStart" /> <div class="relative h-full flex-1 overflow-hidden" v-if="flowJson"> - <MainCanvas :flowJson="flowJson" :agentNames="agentNames"/> + <MainCanvas :flowJson="flowJson" :agentNames="agentNames" /> </div> </main> </div> @@ -47,23 +47,21 @@ const res = await get_workflow_json_flow({ agent_id: id, }); - flowJson.value = res.json_ok ? res.json_flow : {}; + flowJson.value = res.json_ok ? res.json_flow ?? {} : {}; }; - -const getFlowAgent =async()=>{ +const getFlowAgent = async () => { const res = await get_workflow_agent_list(); - const flowAgentList = res.values??[] - const currentFlowAgent = flowAgentList.find((item:any)=>item.id===queryId.value) + const flowAgentList = res.values ?? []; + const currentFlowAgent = flowAgentList.find((item: any) => item.id === queryId.value); flowAgent.value = currentFlowAgent; -} +}; const agentNames = ref([]); -const getAgentNames = async () =>{ +const getAgentNames = async () => { const res = await get_agent_names(); - agentNames.value = res.agents??[] - -} + agentNames.value = res.agents ?? []; +}; onMounted(() => { if (!queryId.value) return; -- Gitblit v1.9.3