From 8623ce7fbd6b07fdf8b76c7109f9c819f41e5fc2 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 29 Oct 2026 11:39:10 +0800 Subject: [PATCH] fix: chat tool --- .../items/group-tool/components/ToolItem.vue | 12 +++---- .../content/items/group-tool/index.vue | 27 ++++++++------- .../components/content/items/tool/tool.vue | 33 ++++++++++--------- .../upload-image/ImageProcessingForm.vue | 2 +- .../components/DocumentStrategyForm.vue | 2 +- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/ui/src/conversation-panel/components/content/items/group-tool/components/ToolItem.vue b/ui/src/conversation-panel/components/content/items/group-tool/components/ToolItem.vue index 6cc3b32d762..171b67619f7 100644 --- a/ui/src/conversation-panel/components/content/items/group-tool/components/ToolItem.vue +++ b/ui/src/conversation-panel/components/content/items/group-tool/components/ToolItem.vue @@ -22,11 +22,11 @@ const statusText = computed(() => { return STATUS_TEXT[status] ?? status }) -const statusClass = computed(() => { +const statusType = computed(() => { const status = props.toolItem.status - if (status === 'SUCCESS') return 'text-success' - if (status === 'FAIL' || status === 'FAILURE') return 'text-danger' - return 'text-N600' + if (status === 'SUCCESS') return 'success' + if (status === 'FAIL' || status === 'FAILURE') return 'danger' + return 'info' }) // 参数为 JSON 字符串,尝试格式化展示,失败则原样展示 @@ -65,10 +65,10 @@ const formattedResult = computed(() => tryFormatJson(props.toolItem.content)) {{ toolTitle }} - {{ statusText }} + {{ statusText }} -
+
输入参数
diff --git a/ui/src/conversation-panel/components/content/items/group-tool/index.vue b/ui/src/conversation-panel/components/content/items/group-tool/index.vue index 0d596fada92..ea121a6eed0 100644 --- a/ui/src/conversation-panel/components/content/items/group-tool/index.vue +++ b/ui/src/conversation-panel/components/content/items/group-tool/index.vue @@ -61,9 +61,6 @@ const groupStatus = computed(() => { return childStatuses.length ? 'success' : '' }) -// const STATUS_TEXT: Dict = { running: '执行中', success: '成功', error: '失败' } -// const statusText = computed(() => STATUS_TEXT[groupStatus.value] ?? '') - const manualExpanded = ref() const isExpanded = computed({ get: () => manualExpanded.value ?? groupStatus.value === 'running', @@ -92,19 +89,21 @@ const isExpanded = computed({ 调用了 {{ toolItems.length }} 个工具 -
+
diff --git a/ui/src/conversation-panel/components/content/items/tool/tool.vue b/ui/src/conversation-panel/components/content/items/tool/tool.vue index 2a285be3412..1b5b84f1480 100644 --- a/ui/src/conversation-panel/components/content/items/tool/tool.vue +++ b/ui/src/conversation-panel/components/content/items/tool/tool.vue @@ -12,23 +12,23 @@ const loading = computed(() => props.content.status === 'RUNNING') const toolTitle = computed(() => props.content.name || 'Tool') // 状态文案与配色 -// const statusText = computed(() => { -// const map: Dict = { -// RUNNING: '执行中', -// SUCCESS: '成功', -// FAIL: '失败', -// FAILURE: '失败', -// } -// const status = props.content.status ?? '' -// return map[status] ?? status -// }) +const statusText = computed(() => { + const map: Dict = { + RUNNING: '执行中', + SUCCESS: '成功', + FAIL: '失败', + FAILURE: '失败', + } + const status = props.content.status ?? '' + return map[status] ?? status +}) -// const statusClass = computed(() => { -// const status = props.content.status -// if (status === 'SUCCESS') return 'text-success' -// if (status === 'FAIL' || status === 'FAILURE') return 'text-danger' -// return 'text-N600' -// }) +const statusType = computed(() => { + const status = props.content.status + if (status === 'SUCCESS') return 'success' + if (status === 'FAIL' || status === 'FAILURE') return 'danger' + return 'info' +}) // 参数为 JSON 字符串,尝试格式化展示,失败则原样展示 function tryFormatJson(value: unknown): string { @@ -68,6 +68,7 @@ const formattedResult = computed(() => tryFormatJson(props.content.content)) {{ toolTitle }} + {{ statusText }}
diff --git a/ui/src/views/knowledge-detail/library/image/upload-image/ImageProcessingForm.vue b/ui/src/views/knowledge-detail/library/image/upload-image/ImageProcessingForm.vue index 511983fc5ec..9ec6fc9a3cd 100644 --- a/ui/src/views/knowledge-detail/library/image/upload-image/ImageProcessingForm.vue +++ b/ui/src/views/knowledge-detail/library/image/upload-image/ImageProcessingForm.vue @@ -142,7 +142,7 @@ defineExpose({ validate, getStrategy }) :rules="{ required: true, message: '请选择增强工具', trigger: 'change' }" class="mb-0! mt-4" > - +