Skip to content

Commit ca9c66b

Browse files
committed
feat: Task detail popover
1 parent a031531 commit ca9c66b

1 file changed

Lines changed: 55 additions & 10 deletions

File tree

ui/src/views/trigger/index.vue

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,64 @@
143143
<el-popover>
144144
<template #reference>
145145
<div class="flex">
146-
<el-check-tag type="info" class="mr-8"
147-
>智能体
146+
<el-check-tag type="info" class="mr-8">
147+
智能体
148148
{{
149149
row.trigger_task.filter((item: any) => item.type === 'APPLICATION').length
150-
}}</el-check-tag
151-
>
152-
<el-check-tag type="info"
153-
>工具
154-
{{
155-
row.trigger_task.filter((item: any) => item.type === 'TOOL').length
156-
}}</el-check-tag
157-
>
150+
}}
151+
</el-check-tag>
152+
<el-check-tag type="info">
153+
工具
154+
{{ row.trigger_task.filter((item: any) => item.type === 'TOOL').length }}
155+
</el-check-tag>
158156
</div>
159157
</template>
158+
159+
<div>
160+
<!-- 智能体部分 -->
161+
<div class="color-secondary mb-8">
162+
智能体
163+
{{
164+
row.trigger_task.filter((item: any) => item.type === 'APPLICATION').length
165+
}}
166+
</div>
167+
<div
168+
v-for="item in row.trigger_task.filter(
169+
(item: any) => item.type === 'APPLICATION',
170+
)"
171+
:key="item.id"
172+
class="flex align-center mb-8"
173+
>
174+
<el-avatar shape="square" :size="20" style="background: none" class="mr-8">
175+
<img :src="resetUrl(item?.icon, resetUrl('./favicon.ico'))" alt="" />
176+
</el-avatar>
177+
<span>{{ item.name }}</span>
178+
</div>
179+
180+
<el-divider class="mt-8 mb-8" />
181+
182+
<!-- 工具部分 -->
183+
<div class="color-secondary mb-8">
184+
工具 {{ row.trigger_task.filter((item: any) => item.type === 'TOOL').length }}
185+
</div>
186+
<div
187+
v-for="item in row.trigger_task.filter((item: any) => item.type === 'TOOL')"
188+
:key="item.id"
189+
class="flex align-center mb-8"
190+
>
191+
<el-avatar
192+
v-if="item?.icon"
193+
shape="square"
194+
:size="20"
195+
style="background: none"
196+
class="mr-8"
197+
>
198+
<img :src="resetUrl(item?.icon)" alt="" />
199+
</el-avatar>
200+
<ToolIcon v-else :size="20" :type="item?.tool_type" class="mr-8" />
201+
<span>{{ item.name }}</span>
202+
</div>
203+
</div>
160204
</el-popover>
161205
</template>
162206
</el-table-column>
@@ -206,6 +250,7 @@ import { t } from '@/locales'
206250
import permissionMap from '@/permission'
207251
import { datetimeFormat } from '@/utils/time'
208252
import WorkspaceApi from '@/api/workspace/workspace'
253+
import { resetUrl } from '@/utils/common'
209254
210255
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
211256
import type { TriggerData } from '@/api/type/trigger'

0 commit comments

Comments
 (0)