2025-07-14 11:30:13 +08:00
|
|
|
<template>
|
2025-07-25 13:48:49 +08:00
|
|
|
<div class="agent-card">
|
|
|
|
|
<div class="header-section">
|
|
|
|
|
<div class="image-container">
|
2025-07-28 13:47:40 +08:00
|
|
|
<img :src="cozeInfo.icon_url" alt="" />
|
2025-07-25 13:48:49 +08:00
|
|
|
</div>
|
2025-07-14 11:30:13 +08:00
|
|
|
</div>
|
2025-07-25 13:48:49 +08:00
|
|
|
<div class="info-section">
|
|
|
|
|
<div class="title-group">
|
|
|
|
|
<div class="title">{{cozeInfo.name}}</div>
|
|
|
|
|
<div class="tag">
|
2025-07-28 14:45:32 +08:00
|
|
|
<div>
|
2025-07-25 13:48:49 +08:00
|
|
|
<img
|
|
|
|
|
class="status-icon"
|
|
|
|
|
:src="chatbotIcon"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text">对话式</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="usage-info">
|
|
|
|
|
<div class="count">{{cozeInfo.views}}</div>
|
|
|
|
|
<div class="label">次使用</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="description-section">
|
|
|
|
|
<div class="description">
|
|
|
|
|
{{cozeInfo.description}}
|
2025-07-16 18:49:28 +08:00
|
|
|
</div>
|
2025-07-25 13:48:49 +08:00
|
|
|
</div>
|
2025-07-25 14:49:38 +08:00
|
|
|
|
2025-07-16 18:49:28 +08:00
|
|
|
</div>
|
2025-07-14 11:30:13 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2025-07-15 15:16:03 +08:00
|
|
|
import { defineProps } from 'vue';
|
2025-07-16 18:49:28 +08:00
|
|
|
import { delAgentMessage, getHistoryChat } from '@/api/all/agent';
|
2025-07-25 13:48:49 +08:00
|
|
|
import chatbotIcon from '@/assets/svg/chatbot.svg';
|
2025-07-14 11:30:13 +08:00
|
|
|
|
2025-07-15 15:16:03 +08:00
|
|
|
const props = defineProps({
|
|
|
|
|
cozeInfo: {
|
|
|
|
|
type: Object as () => any,
|
|
|
|
|
default: () => ({}),
|
2025-07-25 13:48:49 +08:00
|
|
|
},
|
2025-07-15 15:16:03 +08:00
|
|
|
});
|
2025-07-16 18:49:28 +08:00
|
|
|
|
|
|
|
|
const delMessage = async (chatId, conversationId) => {
|
|
|
|
|
const { code, data } = await delAgentMessage({ chat_id: chatId, conversation_id: conversationId });
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
console.log(data, 'data');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const conversations = ref([]);
|
|
|
|
|
|
|
|
|
|
const getHistoryChatData = async (botId) => {
|
|
|
|
|
const { code, data } = await getHistoryChat({ bot_id: botId });
|
|
|
|
|
if (code === 200) {
|
|
|
|
|
conversations.value = data.list;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
const truncateText = (text: string, maxLength = 30) => {
|
|
|
|
|
if (text.length <= maxLength) return text;
|
|
|
|
|
return text.slice(0, maxLength) + '...';
|
2025-07-15 15:16:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
2025-07-14 11:30:13 +08:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2025-07-25 13:48:49 +08:00
|
|
|
@import './history.scss';
|
2025-07-14 11:30:13 +08:00
|
|
|
</style>
|