Skip to content

Commit dc0ae4d

Browse files
style: Optimize chat page style
1 parent 32b7aa9 commit dc0ae4d

File tree

8 files changed

+74
-40
lines changed

8 files changed

+74
-40
lines changed

ui/src/components/ai-chat/component/answer-content/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<LogoIcon v-else height="32px" width="32px" />
77
</div>
88
<div class="content" @mouseup="openControl">
9-
<el-card shadow="always" class="dialog-card mb-8">
9+
<el-card shadow="always" class="mb-8 border-r-8">
1010
<MdRenderer
1111
v-if="
1212
(chatRecord.write_ed === undefined || chatRecord.write_ed === true) &&
@@ -27,10 +27,10 @@
2727
:send-message="chatMessage"
2828
></MdRenderer>
2929
</template>
30-
<span v-else-if="chatRecord.is_stop" shadow="always" class="dialog-card">
30+
<span v-else-if="chatRecord.is_stop" shadow="always">
3131
{{ $t('chat.tip.stopAnswer') }}
3232
</span>
33-
<span v-else shadow="always" class="dialog-card">
33+
<span v-else shadow="always">
3434
{{ $t('chat.tip.answerLoading') }} <span class="dotting"></span>
3535
</span>
3636
<!-- 知识来源 -->

ui/src/components/ai-chat/component/prologue-content/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<LogoIcon v-else height="32px" width="32px" />
77
</div>
88
<div class="content" v-if="prologue">
9-
<el-card shadow="always" class="dialog-card" style="--el-card-padding: 10px 16px 12px">
9+
<el-card shadow="always" class="border-r-8" style="--el-card-padding: 10px 16px 12px">
1010
<MdRenderer
1111
:source="prologue"
1212
:send-message="sendMessage"

ui/src/components/ai-chat/component/question-content/index.vue

Lines changed: 62 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
<template>
22
<!-- 问题内容 -->
33
<div class="question-content item-content mb-16 lighter">
4-
<div class="content mr-16">
4+
<div
5+
class="content mr-12 p-12-16 border-r-8"
6+
:class="document_list.length >= 2 ? 'media_2' : `media_${document_list.length}`"
7+
>
58
<div class="text break-all pre-wrap">
69
<div class="mb-8" v-if="document_list.length">
7-
<el-row :gutter="10">
8-
<el-col
9-
v-for="(item, index) in document_list"
10-
:key="index"
11-
:xs="24"
12-
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
13-
:md="props.type === 'debug-ai-chat' ? 24 : 12"
14-
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
15-
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
16-
class="mb-8 w-full"
17-
>
10+
<el-space wrap class="w-full media-file-width">
11+
<template v-for="(item, index) in document_list" :key="index">
1812
<el-card shadow="never" style="--el-card-padding: 8px" class="download-file cursor">
1913
<div class="download-button flex align-center" @click="downloadFile(item)">
2014
<el-icon class="mr-4">
@@ -29,8 +23,8 @@
2923
</div>
3024
</div>
3125
</el-card>
32-
</el-col>
33-
</el-row>
26+
</template>
27+
</el-space>
3428
</div>
3529
<div class="mb-8" v-if="image_list.length">
3630
<el-space wrap>
@@ -53,17 +47,8 @@
5347
</el-space>
5448
</div>
5549
<div class="mb-8" v-if="audio_list.length">
56-
<el-row :gutter="10">
57-
<el-col
58-
v-for="(item, index) in audio_list"
59-
:key="index"
60-
:xs="24"
61-
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
62-
:md="props.type === 'debug-ai-chat' ? 24 : 12"
63-
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
64-
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
65-
class="mb-8"
66-
>
50+
<el-space wrap>
51+
<template v-for="(item, index) in audio_list" :key="index">
6752
<div class="file cursor border-r-4" v-if="item.url">
6853
<audio
6954
:src="item.url"
@@ -72,10 +57,10 @@
7257
class="border-r-4"
7358
/>
7459
</div>
75-
</el-col>
76-
</el-row>
60+
</template>
61+
</el-space>
7762
</div>
78-
{{ chatRecord.problem_text }}
63+
<span> {{ chatRecord.problem_text }}</span>
7964
</div>
8065
</div>
8166
<div class="avatar">
@@ -140,6 +125,16 @@ onMounted(() => {})
140125
.question-content {
141126
display: flex;
142127
justify-content: flex-end;
128+
padding-left: var(--padding-left);
129+
width: 100%;
130+
box-sizing: border-box;
131+
132+
.content {
133+
background: #d6e2ff;
134+
padding-left: 16px;
135+
padding-right: 16px;
136+
137+
}
143138
144139
.download-file {
145140
height: 43px;
@@ -163,5 +158,44 @@ onMounted(() => {})
163158
display: none;
164159
}
165160
}
161+
.media-file-width {
162+
:deep(.el-space__item) {
163+
min-width: 40% !important;
164+
flex-grow: 1;
165+
}
166+
}
167+
.media_2 {
168+
flex: 1;
169+
}
170+
.media_0 {
171+
flex: inherit;
172+
}
173+
.media_1 {
174+
width: 50%;
175+
}
176+
}
177+
@media only screen and (max-width: 768px) {
178+
.question-content {
179+
.media-file-width {
180+
:deep(.el-space__item) {
181+
min-width: 100% !important;
182+
}
183+
}
184+
.media_1 {
185+
width: 100%;
186+
}
187+
}
188+
}
189+
.debug-ai-chat {
190+
.question-content {
191+
.media-file-width {
192+
:deep(.el-space__item) {
193+
min-width: 100% !important;
194+
}
195+
}
196+
.media_1 {
197+
width: 100%;
198+
}
199+
}
166200
}
167201
</style>

ui/src/components/ai-chat/component/user-form/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class="mb-16"
88
style="padding: 0 24px"
99
>
10-
<el-card shadow="always" class="dialog-card" style="--el-card-padding: 16px 8px">
10+
<el-card shadow="always" class="border-r-8" style="--el-card-padding: 16px 8px">
1111
<div
1212
class="flex align-center cursor w-full"
1313
style="padding: 0 8px"

ui/src/components/ai-chat/index.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@
1717

1818
.content {
1919
padding-left: var(--padding-left);
20+
padding-right: var(--padding-left);
2021

2122
:deep(ol) {
2223
margin-left: 16px !important;
2324
}
2425
}
25-
26-
.text {
27-
padding: 6px 0;
28-
}
2926
}
3027
&__operate {
3128
background: #f3f7f9;

ui/src/components/ai-chat/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div ref="aiChatRef" class="ai-chat" :class="type == 'log' ? 'chart-log' : ''">
2+
<div ref="aiChatRef" class="ai-chat" :class="type">
33
<UserForm
44
v-model:api_form_data="api_form_data"
55
v-model:form_data="form_data"

ui/src/styles/app.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ h5 {
311311
.border-r-4 {
312312
border-radius: 4px;
313313
}
314+
.border-r-8 {
315+
border-radius: 8px;
316+
}
314317

315318
.border-t-dashed {
316319
border-top: 1px dashed var(--el-border-color);
@@ -761,4 +764,4 @@ h5 {
761764
.responsive-dialog {
762765
width: 90% !important;
763766
}
764-
}
767+
}

ui/src/views/chat/pc/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
</div>
102102
<div class="chat-pc__right">
103103
<div class="right-header border-b mb-24 p-16-24 flex-between">
104-
<h4 class="ellipsis-1" style="width: 70%">
104+
<h4 class="ellipsis-1" style="width: 66%">
105105
{{ currentChatName }}
106106
</h4>
107107

0 commit comments

Comments
 (0)