Skip to content

Commit b3282bf

Browse files
feat: workflow execution detail
1 parent f9887db commit b3282bf

File tree

11 files changed

+88
-37
lines changed

11 files changed

+88
-37
lines changed

ui/src/assets/tool/icon_tool_workflow.svg

Lines changed: 0 additions & 15 deletions
This file was deleted.

ui/src/components/execution-detail-card/index.vue

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,54 @@
12741274
</div>
12751275
</div>
12761276
</template>
1277+
1278+
<!-- 工作流开始 节点-->
1279+
<template v-if="data.type === WorkflowType.ToolStartNode">
1280+
<div class="card-never border-r-6">
1281+
<h5 class="p-8-12">
1282+
{{ $t('common.param.inputParam') }}
1283+
</h5>
1284+
1285+
<div class="p-8-12 border-t-dashed lighter">
1286+
<div v-for="(f, i) in data.global_fields" :key="i" class="mb-8">
1287+
<span class="color-secondary">{{ f.label }}:</span> {{ f.value }}
1288+
</div>
1289+
</div>
1290+
</div>
1291+
</template>
1292+
<!-- 工作流 节点 -->
1293+
<div class="card-never border-r-6" v-if="data.type === WorkflowType.ToolWorkflowLib">
1294+
<div class="card-never border-r-6">
1295+
<h5 class="p-8-12">
1296+
{{ $t('common.param.inputParam') }}
1297+
</h5>
1298+
<div class="p-8-12 border-t-dashed lighter pre-wrap">
1299+
<div v-for="(f, i) in data.input" :key="i" class="mb-8">
1300+
<span class="color-secondary">{{ i }}:</span> {{ f }}
1301+
</div>
1302+
</div>
1303+
</div>
1304+
<div class="card-never border-r-6 mt-8">
1305+
<h5 class="p-8-12">
1306+
{{ $t('common.param.outputParam') }}
1307+
</h5>
1308+
<div class="p-8-12 border-t-dashed lighter">
1309+
<div v-for="(f, i) in data.output" :key="i" class="mb-8">
1310+
<span class="color-secondary">{{ i }}:</span> {{ f }}
1311+
</div>
1312+
</div>
1313+
</div>
1314+
<div class="card-never border-r-6 mt-8">
1315+
<h5 class="p-8-12">
1316+
{{ $t('chat.executionDetails.title') }}
1317+
</h5>
1318+
<div class="p-8-12 border-t-dashed lighter">
1319+
<template v-for="(cLoop, cIndex) in data.details" :key="cIndex">
1320+
<ExecutionDetailCard :data="cLoop" :type="type"></ExecutionDetailCard>
1321+
</template>
1322+
</div>
1323+
</div>
1324+
</div>
12771325
<slot></slot>
12781326
</template>
12791327
<template v-else>

ui/src/views/tool/execution-record/ExecutionDetailDrawer.vue renamed to ui/src/views/tool-workflow/execution-record/ExecutionDetailDrawer.vue

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<el-col :span="6" v-if="apiType === 'systemShare'">
5555
<p class="color-secondary mb-4">{{ $t('views.workspace.title') }}</p>
5656
<p class="flex align-center">
57-
{{props.currentContent?.workspace_name}}
57+
{{ props.currentContent?.workspace_name }}
5858
</p>
5959
</el-col>
6060
<el-col :span="6">
@@ -120,15 +120,15 @@
120120
<CaretRight />
121121
</el-icon>
122122
<el-avatar
123-
v-if="detail?.tool_icon"
123+
v-if="props.currentContent?.tool_icon"
124124
shape="square"
125125
:size="24"
126126
style="background: none"
127127
>
128-
<img :src="resetUrl(detail?.tool_icon)" alt="" />
128+
<img :src="resetUrl(props.currentContent?.tool_icon)" alt="" />
129129
</el-avatar>
130-
<ToolIcon v-else :size="24" :type="detail?.tool_type" />
131-
<h4 class="ml-8">{{ detail?.tool_name }}</h4>
130+
<ToolIcon v-else :size="24" type="WORKFLOW" />
131+
<h4 class="ml-8">{{ props.currentContent?.tool_name }}</h4>
132132
</div>
133133
<div class="flex align-center">
134134
<span class="mr-16 color-secondary" v-if="detail?.state !== 'STARTED'"
@@ -147,17 +147,34 @@
147147
</div>
148148
<el-collapse-transition>
149149
<div class="mt-12" v-if="showDetail">
150-
<!-- 工具库 -->
150+
<div class="card-never border-r-6">
151+
<h5 class="p-8-12">
152+
{{ $t('common.param.inputParam') }}
153+
</h5>
154+
<div class="p-8-12 border-t-dashed lighter pre-wrap">
155+
<div v-for="(f, i) in detail?.meta?.input" :key="i" class="mb-8">
156+
<span class="color-secondary">{{ i }}:</span> {{ f }}
157+
</div>
158+
</div>
159+
</div>
151160
<div class="card-never border-r-6 mt-8">
152-
<h5 class="p-8-12">{{ $t('chat.executionDetails.input') }}</h5>
153-
<div class="p-8-12 border-t-dashed lighter break-all">
154-
{{ detail?.meta.input || '-' }}
161+
<h5 class="p-8-12">
162+
{{ $t('common.param.outputParam') }}
163+
</h5>
164+
<div class="p-8-12 border-t-dashed lighter">
165+
<div v-for="(f, i) in detail?.meta?.output" :key="i" class="mb-8">
166+
<span class="color-secondary">{{ i }}:</span> {{ f }}
167+
</div>
155168
</div>
156169
</div>
157170
<div class="card-never border-r-6 mt-8">
158-
<h5 class="p-8-12">{{ $t('chat.executionDetails.output') }}</h5>
159-
<div class="p-8-12 border-t-dashed lighter break-all">
160-
{{ detail?.meta.output || '-' }}
171+
<h5 class="p-8-12">
172+
{{ $t('chat.executionDetails.title') }}
173+
</h5>
174+
<div class="p-8-12 border-t-dashed lighter">
175+
<template v-for="(cLoop, cIndex) in detail?.meta?.details" :key="cIndex">
176+
<ExecutionDetailCard :data="cLoop"></ExecutionDetailCard>
177+
</template>
161178
</div>
162179
</div>
163180
</div>
@@ -184,6 +201,7 @@ import { useRoute } from 'vue-router'
184201
import { isAppIcon, resetUrl } from '@/utils/common'
185202
import { datetimeFormat } from '@/utils/time'
186203
import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts'
204+
import ExecutionDetailCard from '@/components/execution-detail-card/index.vue'
187205
const props = withDefaults(
188206
defineProps<{
189207
/**

ui/src/views/tool/execution-record/TriggerRecordDrawer.vue renamed to ui/src/views/tool-workflow/execution-record/ExecutionRecordDrawer.vue

File renamed without changes.

ui/src/views/tool/component/ToolListContainer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@
428428
ref="resourceTriggerDrawerRef"
429429
:source="SourceTypeEnum.TOOL"
430430
></ResourceTriggerDrawer>
431-
<ToolRecordDrawer ref="toolRecordDrawerRef" />
431+
<ExecutionRecordDrawer ref="toolRecordDrawerRef" />
432432
<WorkflowFormDialog
433433
ref="workflowFormDialogRef"
434434
:title="workflowFormDialogtitle"
@@ -456,7 +456,7 @@ import ResourceTriggerDrawer from '@/views/trigger/ResourceTriggerDrawer.vue'
456456
import ToolStoreDescDrawer from '@/views/tool/component/ToolStoreDescDrawer.vue'
457457
import ResourceMappingDrawer from '@/components/resource_mapping/index.vue'
458458
import WorkflowFormDialog from '../WorkflowFormDialog.vue'
459-
import ToolRecordDrawer from '@/views/tool/execution-record/TriggerRecordDrawer.vue'
459+
import ExecutionRecordDrawer from '@/views/tool-workflow/execution-record/ExecutionRecordDrawer.vue'
460460
import ToolStoreApi from '@/api/tool/store.ts'
461461
import { resetUrl, i18n_name } from '@/utils/common'
462462
import { MsgSuccess, MsgConfirm, MsgError } from '@/utils/message'

ui/src/workflow/icons/form-node-icon.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<el-avatar shape="square" style="background: #34c724">
2+
<el-avatar shape="square" class="avatar-green">
33
<img src="@/assets/workflow/icon_form.svg" style="width: 75%" alt="" />
44
</el-avatar>
55
</template>

ui/src/workflow/icons/question-node-icon.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<el-avatar shape="square" style="background: #34C724">
2+
<el-avatar shape="square" class="avatar-green">
33
<img src="@/assets/workflow/icon_setting.svg" style="width: 65%" alt="" />
44
</el-avatar>
55
</template>

ui/src/workflow/icons/tool-lib-node-icon.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<el-avatar v-else-if="item?.tool_type === 'DATA_SOURCE'" class="avatar-purple" shape="square">
1515
<img src="@/assets/tool/icon_datasource.svg" style="width: 58%" alt="" />
1616
</el-avatar>
17-
<el-avatar v-else shape="square" style="background: #34c724">
17+
<el-avatar v-else shape="square" class="avatar-green">
1818
<img src="@/assets/tool/icon_tool.svg" style="width: 75%" alt="" />
1919
</el-avatar>
2020
</template>

ui/src/workflow/icons/tool-node-icon.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<el-avatar shape="square" style="background: #34c724">
2+
<el-avatar shape="square" class="avatar-green">
33
<img src="@/assets/tool/icon_tool_custom.svg" style="width: 65%" alt="" />
44
</el-avatar>
55
</template>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<el-avatar shape="square" style="background: #34c724">
3-
<img src="@/assets/tool/icon_tool_workflow.svg" style="width: 65%" alt="" />
2+
<el-avatar shape="square" class="avatar-green">
3+
<img src="@/assets/workflow/logo_workflow.svg" style="width: 60%" alt="" />
44
</el-avatar>
55
</template>
66
<script setup lang="ts"></script>

0 commit comments

Comments
 (0)