AgentList.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <template>
  2. <div class="intell-list">
  3. <div class="intell-item" v-for="item in display_agent_list" :key="item.title" @click="changeAgent(item.id)">
  4. <img class="item-icon" :src="item.icon" alt="" />
  5. <div class="content">
  6. <div class="title">{{ item.title }}</div>
  7. <div class="des">{{ item.des_1 }}</div>
  8. <div class="des">{{ item.des_2 }}</div>
  9. </div>
  10. </div>
  11. </div>
  12. </template>
  13. <script setup>
  14. import { computed, onMounted, ref } from 'vue';
  15. import { useRouter } from 'vue-router';
  16. import { Message } from '@arco-design/web-vue';
  17. import icon_1 from '../../assets/agent/agent_icon_1.svg';
  18. import icon_2 from '../../assets/agent/agent_icon_2.svg';
  19. import icon_3 from '../../assets/agent/agent_icon_3.svg';
  20. import icon_4 from '../../assets/agent/agent_icon_4.svg';
  21. // import { updateAgentUsedList } from '../chat-user/useAgentUsed';
  22. // import { getAgentIcons, updateAgentIcons } from '../conversation-dialog/api-dialog'
  23. // import { getUserName } from '../../utils/get-user-name'
  24. const router = useRouter();
  25. const props = defineProps({
  26. auth: Object
  27. });
  28. const emit = defineEmits(['toConversation']);
  29. const agent_list = ref([
  30. {
  31. idx: '01',
  32. id: 'znwd',
  33. title: '智库问答',
  34. des_1: '知识库驱动',
  35. des_2: '精准解答专业问题',
  36. icon: icon_1,
  37. is_show: props.auth.znwd
  38. },
  39. {
  40. idx: '02',
  41. id: 'bgsc',
  42. title: '报告自动生成',
  43. des_1: '一键生成报告',
  44. des_2: '智能编辑与优化',
  45. icon: icon_2,
  46. is_show: props.auth.bgsc
  47. },
  48. {
  49. idx: '03',
  50. id: 'znws',
  51. title: '智能问数',
  52. des_1: '自然语言交互',
  53. des_2: '快速挖掘数据价值',
  54. icon: icon_3,
  55. is_show: props.auth.znws
  56. },
  57. {
  58. idx: '04',
  59. id: 'bgcl',
  60. title: '智能报表',
  61. des_1: '表格合并及处理',
  62. des_2: '精准识别异常数据',
  63. icon: icon_4,
  64. is_show: props.auth.bgcl
  65. }
  66. ]);
  67. const display_agent_list = computed(() => {
  68. return agent_list.value.filter((item) => item.is_show);
  69. });
  70. const changeAgent = (id) => {
  71. // || id== 'bgsc'
  72. // if (id == 'znws' || id == 'bgsc') {
  73. // Message.warning('开发中,敬请期待')
  74. // return
  75. // }
  76. const agent_list = window.AGENT;
  77. if (agent_list[id]) {
  78. router.push({
  79. path: '/conversation',
  80. query: {
  81. id: id
  82. }
  83. });
  84. emit('toConversation');
  85. // updateAgentUsedList(id);
  86. } else {
  87. Message.warning('开发中,敬请期待');
  88. return;
  89. }
  90. };
  91. onMounted(() => {
  92. // getAgentIconsFun()
  93. console.log(props.auth);
  94. });
  95. </script>
  96. <style scoped lang="css">
  97. .intell-list {
  98. display: grid;
  99. grid-template-columns: repeat(3, 1fr);
  100. align-content: flex-start;
  101. gap: 20px 20px;
  102. /* padding: 0 20px;
  103. padding-top: 10px; */
  104. overflow-y: auto;
  105. }
  106. .intell-item {
  107. box-sizing: border-box;
  108. /* min-width: 250px; */
  109. padding: 35px;
  110. background-color: #fff;
  111. display: flex;
  112. flex-direction: column;
  113. align-items: center;
  114. justify-content: center;
  115. cursor: pointer;
  116. background: #ffffff;
  117. border-radius: 20px;
  118. box-shadow: 0px 6 11px 0px rgba(10, 129, 126, 0.1);
  119. }
  120. .intell-item:hover {
  121. border: 1px solid var(--agent_hover);
  122. }
  123. .item-icon {
  124. width: 45px;
  125. }
  126. .intell-item .content {
  127. /* display: flex;
  128. flex-direction: column; */
  129. /* gap: 10px; */
  130. width: 100%;
  131. }
  132. .intell-item .title {
  133. /* font-family: SourceHanSansCN, SourceHanSansCN; */
  134. font-weight: bold;
  135. font-size: 16px;
  136. color: #181d1d;
  137. line-height: 30px;
  138. text-align: center;
  139. margin-bottom: 10px;
  140. }
  141. .intell-item .des {
  142. /* font-family: SourceHanSansCN, SourceHanSansCN; */
  143. font-weight: 400;
  144. font-size: 14px;
  145. color: #181d1d;
  146. line-height: 24px;
  147. text-align: center;
  148. }
  149. </style>