|
1 | 1 | <!-- AI 对话 -->
|
2 | 2 | <template>
|
3 |
| - <el-aside width="260px" class="conversation-container h-100%"> |
| 3 | + <el-aside |
| 4 | + width="260px" |
| 5 | + class="h-100% relative flex flex-col justify-between px-2.5 pt-2.5 pb-0 overflow-hidden" |
| 6 | + > |
4 | 7 | <!-- 左顶部:对话 -->
|
5 | 8 | <div class="h-100%">
|
6 | 9 | <el-button class="w-1/1 py-4.5" type="primary" @click="createConversation">
|
|
22 | 25 | </el-input>
|
23 | 26 |
|
24 | 27 | <!-- 左中间:对话列表 -->
|
25 |
| - <div class="conversation-list"> |
| 28 | + <div class="overflow-auto h-full"> |
26 | 29 | <!-- 情况一:加载中 -->
|
27 | 30 | <el-empty v-if="loading" description="." :v-loading="loading" />
|
28 | 31 | <!-- 情况二:按照 group 分组,展示聊天会话 list 列表 -->
|
|
41 | 44 | @mouseout="hoverConversationId = ''"
|
42 | 45 | >
|
43 | 46 | <div
|
44 |
| - :class=" |
45 |
| - conversation.id === activeConversationId ? 'conversation active' : 'conversation' |
| 47 | + class="flex flex-row justify-between flex-1 px-1.25 cursor-pointer rounded-1.25 items-center leading-7.5" |
| 48 | + :style=" |
| 49 | + conversation.id === activeConversationId |
| 50 | + ? 'background-color: var(--el-color-primary-light-9); border: 1px solid var(--el-color-primary-light-7);' |
| 51 | + : '' |
46 | 52 | "
|
47 | 53 | >
|
48 | 54 | <div class="flex flex-row items-center">
|
49 | 55 | <img
|
50 | 56 | class="w-6.25 h-6.25 rounded-1.25 flex flex-row justify-center"
|
51 | 57 | :src="conversation.roleAvatar || roleAvatarDefaultImg"
|
52 | 58 | />
|
53 |
| - <span class="title">{{ conversation.title }}</span> |
| 59 | + <span |
| 60 | + class="py-0.5 px-2.5" |
| 61 | + style=" |
| 62 | + max-width: 220px; |
| 63 | + font-size: 14px; |
| 64 | + font-weight: 400; |
| 65 | + color: var(--el-text-color-regular); |
| 66 | + overflow: hidden; |
| 67 | + white-space: nowrap; |
| 68 | + text-overflow: ellipsis; |
| 69 | + " |
| 70 | + > |
| 71 | + {{ conversation.title }} |
| 72 | + </span> |
54 | 73 | </div>
|
55 | 74 | <div
|
56 | 75 | class="right-0.5 flex flex-row justify-center"
|
@@ -370,51 +389,3 @@ onMounted(async () => {
|
370 | 389 | }
|
371 | 390 | })
|
372 | 391 | </script>
|
373 |
| - |
374 |
| -<style scoped lang="scss"> |
375 |
| -.conversation-container { |
376 |
| - position: relative; |
377 |
| - display: flex; |
378 |
| - flex-direction: column; |
379 |
| - justify-content: space-between; |
380 |
| - padding: 10px 10px 0; |
381 |
| - overflow: hidden; |
382 |
| -
|
383 |
| - .conversation-list { |
384 |
| - overflow: auto; |
385 |
| - height: 100%; |
386 |
| -
|
387 |
| - .conversation { |
388 |
| - display: flex; |
389 |
| - flex-direction: row; |
390 |
| - justify-content: space-between; |
391 |
| - flex: 1; |
392 |
| - padding: 0 5px; |
393 |
| - cursor: pointer; |
394 |
| - border-radius: 5px; |
395 |
| - align-items: center; |
396 |
| - line-height: 30px; |
397 |
| -
|
398 |
| - &.active { |
399 |
| - background-color: var(--el-color-primary-light-9); |
400 |
| - border: 1px solid var(--el-color-primary-light-7); |
401 |
| -
|
402 |
| - .button { |
403 |
| - display: inline-block; |
404 |
| - } |
405 |
| - } |
406 |
| -
|
407 |
| - .title { |
408 |
| - padding: 2px 10px; |
409 |
| - max-width: 220px; |
410 |
| - font-size: 14px; |
411 |
| - font-weight: 400; |
412 |
| - color: var(--el-text-color-regular); |
413 |
| - overflow: hidden; |
414 |
| - white-space: nowrap; |
415 |
| - text-overflow: ellipsis; |
416 |
| - } |
417 |
| - } |
418 |
| - } |
419 |
| -} |
420 |
| -</style> |
0 commit comments