wujingjing
2024-12-12 6ee230ce0a8d338609ab96cebdeafc1e62f6e918
src/views/project/yw/systemManage/flowApp/FlowApp.vue
@@ -1,11 +1,11 @@
<template>
   <div class="absolute bottom-0 left-0 right-0 top-0">
   <div class="absolute bottom-0 left-0 right-0 top-0 bg-gray text-base">
      <div class="relative flex h-full w-full flex-col">
         <Header v-if="flowAgent" :flowAgent="flowAgent" :queryId="queryId" />
         <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;