246246 </el-form >
247247 </div >
248248 </template >
249+ <McpServerInputDialog ref =" mcpServerInputDialogRef" @refresh =" handleMcpVariables" />
249250 </NodeContainer >
250- <McpServerInputDialog ref =" mcpServerInputDialogRef" @refresh =" handleMcpVariables" />
251251</template >
252252<script setup lang="ts">
253253import { cloneDeep , set } from ' lodash'
@@ -258,7 +258,7 @@ import { t } from '@/locales'
258258import { MsgError , MsgSuccess } from ' @/utils/message'
259259import TooltipLabel from ' @/components/dynamics-form/items/label/TooltipLabel.vue'
260260import NodeCascader from ' @/workflow/common/NodeCascader.vue'
261- import McpServerInputDialog from " ./component/McpServerInputDialog.vue" ;
261+ import McpServerInputDialog from ' ./component/McpServerInputDialog.vue'
262262import { useRoute } from ' vue-router'
263263import { loadSharedApi } from ' @/utils/dynamics-api/shared-api'
264264import { resetUrl } from ' @/utils/common'
@@ -356,7 +356,7 @@ function getTools() {
356356}
357357
358358function _getTools(mcp_servers : any ) {
359- loadSharedApi ({ type: ' application' , systemType: apiType .value })
359+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
360360 .getMcpTools (id , mcp_servers , loading )
361361 .then ((res : any ) => {
362362 form_data .value .mcp_tools = res .data
@@ -371,32 +371,32 @@ function _getTools(mcp_servers: any) {
371371const mcpServerInputDialogRef = ref ()
372372// 提取 JSON 中所有占位符({{...}})的变量路径
373373function extractPlaceholders(input : unknown ): string [] {
374- const re = / \{\{ \s * ([a-zA-Z _][\w. ] * )\s * \}\} / g ; // 捕获 {{ path.like.this }}
375- const found = new Set <string >();
374+ const re = / \{\{ \s * ([a-zA-Z _][\w. ] * )\s * \}\} / g // 捕获 {{ path.like.this }}
375+ const found = new Set <string >()
376376
377377 const visit = (v : unknown ) => {
378378 if (typeof v === ' string' ) {
379- let m: RegExpExecArray | null ;
380- while ((m = re .exec (v )) !== null ) found .add (m [1 ]);
379+ let m: RegExpExecArray | null
380+ while ((m = re .exec (v )) !== null ) found .add (m [1 ])
381381 } else if (Array .isArray (v )) {
382- v .forEach (visit );
382+ v .forEach (visit )
383383 } else if (v && typeof v === ' object' ) {
384- Object .values (v as Record <string , unknown >).forEach (visit );
384+ Object .values (v as Record <string , unknown >).forEach (visit )
385385 }
386- };
386+ }
387387
388388 // 如果传入的是 JSON 字符串,尝试解析,否则按字符串/对象处理
389389 if (typeof input === ' string' ) {
390390 try {
391- visit (JSON .parse (input ));
391+ visit (JSON .parse (input ))
392392 } catch {
393- visit (input );
393+ visit (input )
394394 }
395395 } else {
396- visit (input );
396+ visit (input )
397397 }
398398
399- return [... found ];
399+ return [... found ]
400400}
401401
402402function handleMcpVariables(vars : any ) {
@@ -591,7 +591,10 @@ onMounted(() => {
591591 set (props .nodeModel .properties .node_data , ' is_result' , true )
592592 }
593593 }
594- if (props .nodeModel .properties .node_data .mcp_servers && ! props .nodeModel .properties .node_data .mcp_source ) {
594+ if (
595+ props .nodeModel .properties .node_data .mcp_servers &&
596+ ! props .nodeModel .properties .node_data .mcp_source
597+ ) {
595598 set (props .nodeModel .properties .node_data , ' mcp_source' , ' custom' )
596599 }
597600 getMcpToolSelectOptions ()
0 commit comments