File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed
components/ai-chat/component/chat-input-operate Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -535,10 +535,20 @@ function sendChatHandle(event?: any) {
535535 }
536536 }
537537 } else {
538- // 如果同时按下ctrl+回车键,则会换行
539- inputValue . value += ' \n '
538+ // 如果同时按下ctrl+回车键,则会换行
539+ insertNewlineAtCursor ()
540540 }
541541}
542+ const insertNewlineAtCursor = () => {
543+ const textarea = document .querySelector (' .el-textarea__inner' ) as HTMLTextAreaElement
544+ const startPos = textarea .selectionStart
545+ const endPos = textarea .selectionEnd
546+ // 在光标处插入换行符
547+ inputValue .value = inputValue .value .slice (0 , startPos ) + ' \n ' + inputValue .value .slice (endPos )
548+ nextTick (() => {
549+ textarea .setSelectionRange (startPos + 1 , startPos + 1 ) // 光标定位到换行后位置
550+ })
551+ }
542552
543553function deleteFile(index : number , val : string ) {
544554 if (val === ' image' ) {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export default {
55 loading : 'Loading' ,
66 noMore : 'No more! ' ,
77 selectParagraph : {
8- title : 'Select Paragraph ' ,
8+ title : 'Select Segments ' ,
99 error : 'Process only the failed segments' ,
1010 all : 'All Segments'
1111 }
Original file line number Diff line number Diff line change 1111 margin : 0 ;
1212 padding : 0 ;
1313}
14- [v-cloak ] {
15- display : none !important ;
16- }
14+
1715html {
1816 height : 100% ;
1917 box-sizing : border-box ;
Original file line number Diff line number Diff line change 33 v-model =" dialogVisible"
44 :title =" $t('components.selectParagraph.title')"
55 :before-close =" close"
6+ width =" 450"
67 >
78 <el-radio-group v-model =" state" class =" radio-block" >
89 <el-radio value =" error" size =" large" class =" mb-16" >{{
910 $t('components.selectParagraph.error')
1011 }}</el-radio >
11- <el-radio value =" all" size =" large" >{{
12- $t('components.selectParagraph.all')
13- }}</el-radio >
12+ <el-radio value =" all" size =" large" >{{ $t('components.selectParagraph.all') }}</el-radio >
1413 </el-radio-group >
1514 <template #footer >
1615 <div class =" dialog-footer" >
You can’t perform that action at this time.
0 commit comments