BoardAgentItem.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <div class="conversation-agent-item">
  3. <div class="agent-item-icon" @click="handleClick">
  4. <img :src="img_icon" />
  5. </div>
  6. <div class="agent-item-intro" @click="handleClick">
  7. <a-tooltip :content="title" position="top">
  8. <div class="agent-item-intro-title">{{ title }}</div>
  9. </a-tooltip>
  10. <a-tooltip :content="desc" position="top">
  11. <div class="agent-item-intro-desc">{{ desc }}</div>
  12. </a-tooltip>
  13. </div>
  14. </div>
  15. </template>
  16. <script setup>
  17. import { computed } from 'vue';
  18. import { getIconIntelligent } from '../common/icon-map';
  19. const props = defineProps({
  20. title: String,
  21. desc: String,
  22. id: String,
  23. icon: String
  24. });
  25. const img_icon = computed(() => {
  26. return getIconIntelligent(props.icon);
  27. });
  28. const emit = defineEmits(['active']);
  29. const handleClick = () => {
  30. emit('active', props.id);
  31. };
  32. </script>
  33. <style lang="css" scoped>
  34. .conversation-agent-item {
  35. background-color: var(--color-bg-1);
  36. padding: 30px 40px 30px 40px;
  37. border-radius: 20px;
  38. display: flex;
  39. color: var(--color-text-1);
  40. }
  41. .agent-item-icon {
  42. width: 36px;
  43. height: 36px;
  44. background-color: #ccc;
  45. border-radius: 18px;
  46. margin-right: 5px;
  47. flex-shrink: 0;
  48. cursor: pointer;
  49. }
  50. .agent-item-icon img {
  51. width: 100%;
  52. }
  53. .agent-item-intro {
  54. cursor: pointer;
  55. }
  56. .agent-item-intro-title {
  57. font-size: 18px;
  58. font-weight: bold;
  59. margin-bottom: 8px;
  60. display: -webkit-box;
  61. -webkit-box-orient: vertical;
  62. -webkit-line-clamp: 1; /* 这里设置显示的行数 */
  63. line-clamp: 1;
  64. overflow: hidden;
  65. }
  66. .agent-item-intro-desc {
  67. display: -webkit-box;
  68. -webkit-box-orient: vertical;
  69. -webkit-line-clamp: 3; /* 这里设置显示的行数 */
  70. line-clamp: 3;
  71. overflow: hidden;
  72. }
  73. </style>