Skip to content

Commit c2e9725

Browse files
committed
reactor:【AI 大模型】chat/message 简化成 unocss
1 parent d8daf6f commit c2e9725

File tree

1 file changed

+24
-53
lines changed

1 file changed

+24
-53
lines changed

src/views/ai/chat/index/components/conversation/ConversationList.vue

Lines changed: 24 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!-- AI 对话 -->
22
<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+
>
47
<!-- 左顶部:对话 -->
58
<div class="h-100%">
69
<el-button class="w-1/1 py-4.5" type="primary" @click="createConversation">
@@ -22,7 +25,7 @@
2225
</el-input>
2326

2427
<!-- 左中间:对话列表 -->
25-
<div class="conversation-list">
28+
<div class="overflow-auto h-full">
2629
<!-- 情况一:加载中 -->
2730
<el-empty v-if="loading" description="." :v-loading="loading" />
2831
<!-- 情况二:按照 group 分组,展示聊天会话 list 列表 -->
@@ -41,16 +44,32 @@
4144
@mouseout="hoverConversationId = ''"
4245
>
4346
<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+
: ''
4652
"
4753
>
4854
<div class="flex flex-row items-center">
4955
<img
5056
class="w-6.25 h-6.25 rounded-1.25 flex flex-row justify-center"
5157
:src="conversation.roleAvatar || roleAvatarDefaultImg"
5258
/>
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>
5473
</div>
5574
<div
5675
class="right-0.5 flex flex-row justify-center"
@@ -370,51 +389,3 @@ onMounted(async () => {
370389
}
371390
})
372391
</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

Comments
 (0)