st-comp 0.0.253 → 0.0.254
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +1 -1
- package/es/VarietyAiHelper.cjs +5 -4
- package/es/VarietyAiHelper.js +226 -215
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +1 -1
- package/es/{index-5befc414.cjs → index-40f05e2c.cjs} +2 -2
- package/es/{index-8f9d0d17.js → index-8a54ceeb.js} +2 -2
- package/es/{python-27ece6fa.cjs → python-02c3937a.cjs} +1 -1
- package/es/{python-656db04f.js → python-99011a53.js} +1 -1
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +52 -51
- package/lib/{index-0dab5f01.js → index-28225e49.js} +1828 -1817
- package/lib/{python-1a46034d.js → python-b13b7faa.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/VarietyAiHelper/index.vue +27 -4
package/package.json
CHANGED
|
@@ -199,6 +199,29 @@ const sendMessage = async () => {
|
|
|
199
199
|
isThinking.value = false;
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
|
+
|
|
203
|
+
// 处理键盘事件:Ctrl+Enter 换行,Enter 发送
|
|
204
|
+
const handleKeydown = (event) => {
|
|
205
|
+
if (event.key === 'Enter') {
|
|
206
|
+
if (event.ctrlKey) {
|
|
207
|
+
// Ctrl + Enter: 插入换行符
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
const textarea = event.target;
|
|
210
|
+
const start = textarea.selectionStart;
|
|
211
|
+
const end = textarea.selectionEnd;
|
|
212
|
+
inputMessage.value = inputMessage.value.substring(0, start) + '\n' + inputMessage.value.substring(end);
|
|
213
|
+
// 将光标移动到新插入的换行符之后
|
|
214
|
+
nextTick(() => {
|
|
215
|
+
textarea.selectionStart = textarea.selectionEnd = start + 1;
|
|
216
|
+
});
|
|
217
|
+
} else {
|
|
218
|
+
// 单独的 Enter: 发送消息
|
|
219
|
+
event.preventDefault();
|
|
220
|
+
sendMessage();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
|
|
202
225
|
// 滚动到底部
|
|
203
226
|
const scrollToBottom = async () => {
|
|
204
227
|
await nextTick();
|
|
@@ -317,12 +340,12 @@ defineExpose({
|
|
|
317
340
|
type="textarea"
|
|
318
341
|
:rows="4"
|
|
319
342
|
:autosize="{ minRows: 2, maxRows: 4 }"
|
|
320
|
-
placeholder="输入您想查询的品种条件..."
|
|
321
|
-
@keydown
|
|
343
|
+
placeholder="输入您想查询的品种条件... (Ctrl+Enter换行,Enter发送)"
|
|
344
|
+
@keydown="handleKeydown"
|
|
322
345
|
/>
|
|
323
346
|
<div class="input-actions">
|
|
324
347
|
<div class="input-hint">
|
|
325
|
-
<span>Ctrl + Enter
|
|
348
|
+
<span>Enter 发送 | Ctrl + Enter 换行</span>
|
|
326
349
|
</div>
|
|
327
350
|
<el-button
|
|
328
351
|
class="send-btn"
|
|
@@ -738,4 +761,4 @@ defineExpose({
|
|
|
738
761
|
transform: translateX(5px);
|
|
739
762
|
}
|
|
740
763
|
}
|
|
741
|
-
</style>
|
|
764
|
+
</style>
|