feat(agent): 新增智能体应用功能

- 添加智能体列表页面和相关API
- 实现聊天功能,包括历史对话和当前对话
- 新增工作流功能,包括表单提交和结果展示- 优化路由配置,增加智能体相关路由
- 添加全局常量和枚举,用于智能体类型区分
This commit is contained in:
林志军
2025-07-15 15:16:03 +08:00
parent c4b074b775
commit 616665d219
20 changed files with 869 additions and 28 deletions

View File

@ -0,0 +1,68 @@
<template>
<div class="agent-wrap">
<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>
</div>
</template>
</a-card-meta>
</a-card>
</a-col>
<NoData v-else />
</a-row>
</div>
</div>
</template>
<script setup lang="ts">
import { useRouter } from 'vue-router';
import { getAgentList } from '@/api/all/agent';
const router = useRouter();
const list = ref([]);
const getData = async () => {
const { code, data } = await getAgentList();
list.value = data;
};
const goDetail = (type: number, id: number) => {
if (type === 1) {
router.push({
path: '/agent/chat',
query: { id: id },
});
} else if (type === 2) {
router.push({
path: '/agent/workFlow',
query: { id: id },
});
}
};
onMounted(() => {
getData();
});
</script>
<style scoped lang="scss">
@import './style.scss';
</style>