This commit is contained in:
parent
6a4a6d8ed6
commit
3a503764c6
@ -12,6 +12,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@kangc/v-md-editor": "^2.3.18",
|
"@kangc/v-md-editor": "^2.3.18",
|
||||||
|
"@notable/html2markdown": "^2.0.3",
|
||||||
"@traptitech/markdown-it-katex": "^3.6.0",
|
"@traptitech/markdown-it-katex": "^3.6.0",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"axios": "^1.7.7",
|
"axios": "^1.7.7",
|
||||||
|
@ -199,6 +199,7 @@ import { useIsMobile } from "@/utils/composables";
|
|||||||
import { useAppStore } from "@/stores/app";
|
import { useAppStore } from "@/stores/app";
|
||||||
import { UploadCustomRequestOptions, useDialog, useMessage } from "naive-ui";
|
import { UploadCustomRequestOptions, useDialog, useMessage } from "naive-ui";
|
||||||
import { useAssistantStore } from "@/stores/assistants";
|
import { useAssistantStore } from "@/stores/assistants";
|
||||||
|
import html2markdown from "@notable/html2markdown";
|
||||||
|
|
||||||
// 获取组件传入的 chatId
|
// 获取组件传入的 chatId
|
||||||
const chatId: Ref<string | number | undefined | null> = ref(null);
|
const chatId: Ref<string | number | undefined | null> = ref(null);
|
||||||
@ -230,7 +231,6 @@ const content = ref("");
|
|||||||
const inputExpanded = ref(false);
|
const inputExpanded = ref(false);
|
||||||
const chatMessages: Ref<EntityChatMessage[] | undefined> = ref([]);
|
const chatMessages: Ref<EntityChatMessage[] | undefined> = ref([]);
|
||||||
const processing = ref(false);
|
const processing = ref(false);
|
||||||
const fileUpload = ref();
|
|
||||||
const uploading = ref(false);
|
const uploading = ref(false);
|
||||||
const autoScroll = ref(true);
|
const autoScroll = ref(true);
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
@ -360,14 +360,14 @@ function sendText() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const input = inputText.value;
|
const input = inputText.value;
|
||||||
const textContent = input.innerText.trim();
|
const textContent = input.innerHTML;
|
||||||
|
|
||||||
if (textContent === "") {
|
if (textContent === "") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发送文本到服务器
|
// 发送文本到服务器
|
||||||
sendMessage("user", textContent);
|
sendMessage("user", html2markdown(textContent));
|
||||||
|
|
||||||
// 清空输入框
|
// 清空输入框
|
||||||
input.innerText = "";
|
input.innerText = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user