feat(agent): 新增智能体应用功能
- 添加智能体列表页面和相关API - 实现聊天功能,包括历史对话和当前对话 - 新增工作流功能,包括表单提交和结果展示- 优化路由配置,增加智能体相关路由 - 添加全局常量和枚举,用于智能体类型区分
This commit is contained in:
@ -1,33 +1,53 @@
|
||||
<template>
|
||||
<div class="agent-wrap">
|
||||
<a-input
|
||||
style="float: right; width: 300px"
|
||||
v-model="query.title"
|
||||
@blur="getData()"
|
||||
placeholder="搜索智能体"
|
||||
size="medium"
|
||||
allow-clear
|
||||
>
|
||||
<template #prefix>
|
||||
<icon-search />
|
||||
</template>
|
||||
</a-input>
|
||||
<div v-for="(item, index) in list" :key="index">
|
||||
<span class="span-title">{{ item.name }}</span>
|
||||
<a-row class="grid-demo" :gutter="24">
|
||||
<a-col :span="6" v-if="item.agent_products.length > 0" v-for="(product, k) in item.agent_products">
|
||||
<a-card @click="goDetail(product?.agent_system?.type, product?.id)">
|
||||
<template #actions>
|
||||
<span class="icon-hover"> {{ product?.views }}次调用 </span>
|
||||
</template>
|
||||
<template #cover>
|
||||
<div>
|
||||
<img
|
||||
:style="{ width: '100%', transform: 'translateY(-20px)' }"
|
||||
alt="dessert"
|
||||
:src="product?.agent_system?.icon_url"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<a-card-meta :title="product?.agent_system?.title" :description="product?.agent_system?.description">
|
||||
<template #avatar>
|
||||
<div :style="{ display: 'flex', alignItems: 'center', color: '#1D2129' }">
|
||||
<a-typography-text>{{ product?.agent_system?.type == 1 ? '对话式' : '工作流' }}</a-typography-text>
|
||||
<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-image-container">
|
||||
<img class="card-image" :src="product?.agent_system?.icon_url" />
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="card-title">{{ product?.title }}</div>
|
||||
<div class="card-description">{{ product?.agent_system?.description }}</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div
|
||||
:class="['tag', { red: product?.agent_system?.type === 1, blue: product?.agent_system?.type === 2 }]"
|
||||
>
|
||||
<div
|
||||
:class="[
|
||||
'tag-text',
|
||||
{ red: product?.agent_system?.type === 1, blue: product?.agent_system?.type === 2 },
|
||||
]"
|
||||
>
|
||||
{{ product?.agent_system?.type == 1 ? '对话式' : '工作流' }}
|
||||
</div>
|
||||
</template>
|
||||
</a-card-meta>
|
||||
</a-card>
|
||||
</div>
|
||||
<div class="usage-info">
|
||||
<span class="usage-count">{{ product?.views }}</span>
|
||||
<span class="usage-label">次使用</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-col>
|
||||
<NoData v-else />
|
||||
</a-row>
|
||||
|
||||
<NoData v-else />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -40,10 +60,13 @@ const router = useRouter();
|
||||
|
||||
const list = ref([]);
|
||||
const getData = async () => {
|
||||
const { code, data } = await getAgentList();
|
||||
const { code, data } = await getAgentList(query);
|
||||
list.value = data;
|
||||
};
|
||||
|
||||
const query = reactive({
|
||||
title: '',
|
||||
});
|
||||
const goDetail = (type: number, id: number) => {
|
||||
if (type === 1) {
|
||||
router.push({
|
||||
|
||||
Reference in New Issue
Block a user