2025-07-15 15:16:03 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="agent-wrap">
|
2025-07-16 18:49:28 +08:00
|
|
|
<a-input
|
2025-07-28 13:47:40 +08:00
|
|
|
style="float: right; width: 400px"
|
2025-07-24 19:07:46 +08:00
|
|
|
v-model="query.name"
|
2025-07-16 18:49:28 +08:00
|
|
|
@blur="getData()"
|
|
|
|
|
placeholder="搜索智能体"
|
|
|
|
|
size="medium"
|
|
|
|
|
allow-clear
|
|
|
|
|
>
|
|
|
|
|
<template #prefix>
|
|
|
|
|
<icon-search />
|
|
|
|
|
</template>
|
|
|
|
|
</a-input>
|
2025-07-28 13:47:40 +08:00
|
|
|
<div v-for="(item, index) in list" :key="index">
|
2025-07-15 15:16:03 +08:00
|
|
|
<span class="span-title">{{ item.name }}</span>
|
2025-07-16 18:49:28 +08:00
|
|
|
<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">
|
2025-07-17 19:32:47 +08:00
|
|
|
<div class="card-container" @click="goDetail(product?.type, product?.id)">
|
2025-07-16 18:49:28 +08:00
|
|
|
<div class="card-image-container">
|
2025-07-25 14:49:38 +08:00
|
|
|
<img
|
|
|
|
|
class="card-image"
|
|
|
|
|
:src="product?.icon_url"
|
|
|
|
|
style="width: 100%; height: 100%; object-fit: cover;"
|
|
|
|
|
/>
|
2025-07-16 18:49:28 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="card-content">
|
2025-07-17 19:32:47 +08:00
|
|
|
<div class="card-title">{{ product?.name }}</div>
|
|
|
|
|
<div class="card-description">{{ product?.description }}</div>
|
2025-07-16 18:49:28 +08:00
|
|
|
</div>
|
2025-07-25 13:48:49 +08:00
|
|
|
|
2025-07-16 18:49:28 +08:00
|
|
|
<div class="card-footer">
|
2025-07-25 13:48:49 +08:00
|
|
|
<div
|
|
|
|
|
:class="['status-tag', product.type === 1 ? 'blue-tag' : 'red-tag']"
|
2025-07-28 13:47:40 +08:00
|
|
|
:style="{ background: product.type === 1 ? 'var(--Functional-Blue-1, #F0EDFF)' : 'var(--Functional-Red-1, #FFE9E7)' }"
|
2025-07-25 13:48:49 +08:00
|
|
|
data-size="mini-20px"
|
|
|
|
|
>
|
|
|
|
|
<img
|
|
|
|
|
class="status-icon"
|
|
|
|
|
:src="product.type === 2 ? workflowIcon : chatbotIcon"
|
|
|
|
|
alt="状态图标"
|
|
|
|
|
/>
|
|
|
|
|
<div class="status-text">{{ product.type === 1 ? '对话式' : '工作流' }}</div>
|
2025-07-16 18:49:28 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="usage-info">
|
2025-07-25 13:48:49 +08:00
|
|
|
<div class="usage-count">{{ product.views }}</div>
|
|
|
|
|
<div class="usage-label">次使用</div>
|
2025-07-16 18:49:28 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-07-15 15:16:03 +08:00
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
2025-07-16 18:49:28 +08:00
|
|
|
|
|
|
|
|
<NoData v-else />
|
2025-07-15 15:16:03 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
import { getAgentList } from '@/api/all/agent';
|
2025-07-25 13:48:49 +08:00
|
|
|
import workflowIcon from '@/assets/svg/workflow.svg';
|
|
|
|
|
import chatbotIcon from '@/assets/svg/chatbot.svg';
|
2025-07-15 15:16:03 +08:00
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
const list = ref([]);
|
|
|
|
|
const getData = async () => {
|
2025-07-16 18:49:28 +08:00
|
|
|
const { code, data } = await getAgentList(query);
|
2025-07-15 15:16:03 +08:00
|
|
|
list.value = data;
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-16 18:49:28 +08:00
|
|
|
const query = reactive({
|
2025-07-24 19:07:46 +08:00
|
|
|
name: '',
|
2025-07-16 18:49:28 +08:00
|
|
|
});
|
2025-07-15 15:16:03 +08:00
|
|
|
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>
|