Skip to content

Commit a528de7

Browse files
Merge branch 'main' of https://github.com/maxkb-dev/maxkb
2 parents 96b8898 + 8a02f62 commit a528de7

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff 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
543553
function deleteFile(index: number, val: string) {
544554
if (val === 'image') {

ui/src/locales/lang/en-US/components.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

ui/src/styles/app.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
margin: 0;
1212
padding: 0;
1313
}
14-
[v-cloak] {
15-
display: none !important;
16-
}
14+
1715
html {
1816
height: 100%;
1917
box-sizing: border-box;

ui/src/views/document/component/EmbeddingContentDialog.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
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">

0 commit comments

Comments
 (0)