@@ -3,9 +3,10 @@ import { computed, ref } from 'vue'
33import type WorkflowApi from ' @/api/admin/workspace/tool/workflow'
44import { TOOL_RECORD_SOURCE , KNOWLEDGE_TYPE , STATE_TYPES } from ' @/api/enums'
55import type { Dict , ToolExecutionRecord } from ' @/api/types'
6- import { datetimeFormat } from ' @/utils/time'
76import ExecutionDetailDrawer from ' ./ExecutionDetailDrawer.vue'
87import { STATE_LABELS } from ' @/constants/state'
8+ import { datetimeFormat } from ' @/utils/time'
9+ import { isSystemSharedResource } from ' @/utils/resource-context'
910
1011const props = defineProps <{ api: typeof WorkflowApi ; toolId: string }>()
1112const emit = defineEmits <{ closed: [] }>()
@@ -36,9 +37,9 @@ const searchFields = [
3637 label: ' 资源类型' ,
3738 value: ' source_type' ,
3839 options: [
39- { label: ' 智能体 ' , value: TOOL_RECORD_SOURCE .APPLICATION },
40- { label: ' 知识库 ' , value: TOOL_RECORD_SOURCE .KNOWLEDGE },
41- { label: ' 触发器 ' , value: TOOL_RECORD_SOURCE .TRIGGER },
40+ { label: sourceLabels [ TOOL_RECORD_SOURCE . APPLICATION ] , value: TOOL_RECORD_SOURCE .APPLICATION },
41+ { label: sourceLabels [ TOOL_RECORD_SOURCE . KNOWLEDGE ] , value: TOOL_RECORD_SOURCE .KNOWLEDGE },
42+ { label: sourceLabels [ TOOL_RECORD_SOURCE . TRIGGER ] , value: TOOL_RECORD_SOURCE .TRIGGER },
4243 ],
4344 },
4445]
@@ -124,28 +125,32 @@ defineExpose({ open })
124125 @size-change =" loadRecords ()"
125126 >
126127 <el-table-column label =" 触发来源" min-width =" 130" show-overflow-tooltip >
127- <template #default =" { row } "
128- > <div class =" flex-align-center gap-2" >
128+ <template #default =" { row } " >
129+ <div class =" flex-align-center gap-2" >
129130 <ApplicationIcon v-if =" row .source_type === TOOL_RECORD_SOURCE .APPLICATION " :icon =" row .source_icon " :size =" 20 " />
130131 <KnowledgeIcon v-else-if =" row .source_type === TOOL_RECORD_SOURCE .KNOWLEDGE " :type =" KNOWLEDGE_TYPE .WORKFLOW " :size =" 20 " />
131132 <TriggerIcon v-else-if =" row .source_type === TOOL_RECORD_SOURCE .TRIGGER " :type =" row .trigger_type ?? undefined " :size =" 20 " />
132133 <span class =" min-w-0 flex-1 truncate" :title =" row.source_name || '-'" >{{ row.source_name || '-' }}</span >
133134 </div >
134135 </template >
135136 </el-table-column >
136- <!-- // TODO 共享资源需要显示工作空间 -->
137- <el-table-column label =" 类型" width =" 90"
138- ><template #default =" { row } " >{{ sourceLabels[row.source_type as keyof typeof sourceLabels] || '-' }}</template ></el-table-column
139- >
140- <el-table-column label =" 状态" width =" 100"
141- ><template #default =" { row } " ><MkStatusLabel :status =" row .state " /></template
142- ></el-table-column >
143- <el-table-column label =" 耗时" width =" 90"
144- ><template #default =" { row } " >{{ row.run_time == null ? '-' : `${row.run_time.toFixed(2)} s` }}</template ></el-table-column
145- >
146- <el-table-column label =" 执行时间" prop =" create_time" width =" 180"
147- ><template #default =" { row } " >{{ datetimeFormat(row.create_time) }}</template ></el-table-column
148- >
137+ <el-table-column v-if =" isSystemSharedResource()" prop =" workspace_name" label =" 工作空间" show-overflow-tooltip >
138+ <template #default =" { row } " >
139+ {{ row.workspace_name }}
140+ </template >
141+ </el-table-column >
142+ <el-table-column label =" 类型" width =" 90" >
143+ <template #default =" { row } " >{{ sourceLabels[row.source_type as keyof typeof sourceLabels] || '-' }}</template >
144+ </el-table-column >
145+ <el-table-column label =" 状态" width =" 100" >
146+ <template #default =" { row } " ><MkStatusLabel :status =" row .state " /></template >
147+ </el-table-column >
148+ <el-table-column label =" 耗时" width =" 90" >
149+ <template #default =" { row } " >{{ row.run_time == null ? '-' : `${row.run_time.toFixed(2)} s` }}</template >
150+ </el-table-column >
151+ <el-table-column label =" 执行时间" prop =" create_time" width =" 180" >
152+ <template #default =" { row } " >{{ datetimeFormat(row.create_time) }}</template >
153+ </el-table-column >
149154 <el-table-column label =" 操作" width =" 70" >
150155 <template #default =" { row } " >
151156 <!-- 查看执行详情 -->
0 commit comments