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 >
284290
285291<script setup lang="ts">
286292import { computed , nextTick , onMounted , ref } from ' vue'
287- import { Position } from ' @element-plus/icons-vue'
288293import { Chat , chatApi , ChatInfo , type ChatMessage , ChatRecord } from ' @/api/chat'
289294import ChatRow from ' ./ChatRow.vue'
290295import ChartAnswer from ' ./answer/ChartAnswer.vue'
@@ -305,6 +310,7 @@ import icon_screen_outlined from '@/assets/svg/icon_screen_outlined.svg'
305310import icon_start_outlined from ' @/assets/svg/icon_start_outlined.svg'
306311import logo_fold from ' @/assets/LOGO-fold.svg'
307312import logo from ' @/assets/LOGO.svg'
313+ import icon_send_filled from ' @/assets/svg/icon_send_filled.svg'
308314
309315import { useAssistantStore } from ' @/stores/assistant'
310316const assistantStore = useAssistantStore ()
@@ -726,6 +732,13 @@ const getHistoryList = () => {
726732const getCurrentChatId = () => {
727733 return currentChatId .value
728734}
735+
736+ const inputRef = ref ()
737+
738+ function clickInput() {
739+ inputRef .value ?.focus ()
740+ }
741+
729742defineExpose ({
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