Skip to content

Commit 2d98fdf

Browse files
author
piexlMax(奇淼
committed
feat: tool卡片页面优化
1 parent 214e108 commit 2d98fdf

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

web/src/view/systemTools/autoCode/mcpTest.vue

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616

1717
<el-row :gutter="8">
18-
<el-col v-for="tool in mcpTools" :key="tool.name" :xs="24" :sm="12" :md="8" :lg="6">
19-
<el-card class="mb-5 h-[150px] flex flex-col overflow-hidden">
18+
<el-col v-for="tool in mcpTools" :key="tool.name" :xs="24" :sm="12" :md="12" :lg="8">
19+
<el-card class="mb-5 min-h-[150px] flex flex-col overflow-hidden">
2020
<template #header>
2121
<div class="flex justify-between items-center font-bold">
2222
<span>{{ tool.name }}</span>
@@ -25,7 +25,30 @@
2525
</el-tooltip>
2626
</div>
2727
</template>
28-
<div class="text-sm">{{ tool.description }}</div>
28+
<div class="text-sm mb-1">{{ tool.description }}</div>
29+
<div v-if="tool.inputSchema && tool.inputSchema.properties && Object.keys(tool.inputSchema.properties).length > 0" class="mt-1 text-xs overflow-y-auto max-h-[100px] p-2 border-t border-gray-200 bg-gray-50 rounded-b">
30+
<p class="font-semibold mb-1 text-gray-700 flex items-center">
31+
<span class="mr-1 my-2">参数列表</span>
32+
<span class="text-xs text-gray-500">({{ Object.keys(tool.inputSchema.properties).length }})</span>
33+
</p>
34+
<div class="space-y-2">
35+
<div v-for="(propDetails, propName) in tool.inputSchema.properties" :key="propName" class="flex flex-col p-1.5 bg-white rounded border border-gray-100 hover:border-gray-300 transition-colors">
36+
<div class="flex items-center justify-between">
37+
<div class="flex items-center">
38+
<span class="font-medium text-gray-800">{{ propName }}</span>
39+
<span v-if="tool.inputSchema.required && tool.inputSchema.required.includes(propName)" class="ml-1 text-red-500 text-xs">*</span>
40+
</div>
41+
<span class="text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded">{{ propDetails.type }}</span>
42+
</div>
43+
<div class="text-gray-500 mt-0.5 text-xs line-clamp-2" :title="propDetails.description || '无描述'">
44+
{{ propDetails.description || '无描述' }}
45+
</div>
46+
</div>
47+
</div>
48+
</div>
49+
<div v-else class="mt-1 text-xs p-2 border-t border-gray-200 bg-gray-50 rounded-b flex items-center justify-center">
50+
<span class="text-gray-500 italic py-3">无输入参数</span>
51+
</div>
2952
</el-card>
3053
</el-col>
3154
</el-row>

0 commit comments

Comments
 (0)