2025-07-15 15:16:03 +08:00
|
|
|
<template>
|
2025-07-31 10:54:04 +08:00
|
|
|
<div class="agent-wrap relative h-full">
|
2025-07-16 18:49:28 +08:00
|
|
|
<a-input
|
2025-07-24 19:07:46 +08:00
|
|
|
v-model="query.name"
|
2025-07-31 18:54:59 +08:00
|
|
|
@press-enter="getData()"
|
2025-07-16 18:49:28 +08:00
|
|
|
placeholder="搜索智能体"
|
2025-07-30 12:00:14 +08:00
|
|
|
size="large"
|
2025-07-16 18:49:28 +08:00
|
|
|
allow-clear
|
2025-08-04 11:42:24 +08:00
|
|
|
class="absolute right-0 top--10px !w-400px"
|
2025-07-16 18:49:28 +08:00
|
|
|
>
|
|
|
|
|
<template #prefix>
|
2025-07-31 18:54:59 +08:00
|
|
|
<icon-search @click="getData()" />
|
2025-07-16 18:49:28 +08:00
|
|
|
</template>
|
|
|
|
|
</a-input>
|
2025-08-01 11:24:31 +08:00
|
|
|
<div v-for="(item, index) in list" :key="index">
|
2025-08-04 11:42:24 +08:00
|
|
|
<p class="span-title w-fit mb-16px">{{ item.name }}</p>
|
|
|
|
|
<a-row class="grid-demo" :gutter="[20, 16]" v-if="item.agent_products.length > 0">
|
2025-07-28 14:45:32 +08:00
|
|
|
<a-col :xs="24"
|
|
|
|
|
:sm="12"
|
|
|
|
|
:md="8"
|
2025-07-28 16:08:02 +08:00
|
|
|
:lg="5"
|
|
|
|
|
:xl="6"
|
2025-07-28 16:29:44 +08:00
|
|
|
:xxl="4"
|
2025-08-04 11:42:24 +08:00
|
|
|
v-for="(product, k) in item.agent_products" :key="k">
|
|
|
|
|
<div class="card-container cursor-pointer !h-252px" @click="goDetail(product?.type, product?.id)">
|
2025-08-01 17:35:28 +08:00
|
|
|
<div class="card-image h-120px w-100% bg-cover bg-center bg-#E6E6E8 mb-8px" v-image-main-color="product.image_url">
|
|
|
|
|
<img class="object-contain h-full w-100% " :src="product?.image_url"/>
|
2025-07-31 10:54:04 +08:00
|
|
|
</div>
|
2025-07-31 18:54:59 +08:00
|
|
|
|
2025-08-01 17:35:28 +08:00
|
|
|
<div class="card-content w-full">
|
2025-08-04 11:42:24 +08:00
|
|
|
<TextoverTips :context="product.name" class="card-title mb-4px !text-16px"/>
|
2025-07-30 17:44:27 +08:00
|
|
|
<TextoverTips :context="product.description" class="card-description mb-8px color-#737478 text-14px lh-22px font-400" :line="2" />
|
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"
|
|
|
|
|
>
|
2025-07-30 12:00:14 +08:00
|
|
|
<SvgIcon
|
|
|
|
|
size="12"
|
|
|
|
|
:class="product.type === 2 ? 'color-#F64B31' : 'color-#6D4CFE'"
|
|
|
|
|
class="mr-4px"
|
|
|
|
|
:name="product.type === 2 ? 'svg-workflow' : 'svg-chatbot'"
|
2025-07-25 13:48:49 +08:00
|
|
|
alt="状态图标"
|
|
|
|
|
/>
|
|
|
|
|
<div class="status-text">{{ product.type === 1 ? '对话式' : '工作流' }}</div>
|
2025-07-16 18:49:28 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="usage-info">
|
2025-07-30 12:00:14 +08:00
|
|
|
<div class="usage-count mr-2px">{{ formatNumberShow({ value: product?.views, showExactValue: true }) }}</div>
|
2025-07-25 13:48:49 +08:00
|
|
|
<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-30 17:44:27 +08:00
|
|
|
import { formatNumberShow } from "@/utils/tools";
|
|
|
|
|
import TextoverTips from "@/components/text-over-tips";
|
2025-07-30 12:00:14 +08:00
|
|
|
|
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>
|