From 2f199307915f92144f76dc7086c977dd56101909 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Mon, 7 Sep 2026 15:46:41 +0800 Subject: [PATCH] fix: The dynamic form model list in the workflow cannot obtain data --- ui/src/utils/resource-context.ts | 4 + .../application/ApplicationWorkflowView.vue | 5 +- ui/src/workflow-canvas/index.vue | 6 +- .../workflow-canvas/nodes/base-node/index.vue | 7 +- .../workflow-canvas/nodes/form-node/index.vue | 11 ++- .../store/api/system-resource/index.ts | 2 + .../api/{shared => system-shared}/index.ts | 0 .../workflow-canvas/store/api/system/index.ts | 2 - .../store/api/workspace/index.ts | 2 +- ui/src/workflow-canvas/store/index.ts | 76 +++++++++++-------- 10 files changed, 68 insertions(+), 47 deletions(-) create mode 100644 ui/src/workflow-canvas/store/api/system-resource/index.ts rename ui/src/workflow-canvas/store/api/{shared => system-shared}/index.ts (100%) delete mode 100644 ui/src/workflow-canvas/store/api/system/index.ts diff --git a/ui/src/utils/resource-context.ts b/ui/src/utils/resource-context.ts index 481cb1a46ba..e04bd1e0b5b 100644 --- a/ui/src/utils/resource-context.ts +++ b/ui/src/utils/resource-context.ts @@ -25,3 +25,7 @@ export const isSystemResource = () => { export const isSystemSharedResource = () => { return router.currentRoute.value.meta.resourceScope === 'system-shared' } + +export const getResourceScope = () => { + return router.currentRoute.value.meta.resourceScope +} diff --git a/ui/src/views/workflow/application/ApplicationWorkflowView.vue b/ui/src/views/workflow/application/ApplicationWorkflowView.vue index 253a1a85942..8dff1d1e5a5 100644 --- a/ui/src/views/workflow/application/ApplicationWorkflowView.vue +++ b/ui/src/views/workflow/application/ApplicationWorkflowView.vue @@ -15,11 +15,10 @@ import { WorkflowMode } from '@/workflow-canvas/types' import DefaultModelSettingButton from '../components/default-model-setting/DefaultModelSettingButton.vue' import WorkflowViewLayout from '../components/WorkflowViewLayout.vue' import Conversation from '@/components/conversation/index.vue' +import { getResourceScope } from '@/utils/resource-context.ts' defineOptions({ name: 'ApplicationWorkflowView' }) - -// 为画布节点中的 ModelSelect 提供参数表单接口。 -provide('getModelParamsForm', ModelApi.getModelParamsForm) +provide('resourceScope', getResourceScope()) const DEFAULT_WORKFLOW: LogicFlow.GraphConfigData = { nodes: cloneDeep(defaultApplicationNodes), diff --git a/ui/src/workflow-canvas/index.vue b/ui/src/workflow-canvas/index.vue index bc28f34501f..e863f937a1e 100644 --- a/ui/src/workflow-canvas/index.vue +++ b/ui/src/workflow-canvas/index.vue @@ -1,5 +1,5 @@