245245 </el-form >
246246 </div >
247247 </template >
248+ <McpServerInputDialog ref =" mcpServerInputDialogRef" @refresh =" handleMcpVariables" />
248249 </NodeContainer >
249- <McpServerInputDialog ref =" mcpServerInputDialogRef" @refresh =" handleMcpVariables" />
250250</template >
251251<script setup lang="ts">
252252import { cloneDeep , set } from ' lodash'
@@ -257,7 +257,7 @@ import { t } from '@/locales'
257257import { MsgError , MsgSuccess } from ' @/utils/message'
258258import TooltipLabel from ' @/components/dynamics-form/items/label/TooltipLabel.vue'
259259import NodeCascader from ' @/workflow/common/NodeCascader.vue'
260- import McpServerInputDialog from " ./component/McpServerInputDialog.vue" ;
260+ import McpServerInputDialog from ' ./component/McpServerInputDialog.vue'
261261import { useRoute } from ' vue-router'
262262import { loadSharedApi } from ' @/utils/dynamics-api/shared-api'
263263import { resetUrl } from ' @/utils/common'
@@ -355,7 +355,7 @@ function getTools() {
355355}
356356
357357function _getTools(mcp_servers : any ) {
358- loadSharedApi ({ type: ' application' , systemType: apiType .value })
358+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
359359 .getMcpTools (id , mcp_servers , loading )
360360 .then ((res : any ) => {
361361 form_data .value .mcp_tools = res .data
@@ -370,32 +370,32 @@ function _getTools(mcp_servers: any) {
370370const mcpServerInputDialogRef = ref ()
371371// 提取 JSON 中所有占位符({{...}})的变量路径
372372function extractPlaceholders(input : unknown ): string [] {
373- const re = / \{\{ \s * ([a-zA-Z _][\w. ] * )\s * \}\} / g ; // 捕获 {{ path.like.this }}
374- const found = new Set <string >();
373+ const re = / \{\{ \s * ([a-zA-Z _][\w. ] * )\s * \}\} / g // 捕获 {{ path.like.this }}
374+ const found = new Set <string >()
375375
376376 const visit = (v : unknown ) => {
377377 if (typeof v === ' string' ) {
378- let m: RegExpExecArray | null ;
379- while ((m = re .exec (v )) !== null ) found .add (m [1 ]);
378+ let m: RegExpExecArray | null
379+ while ((m = re .exec (v )) !== null ) found .add (m [1 ])
380380 } else if (Array .isArray (v )) {
381- v .forEach (visit );
381+ v .forEach (visit )
382382 } else if (v && typeof v === ' object' ) {
383- Object .values (v as Record <string , unknown >).forEach (visit );
383+ Object .values (v as Record <string , unknown >).forEach (visit )
384384 }
385- };
385+ }
386386
387387 // 如果传入的是 JSON 字符串,尝试解析,否则按字符串/对象处理
388388 if (typeof input === ' string' ) {
389389 try {
390- visit (JSON .parse (input ));
390+ visit (JSON .parse (input ))
391391 } catch {
392- visit (input );
392+ visit (input )
393393 }
394394 } else {
395- visit (input );
395+ visit (input )
396396 }
397397
398- return [... found ];
398+ return [... found ]
399399}
400400
401401function handleMcpVariables(vars : any ) {
@@ -590,7 +590,10 @@ onMounted(() => {
590590 set (props .nodeModel .properties .node_data , ' is_result' , true )
591591 }
592592 }
593- if (props .nodeModel .properties .node_data .mcp_servers && ! props .nodeModel .properties .node_data .mcp_source ) {
593+ if (
594+ props .nodeModel .properties .node_data .mcp_servers &&
595+ ! props .nodeModel .properties .node_data .mcp_source
596+ ) {
594597 set (props .nodeModel .properties .node_data , ' mcp_source' , ' custom' )
595598 }
596599 getMcpToolSelectOptions ()
0 commit comments