Skip to content

Commit 8b34dcc

Browse files
committed
feat: chat css
1 parent 9a0d7b0 commit 8b34dcc

File tree

3 files changed

+99
-36
lines changed

3 files changed

+99
-36
lines changed
Lines changed: 4 additions & 0 deletions
Loading

frontend/src/views/chat/chat-block/ChartBlock.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,17 @@ function addToDashboard() {
236236
</el-tooltip>
237237
</div>
238238

239-
<div>
239+
<div v-if="message?.record?.sql">
240240
<el-tooltip effect="dark" :content="t('chat.show_sql')" placement="top">
241-
<el-button v-if="message?.record?.sql" class="tool-btn" text @click="showSql">
241+
<el-button class="tool-btn" text @click="showSql">
242242
<el-icon size="16">
243243
<icon_sql_outlined />
244244
</el-icon>
245245
</el-button>
246246
</el-tooltip>
247247
</div>
248-
<div>
248+
<div v-if="false">
249+
<!-- todo -->
249250
<el-tooltip effect="dark" :content="t('chat.export_to')" placement="top">
250251
<el-button class="tool-btn" text>
251252
<el-icon size="16">
@@ -254,7 +255,8 @@ function addToDashboard() {
254255
</el-button>
255256
</el-tooltip>
256257
</div>
257-
<div>
258+
<div v-if="false">
259+
<!-- todo -->
258260
<el-tooltip effect="dark" :content="t('chat.add_to_dashboard')" placement="top">
259261
<el-button class="tool-btn" text @click="addToDashboard">
260262
<el-icon size="16">

frontend/src/views/chat/index.vue

Lines changed: 89 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -246,32 +246,38 @@
246246
v-if="computedMessages.length > 0 || (isAssistant && currentChatId)"
247247
class="chat-footer"
248248
>
249-
<div style="height: 24px">
250-
<template v-if="currentChat.datasource && currentChat.datasource_name">
251-
{{ t('ds.title') }}:{{ currentChat.datasource_name }}
252-
</template>
253-
</div>
254-
<div class="input-wrapper">
255-
<el-input
256-
v-model="inputMessage"
257-
:disabled="isTyping"
258-
class="input-area"
259-
type="textarea"
260-
:rows="1"
261-
:autosize="{ minRows: 1, maxRows: 8 }"
262-
:placeholder="t('qa.question_placeholder')"
263-
@keydown.enter.exact.prevent="sendMessage"
264-
@keydown.ctrl.enter.exact.prevent="handleCtrlEnter"
265-
/>
249+
<div class="input-container" @click="clickInput">
250+
<div class="datasource">
251+
<template v-if="currentChat.datasource && currentChat.datasource_name">
252+
{{ t('qa.selected_datasource') }}:
253+
<span class="name">
254+
{{ currentChat.datasource_name }}
255+
</span>
256+
</template>
257+
</div>
258+
<div class="input-wrapper">
259+
<el-input
260+
ref="inputRef"
261+
v-model="inputMessage"
262+
:disabled="isTyping"
263+
class="input-area"
264+
type="textarea"
265+
:rows="1"
266+
:autosize="{ minRows: 1, maxRows: 8 }"
267+
:placeholder="t('qa.question_placeholder')"
268+
@keydown.enter.exact.prevent="sendMessage"
269+
@keydown.ctrl.enter.exact.prevent="handleCtrlEnter"
270+
/>
271+
</div>
266272
<el-button
267-
link
273+
circle
268274
type="primary"
269275
class="input-icon"
270276
:disabled="isTyping"
271-
@click="sendMessage"
277+
@click.stop="sendMessage"
272278
>
273-
<el-icon size="20">
274-
<Position />
279+
<el-icon size="16">
280+
<icon_send_filled />
275281
</el-icon>
276282
</el-button>
277283
</div>
@@ -284,7 +290,6 @@
284290

285291
<script setup lang="ts">
286292
import { computed, nextTick, onMounted, ref } from 'vue'
287-
import { Position } from '@element-plus/icons-vue'
288293
import { Chat, chatApi, ChatInfo, type ChatMessage, ChatRecord } from '@/api/chat'
289294
import ChatRow from './ChatRow.vue'
290295
import ChartAnswer from './answer/ChartAnswer.vue'
@@ -305,6 +310,7 @@ import icon_screen_outlined from '@/assets/svg/icon_screen_outlined.svg'
305310
import icon_start_outlined from '@/assets/svg/icon_start_outlined.svg'
306311
import logo_fold from '@/assets/LOGO-fold.svg'
307312
import logo from '@/assets/LOGO.svg'
313+
import icon_send_filled from '@/assets/svg/icon_send_filled.svg'
308314
309315
import { useAssistantStore } from '@/stores/assistant'
310316
const assistantStore = useAssistantStore()
@@ -726,6 +732,13 @@ const getHistoryList = () => {
726732
const getCurrentChatId = () => {
727733
return currentChatId.value
728734
}
735+
736+
const inputRef = ref()
737+
738+
function clickInput() {
739+
inputRef.value?.focus()
740+
}
741+
729742
defineExpose({
730743
getHistoryList,
731744
toAssistantHistory,
@@ -794,31 +807,75 @@ defineExpose({
794807
}
795808
796809
.chat-footer {
797-
--ed-footer-height: 120px;
810+
--ed-footer-height: calc(142px + 16px);
811+
812+
padding-bottom: 16px;
798813
799814
display: flex;
800815
flex-direction: column;
816+
align-items: center;
801817
802-
.input-wrapper {
818+
.input-container {
803819
flex: 1;
820+
display: flex;
821+
flex-direction: column;
822+
align-items: center;
823+
width: 100%;
824+
max-width: 800px;
825+
border-radius: 16px;
826+
border: 1px solid rgba(217, 220, 223, 1);
827+
background: rgba(248, 249, 250, 1);
828+
padding: 12px;
829+
gap: 8px;
804830
805831
position: relative;
806832
833+
.input-icon {
834+
min-width: unset;
835+
position: absolute;
836+
bottom: 12px;
837+
right: 12px;
838+
839+
border-color: unset;
840+
841+
&.is-disabled {
842+
background: rgba(187, 191, 196, 1);
843+
border-color: unset;
844+
}
845+
}
846+
847+
&:hover {
848+
border-color: rgba(28, 186, 144, 1);
849+
}
850+
}
851+
852+
.datasource {
853+
width: 100%;
854+
855+
line-height: 22px;
856+
font-size: 14px;
857+
font-weight: 400;
858+
color: rgba(100, 106, 115, 1);
859+
860+
.name {
861+
color: rgba(31, 35, 41, 1);
862+
}
863+
}
864+
865+
.input-wrapper {
866+
width: 100%;
867+
flex: 1;
868+
807869
.input-area {
808870
height: 100%;
809-
padding-bottom: 8px;
810871
811872
:deep(.ed-textarea__inner) {
812873
height: 100% !important;
874+
background: transparent;
875+
box-shadow: unset;
876+
padding: unset;
813877
}
814878
}
815-
816-
.input-icon {
817-
min-width: unset;
818-
position: absolute;
819-
bottom: 14px;
820-
right: 8px;
821-
}
822879
}
823880
}
824881

0 commit comments

Comments
 (0)