| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <div class="conversation-agent-item">
- <div class="agent-item-icon" @click="handleClick">
- <img :src="img_icon" />
- </div>
- <div class="agent-item-intro" @click="handleClick">
- <a-tooltip :content="title" position="top">
- <div class="agent-item-intro-title">{{ title }}</div>
- </a-tooltip>
- <a-tooltip :content="desc" position="top">
- <div class="agent-item-intro-desc">{{ desc }}</div>
- </a-tooltip>
- </div>
- </div>
- </template>
- <script setup>
- import { computed } from 'vue';
- import { getIconIntelligent } from '../common/icon-map';
- const props = defineProps({
- title: String,
- desc: String,
- id: String,
- icon: String
- });
- const img_icon = computed(() => {
- return getIconIntelligent(props.icon);
- });
- const emit = defineEmits(['active']);
- const handleClick = () => {
- emit('active', props.id);
- };
- </script>
- <style lang="css" scoped>
- .conversation-agent-item {
- background-color: var(--color-bg-1);
- padding: 30px 40px 30px 40px;
- border-radius: 20px;
- display: flex;
- color: var(--color-text-1);
- }
- .agent-item-icon {
- width: 36px;
- height: 36px;
- background-color: #ccc;
- border-radius: 18px;
- margin-right: 5px;
- flex-shrink: 0;
- cursor: pointer;
- }
- .agent-item-icon img {
- width: 100%;
- }
- .agent-item-intro {
- cursor: pointer;
- }
- .agent-item-intro-title {
- font-size: 18px;
- font-weight: bold;
- margin-bottom: 8px;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 1; /* 这里设置显示的行数 */
- line-clamp: 1;
- overflow: hidden;
- }
- .agent-item-intro-desc {
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 3; /* 这里设置显示的行数 */
- line-clamp: 3;
- overflow: hidden;
- }
- </style>
|