ConversationBoard.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <LayoutExperience>
  3. <ContentContainer :containerStyle="content_style">
  4. <ChatAsideMenu />
  5. <ConversationBoardContainer @agentActive="handleAgentActive" />
  6. </ContentContainer>
  7. </LayoutExperience>
  8. </template>
  9. <script setup>
  10. import { useRouter } from 'vue-router';
  11. import LayoutExperience from './layout/LayoutExperience.vue';
  12. import ContentContainer from './layout/ContentContainer.vue';
  13. import ChatAsideMenu from './conversation/ChatAsideMenu.vue';
  14. import ConversationBoardContainer from './conversation/ConversationBoardContainer.vue';
  15. import bg_image from '../assets/chat/board-bg.png';
  16. import { getConfigField } from '../config/index';
  17. import useOpenWebLink from './conversation/use-open-mode-web-link';
  18. const router = useRouter();
  19. const openWebLink = useOpenWebLink();
  20. const content_style = {
  21. backgroundImage: `url(${bg_image})`,
  22. backgroundRepeat: 'no-repeat',
  23. backgroundSize: 'contain'
  24. };
  25. const handleAgentActive = ({ id, agent, index }) => {
  26. const target_id = id;
  27. // -->> advanced-chat
  28. // -->> agent-chat
  29. // -->> chat
  30. // -->> workflow
  31. // -->> web_link
  32. // -->> agent-dialog
  33. if (agent.mode === 'web_link') {
  34. // 直接跳转链接
  35. // const target_link = getConfigField('WEB_LINK_AUDIO_LINK');
  36. // const open_mode = getConfigField('WEB_LINK_OPEN_MODE');
  37. // if (open_mode === 1) {
  38. // window.open(target_link);
  39. // } else {
  40. // // 页面嵌入:和
  41. // }
  42. openWebLink();
  43. } else {
  44. router.push({
  45. path: '/chat/qa',
  46. query: {
  47. agent: target_id
  48. }
  49. });
  50. }
  51. };
  52. </script>