2828 :label =" $t('views.applicationWorkflow.nodes.mcpNode.reference')"
2929 value =" referencing"
3030 />
31- <el-option :label =" $t('common.custom')" value =" custom" />
31+ <el-option :label =" $t('common.custom')" value =" custom" />
3232 </el-select >
3333 </div >
3434 </template >
4141 @submitDialog =" submitDialog"
4242 :placeholder =" mcpServerJson"
4343 />
44- <el-select v-else v-model =" form_data.mcp_tool_id" filterable @change =" mcpToolSelectChange" >
44+ <el-select v-else v-model =" form_data.mcp_tool_id" filterable
45+ @change =" mcpToolSelectChange" >
4546 <el-option
4647 v-for =" mcpTool in mcpToolSelectOptions"
4748 :key =" mcpTool.id"
6162 <span >{{ $t('views.applicationWorkflow.nodes.mcpNode.tool') }}</span >
6263 <el-button type =" primary" link @click =" getTools()" >
6364 <el-icon class =" mr-4" >
64- <Plus />
65+ <Plus />
6566 </el-icon >
6667 {{ $t('views.applicationWorkflow.nodes.mcpNode.getTool') }}
6768 </el-button >
115116 <template #label >
116117 <div class =" flex-between" >
117118 <div >
118- <TooltipLabel :label =" item.label.label" :tooltip =" item.label.attrs.tooltip" />
119+ <TooltipLabel :label =" item.label.label" :tooltip =" item.label.attrs.tooltip" />
119120 <span v-if =" item.required" class =" color-danger" >*</span >
120121 </div >
121122 <el-select
129130 :label =" $t('views.applicationWorkflow.nodes.replyNode.replyContent.reference')"
130131 value =" referencing"
131132 />
132- <el-option :label =" $t('common.custom')" value =" custom" />
133+ <el-option :label =" $t('common.custom')" value =" custom" />
133134 </el-select >
134135 </div >
135136 </template >
184185 <template #label >
185186 <div class =" flex-between" >
186187 <div >
187- <TooltipLabel :label =" item.label.label" :tooltip =" item.label.attrs.tooltip" />
188+ <TooltipLabel :label =" item.label.label" :tooltip =" item.label.attrs.tooltip" />
188189 <span v-if =" item.required" class =" color-danger" >*</span >
189190 </div >
190191 <el-select
197198 :label =" $t('views.applicationWorkflow.nodes.replyNode.replyContent.reference')"
198199 value =" referencing"
199200 />
200- <el-option :label =" $t('common.custom')" value =" custom" />
201+ <el-option :label =" $t('common.custom')" value =" custom" />
201202 </el-select >
202203 </div >
203204 </template >
235236<script setup lang="ts">
236237import { cloneDeep , set } from ' lodash'
237238import NodeContainer from ' @/workflow/common/NodeContainer.vue'
238- import { computed , onMounted , ref , inject } from ' vue'
239+ import { computed , inject , onMounted , ref } from ' vue'
239240import { isLastNode } from ' @/workflow/common/data'
240241import { t } from ' @/locales'
241242import { MsgError , MsgSuccess } from ' @/utils/message'
@@ -244,12 +245,13 @@ import NodeCascader from '@/workflow/common/NodeCascader.vue'
244245import { useRoute } from ' vue-router'
245246import { loadSharedApi } from ' @/utils/dynamics-api/shared-api'
246247import useStore from " @/stores" ;
248+
247249const props = defineProps <{ nodeModel: any }>()
248- const { user } = useStore ()
250+ const {user} = useStore ()
249251
250252const route = useRoute ()
251253const {
252- params : { id },
254+ params : {id },
253255} = route as any
254256const getApplicationDetail = inject (' getApplicationDetail' ) as any
255257const applicationDetail = getApplicationDetail ()
@@ -300,7 +302,7 @@ function submitDialog(val: string) {
300302}
301303
302304async function mcpToolSelectChange() {
303- const tool = await loadSharedApi ({ type: ' tool' , systemType: apiType .value })
305+ const tool = await loadSharedApi ({type: ' tool' , systemType: apiType .value })
304306 .getToolById (form_data .value .mcp_tool_id , loading )
305307 form_data .value .mcp_servers = tool .data .code
306308}
@@ -320,7 +322,7 @@ function getTools() {
320322 MsgError (t (' views.applicationWorkflow.nodes.mcpNode.mcpServerTip' ))
321323 return
322324 }
323- loadSharedApi ({ type: ' application' , systemType: apiType .value })
325+ loadSharedApi ({type: ' application' , systemType: apiType .value })
324326 .getMcpTools (id , form_data .value .mcp_servers , loading )
325327 .then ((res : any ) => {
326328 form_data .value .mcp_tools = res .data
@@ -363,7 +365,7 @@ function changeTool() {
363365 label: {
364366 input_type: ' TooltipLabel' ,
365367 label: item2 ,
366- attrs: { tooltip: params [item2 ].description },
368+ attrs: {tooltip: params [item2 ].description },
367369 props_info: {},
368370 },
369371 input_type: input_type ,
@@ -399,7 +401,7 @@ function changeTool() {
399401 label: {
400402 input_type: ' TooltipLabel' ,
401403 label: item ,
402- attrs: { tooltip: args_schema .properties [item ].description },
404+ attrs: {tooltip: args_schema .properties [item ].description },
403405 props_info: {},
404406 },
405407 input_type: input_type ,
@@ -419,7 +421,7 @@ function changeTool() {
419421 }
420422 //
421423 if (form_data .value .params_nested ) {
422- form_data .value .tool_params = { [form_data .value .params_nested ]: {} }
424+ form_data .value .tool_params = {[form_data .value .params_nested ]: {}}
423425 } else {
424426 form_data .value .tool_params = {}
425427 }
@@ -513,6 +515,9 @@ onMounted(() => {
513515 set (props .nodeModel .properties .node_data , ' is_result' , true )
514516 }
515517 }
518+ if (props .nodeModel .properties .node_data .mcp_servers ) {
519+ set (props .nodeModel .properties .node_data , ' mcp_source' , ' custom' )
520+ }
516521 getMcpToolSelectOptions ()
517522 set (props .nodeModel , ' validate' , validate )
518523})
0 commit comments