3
3
<el-aside width =" 260px" class =" conversation-container h-100%" >
4
4
<!-- 左顶部:对话 -->
5
5
<div class =" h-100%" >
6
- <el-button class =" w-1/1 btn-new-conversation " type =" primary" @click =" createConversation" >
6
+ <el-button class =" w-1/1 py-4.5 " type =" primary" @click =" createConversation" >
7
7
<Icon icon =" ep:plus" class =" mr-5px" />
8
8
新建对话
9
9
</el-button >
12
12
<el-input
13
13
v-model =" searchName"
14
14
size =" large"
15
- class =" mt-10px search-input "
15
+ class =" mt-5 "
16
16
placeholder =" 搜索历史记录"
17
17
@keyup =" searchConversation"
18
18
>
27
27
<el-empty v-if =" loading" description =" ." :v-loading =" loading" />
28
28
<!-- 情况二:按照 group 分组,展示聊天会话 list 列表 -->
29
29
<div v-for =" conversationKey in Object.keys(conversationMap)" :key =" conversationKey" >
30
- <div
31
- class =" conversation-item classify-title"
32
- v-if =" conversationMap[conversationKey].length"
33
- >
30
+ <div class =" mt-1.25 pt-2.5" v-if =" conversationMap[conversationKey].length" >
34
31
<el-text class =" mx-1" size =" small" tag =" b" >
35
32
{{ conversationKey }}
36
33
</el-text >
37
34
</div >
38
35
<div
39
- class =" conversation-item "
36
+ class =" mt-1.25 "
40
37
v-for =" conversation in conversationMap[conversationKey]"
41
38
:key =" conversation.id"
42
39
@click =" handleConversationClick(conversation.id)"
48
45
conversation.id === activeConversationId ? 'conversation active' : 'conversation'
49
46
"
50
47
>
51
- <div class =" title-wrapper" >
52
- <img class =" avatar" :src =" conversation.roleAvatar || roleAvatarDefaultImg" />
48
+ <div class =" flex flex-row items-center" >
49
+ <img
50
+ class =" w-6.25 h-6.25 rounded-1.25 flex flex-row justify-center"
51
+ :src =" conversation.roleAvatar || roleAvatarDefaultImg"
52
+ />
53
53
<span class =" title" >{{ conversation.title }}</span >
54
54
</div >
55
- <div class =" button-wrapper" v-show =" hoverConversationId === conversation.id" >
56
- <el-button class =" btn" link @click.stop =" handleTop(conversation)" >
55
+ <div
56
+ class =" right-0.5 flex flex-row justify-center"
57
+ style =" color : var (--el-text-color-regular )"
58
+ v-show =" hoverConversationId === conversation.id"
59
+ >
60
+ <el-button class =" m-0" link @click.stop =" handleTop(conversation)" >
57
61
<el-icon title =" 置顶" v-if =" !conversation.pinned" ><Top /></el-icon >
58
62
<el-icon title =" 置顶" v-if =" conversation.pinned" ><Bottom /></el-icon >
59
63
</el-button >
60
- <el-button class =" btn " link @click.stop =" updateConversationTitle(conversation)" >
64
+ <el-button class =" m-0 " link @click.stop =" updateConversationTitle(conversation)" >
61
65
<el-icon title =" 编辑" >
62
66
<Icon icon =" ep:edit" />
63
67
</el-icon >
64
68
</el-button >
65
- <el-button class =" btn " link @click.stop =" deleteChatConversation(conversation)" >
69
+ <el-button class =" m-0 " link @click.stop =" deleteChatConversation(conversation)" >
66
70
<el-icon title =" 删除对话" >
67
71
<Icon icon =" ep:delete" />
68
72
</el-icon >
77
81
</div >
78
82
79
83
<!-- 左底部:工具栏 -->
80
- <div class =" tool-box" >
81
- <div @click =" handleRoleRepository" >
84
+ <div
85
+ class =" absolute bottom-0 left-0 right-0 px-5 leading-8.75 flex justify-between items-center"
86
+ style ="
87
+ background-color : var (--el-fill-color-extra-light );
88
+ box-shadow : 0 0 1px 1px var (--el-border-color-lighter );
89
+ color : var (--el-text-color );
90
+ "
91
+ >
92
+ <div
93
+ class =" flex items-center p-0 m-0 cursor-pointer"
94
+ style =" color : var (--el-text-color-regular )"
95
+ @click =" handleRoleRepository"
96
+ >
82
97
<Icon icon =" ep:user" />
83
- <el-text size =" small" >角色仓库</el-text >
98
+ <el-text class = " ml-1.25 " size =" small" >角色仓库</el-text >
84
99
</div >
85
- <div @click =" handleClearConversation" >
100
+ <div
101
+ class =" flex items-center p-0 m-0 cursor-pointer"
102
+ style =" color : var (--el-text-color-regular )"
103
+ @click =" handleClearConversation"
104
+ >
86
105
<Icon icon =" ep:delete" />
87
- <el-text size =" small" >清空未置顶对话</el-text >
106
+ <el-text class = " ml-1.25 " size =" small" >清空未置顶对话</el-text >
88
107
</div >
89
108
</div >
90
109
@@ -361,26 +380,10 @@ onMounted(async () => {
361
380
padding : 10px 10px 0 ;
362
381
overflow : hidden ;
363
382
364
- .btn-new-conversation {
365
- padding : 18px 0 ;
366
- }
367
-
368
- .search-input {
369
- margin-top : 20px ;
370
- }
371
-
372
383
.conversation-list {
373
384
overflow : auto ;
374
385
height : 100% ;
375
386
376
- .classify-title {
377
- padding-top : 10px ;
378
- }
379
-
380
- .conversation-item {
381
- margin-top : 5px ;
382
- }
383
-
384
387
.conversation {
385
388
display : flex ;
386
389
flex-direction : row ;
@@ -401,12 +404,6 @@ onMounted(async () => {
401
404
}
402
405
}
403
406
404
- .title-wrapper {
405
- display : flex ;
406
- flex-direction : row ;
407
- align-items : center ;
408
- }
409
-
410
407
.title {
411
408
padding : 2px 10px ;
412
409
max-width : 220px ;
@@ -417,58 +414,6 @@ onMounted(async () => {
417
414
white-space : nowrap ;
418
415
text-overflow : ellipsis ;
419
416
}
420
-
421
- .avatar {
422
- width : 25px ;
423
- height : 25px ;
424
- border-radius : 5px ;
425
- display : flex ;
426
- flex-direction : row ;
427
- justify-items : center ;
428
- }
429
-
430
- // 对话编辑、删除
431
- .button-wrapper {
432
- right : 2px ;
433
- display : flex ;
434
- flex-direction : row ;
435
- justify-items : center ;
436
- color : var (--el-text-color-regular );
437
-
438
- .btn {
439
- margin : 0 ;
440
- }
441
- }
442
- }
443
- }
444
-
445
- // 角色仓库、清空未设置对话
446
- .tool-box {
447
- position : absolute ;
448
- bottom : 0 ;
449
- left : 0 ;
450
- right : 0 ;
451
- // width: 100%;
452
- padding : 0 20px ;
453
- background-color : var (--el-fill-color-extra-light );
454
- box-shadow : 0 0 1px 1px var (--el-border-color-lighter );
455
- line-height : 35px ;
456
- display : flex ;
457
- justify-content : space-between ;
458
- align-items : center ;
459
- color : var (--el-text-color );
460
-
461
- > div {
462
- display : flex ;
463
- align-items : center ;
464
- color : var (--el-text-color-regular );
465
- padding : 0 ;
466
- margin : 0 ;
467
- cursor : pointer ;
468
-
469
- > span {
470
- margin-left : 5px ;
471
- }
472
417
}
473
418
}
474
419
}
0 commit comments