修复对话框渲染问题,修改部分交互逻辑
This commit is contained in:
parent
65aa6ab05b
commit
ed6f502b49
|
|
@ -296,7 +296,7 @@
|
|||
heigth="80vh"
|
||||
:before-close="handleMessageTextToDOCClose">
|
||||
<!-- <textarea v-model="textToDocFileContent"></textarea> -->
|
||||
<div id="vditor"></div>
|
||||
<div ref="vditorRef"></div>
|
||||
<el-col>
|
||||
<!-- 提示 -->
|
||||
<el-input v-model="textToDocFileName" placeholder="输入文件名..." style="width: 30%;">输入文件名</el-input>
|
||||
|
|
@ -408,6 +408,7 @@ const selectFileDocType = ref("docx"); // 选择的文本类型
|
|||
const textToDocFileName = ref(""); // 文本创建文件的名称
|
||||
const textToDocFileContent = ref(""); // 文本创建文件的内容
|
||||
const vditor = ref(); // Vditor 实例
|
||||
const vditorRef = ref(null);
|
||||
|
||||
|
||||
const historyMsgHtml= ref([]); // 用于存储历史消息的HTML内容
|
||||
|
|
@ -636,6 +637,7 @@ const doReceiveMessage = (event) => {
|
|||
}
|
||||
|
||||
const sendMessage = () => {
|
||||
localStorage.setItem("gen_ai_chat_model_id", selectModel.value.toString());
|
||||
sendMessageWithFile()
|
||||
return;
|
||||
};
|
||||
|
|
@ -763,6 +765,7 @@ const clearCurrent = () => {
|
|||
messages.length = 0; // 清空消息
|
||||
historyMsgHtml.value.length = 0; // 清空历史消息
|
||||
sessionName.value = "新会话";
|
||||
showSession();
|
||||
ElMessage.success("新会话已创建!可以开始聊天了");
|
||||
};
|
||||
|
||||
|
|
@ -889,14 +892,16 @@ const getMessageWithFile = async (session_id: number) => {
|
|||
const MessageTextToDoc = async (content: string) => {
|
||||
|
||||
textToDocFileContent.value = content;
|
||||
vditor.value = new Vditor('vditor', {
|
||||
textToDocFileVisible.value = true;
|
||||
await nextTick();
|
||||
vditor.value = new Vditor(vditorRef.value, {
|
||||
mode: 'sv',
|
||||
height: '600px',
|
||||
width: '100%',
|
||||
cache: { enable: false },
|
||||
value: textToDocFileContent.value,
|
||||
});
|
||||
textToDocFileVisible.value = true;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -920,8 +925,17 @@ const GetModelListByFunctionName = async () => {
|
|||
let result = await FindModelListByFunctionName(req);
|
||||
if (result["code"] === 0) {
|
||||
ModelList.value = result["data"];
|
||||
selectModel.value = ModelList.value[0].ID;
|
||||
console.log("model_list:", ModelList.value);
|
||||
let gen_ai_chat_model_id = localStorage.getItem("gen_ai_chat_model_id");
|
||||
//console.log("gen_ai_chat_model_id:", gen_ai_chat_model_id);
|
||||
if(gen_ai_chat_model_id == "" || gen_ai_chat_model_id == null){
|
||||
selectModel.value = ModelList.value[0].ID;
|
||||
}else{
|
||||
selectModel.value = parseInt(gen_ai_chat_model_id);
|
||||
}
|
||||
//console.log("gen_ai_chat_model_id:", gen_ai_chat_model_id);
|
||||
//console.log("selectModel:", selectModel.value);
|
||||
// selectModel.value = ModelList.value[0].ID;
|
||||
//console.log("model_list:", ModelList.value);
|
||||
} else {
|
||||
ElMessage.error(result["msg"]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue