refactor(agent): 重构智能体聊天页面

- 修改 HistoryChat组件中显示智能体名称而非标题
- 优化 Chat 页面初始化逻辑,添加组件卸载时的销毁操作
- 更新 Index 页面中智能体产品的展示方式
This commit is contained in:
林志军
2025-07-17 19:32:47 +08:00
parent b3af007dd2
commit af147625ae
3 changed files with 60 additions and 13 deletions

View File

@ -16,26 +16,25 @@
<span class="span-title">{{ item.name }}</span>
<a-row class="grid-demo" :gutter="24" v-if="item.agent_products.length > 0">
<a-col :span="3" v-for="(product, k) in item.agent_products">
<div class="card-container" @click="goDetail(product?.agent_system?.type, product?.id)">
<div class="card-container" @click="goDetail(product?.type, product?.id)">
<div class="card-image-container">
<img class="card-image" :src="product?.agent_system?.icon_url" />
<img class="card-image" :src="product?.icon_url" />
</div>
<div class="card-content">
<div class="card-title">{{ product?.title }}</div>
<div class="card-description">{{ product?.agent_system?.description }}</div>
<div class="card-title">{{ product?.name }}</div>
<div class="card-description">{{ product?.description }}</div>
</div>
<div class="card-footer">
<div
:class="['tag', { red: product?.agent_system?.type === 1, blue: product?.agent_system?.type === 2 }]"
:class="['tag', { red: product?.type === 1, blue: product?.type === 2 }]"
>
<div
:class="[
'tag-text',
{ red: product?.agent_system?.type === 1, blue: product?.agent_system?.type === 2 },
{ red: product?.type === 1, blue: product?.type === 2 },
]"
>
{{ product?.agent_system?.type == 1 ? '对话式' : '工作流' }}
{{ product?.type == 1 ? '对话式' : '工作流' }}
</div>
</div>
<div class="usage-info">
@ -68,6 +67,7 @@ const query = reactive({
title: '',
});
const goDetail = (type: number, id: number) => {
if (type === 1) {
router.push({
path: '/agent/chat',