wujingjing
2024-12-13 d2da078b40578cf72901442c7a2b878dfc34cae5
src/views/project/yw/systemManage/flowApp/FlowApp.vue
@@ -1,11 +1,11 @@
<template>
   <div class="absolute bottom-0 left-0 right-0 top-0 bg-gray text-base">
   <div class="absolute bottom-0 left-0 right-0 top-0 bg-page 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" />
            <Sidebar class="w-52" @dragstart="handleOnDragStart" />
            <div class="relative h-full flex-1 overflow-hidden" v-if="flowJson">
               <MainCanvas :flowJson="flowJson" :agentNames="agentNames" />
               <MainCanvas :flowJson="flowJson" :agentNames="agentNames" :funcNames="funcNames"/>
            </div>
         </main>
      </div>
@@ -20,7 +20,7 @@
import { computed, onMounted, ref } from 'vue';
import Header from './components/Header.vue';
import Sidebar from './components/Sidebar.vue';
import { get_agent_names, get_workflow_agent_list, get_workflow_json_flow } from '/@/api/workflow';
import { get_agent_names, get_flow_func_names, get_workflow_agent_list, get_workflow_json_flow } from '/@/api/workflow';
import MainCanvas from '/@/components/vue-flow/MainCanvas.vue';
import router from '/@/router';
@@ -62,11 +62,17 @@
   const res = await get_agent_names();
   agentNames.value = res.agents ?? [];
};
const funcNames = ref([]);
const getFuncNames = async () => {
   const res = await get_flow_func_names();
   funcNames.value = res.funcs ?? [];
};
onMounted(() => {
   if (!queryId.value) return;
   handleGetJSON(queryId.value);
   getFlowAgent();
   getAgentNames();
   getFuncNames();
});
</script>