|
@@ -60,6 +60,7 @@ import { CUSTOM_ITERATION_START_NODE } from '@/app/components/workflow/nodes/ite
|
|
|
import { CUSTOM_LOOP_START_NODE } from '@/app/components/workflow/nodes/loop-start/constants'
|
|
|
import { useWorkflowConfig } from '@/service/use-workflow'
|
|
|
import { canFindTool } from '@/utils'
|
|
|
+import { useAppDetailContext } from '@/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main'
|
|
|
|
|
|
export const useIsChatMode = () => {
|
|
|
const appDetail = useAppStore(s => s.appDetail)
|
|
@@ -472,6 +473,7 @@ export const useFetchToolsData = () => {
|
|
|
}
|
|
|
|
|
|
export const useWorkflowInit = () => {
|
|
|
+ const { detail, isCreate, isEdit, isOperation } = useAppDetailContext()
|
|
|
const workflowStore = useWorkflowStore()
|
|
|
const {
|
|
|
nodes: nodesTemplate,
|
|
@@ -488,7 +490,7 @@ export const useWorkflowInit = () => {
|
|
|
|
|
|
const handleGetInitialWorkflowData = useCallback(async () => {
|
|
|
try {
|
|
|
- console.log(6)
|
|
|
+ // 流程初始化
|
|
|
const res = await fetchWorkflowDraft(`/apps/${appDetail.id}/workflows/draft`)
|
|
|
setData(res)
|
|
|
workflowStore.setState({
|
|
@@ -507,7 +509,6 @@ export const useWorkflowInit = () => {
|
|
|
error.json().then((err: any) => {
|
|
|
if (err.code === 'draft_workflow_not_exist') {
|
|
|
workflowStore.setState({ notInitialWorkflow: true })
|
|
|
- console.log(7)
|
|
|
syncWorkflowDraft({
|
|
|
url: `/apps/${appDetail.id}/workflows/draft`,
|
|
|
params: {
|