File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
components/dynamics-form/items/tree
views/knowledge-workflow/component/action Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -168,8 +168,13 @@ function renderTemplate(template: string, data: any) {
168168}
169169
170170const loadNode = (node : Node , resolve : (nodeData : Tree []) => void ) => {
171+ const get_extra = inject (' get_extra' ) as any
171172 request_call (request , {
172- url: renderTemplate (attrs .url , props .otherParams ),
173+ url: renderTemplate (
174+ ' /workspace/${current_workspace_id}/knowledge/${current_knowledge_id}/datasource/tool/${current_tool_id}/' +
175+ attrs .fetch_list_function ,
176+ { ... props .otherParams , ... (get_extra ? get_extra () : {}) },
177+ ),
173178 body: { current_node: node .level == 0 ? undefined : node .data },
174179 then : (res : any ) => {
175180 resolve (res .data )
Original file line number Diff line number Diff line change 4343 </DynamicsForm >
4444</template >
4545<script setup lang="ts">
46- import { computed , ref , watch } from ' vue'
46+ import { computed , ref , watch , provide } from ' vue'
4747import { WorkflowKind , WorkflowType } from ' @/enums/application'
4848import DynamicsForm from ' @/components/dynamics-form/index.vue'
4949import type { FormField } from ' @/components/dynamics-form/type'
@@ -100,9 +100,18 @@ const form_data = computed({
100100const source_node_list = computed (() => {
101101 return props .workflow ?.nodes ?.filter ((n : any ) => n .properties .kind === WorkflowKind .DataSource )
102102})
103+ const extra = ref <any >({
104+ current_tool_id: undefined ,
105+ })
106+ const get_extra = () => {
107+ return extra .value
108+ }
109+ provide (' get_extra' , get_extra )
110+
103111const sourceChange = (node_id : string ) => {
104112 base_form_data .value .node_id = node_id
105113 const n = source_node_list .value .find ((n : any ) => n .id == node_id )
114+ extra .value .current_tool_id = n .properties .node_data .tool_lib_id
106115 node_id = n
107116 ? [WorkflowType .DataSourceLocalNode , WorkflowType .DataSourceWebNode ].includes (n .type )
108117 ? n .type
You can’t perform that action at this time.
0 commit comments