feat: 对话逻辑调整、历史对话接口联调
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
<script lang="tsx">
|
||||
import { useRoute } from 'vue-router';
|
||||
import { ref, computed } from 'vue';
|
||||
import { getAgentInfo } from '@/api/all/chat';
|
||||
import { useChatStore } from '@/stores/modules/chat';
|
||||
|
||||
import HistoryConversationDrawer from './components/history-conversation-drawer/index.vue';
|
||||
import ConversationDetail from './components/conversation-detail/index.vue';
|
||||
@ -9,13 +11,24 @@ import ConversationCreate from './components/created/index.vue';
|
||||
export default {
|
||||
setup(props, { emit, expose }) {
|
||||
const route = useRoute();
|
||||
|
||||
const chatStore = useChatStore();
|
||||
const historyConversationDrawerRef = ref(null);
|
||||
|
||||
const conversationId = computed(() => {
|
||||
return route.params.conversationId;
|
||||
});
|
||||
|
||||
const getAgentData = async () => {
|
||||
const { code, data } = await getAgentInfo();
|
||||
if (code === 200) {
|
||||
chatStore.setAgentInfo(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getAgentData();
|
||||
});
|
||||
|
||||
return () => (
|
||||
<div class="chat-wrap rounded-12px w-full h-full">
|
||||
{conversationId.value ? <ConversationDetail /> : <ConversationCreate />}
|
||||
|
||||
Reference in New Issue
Block a user