diff --git a/src/views/system/gen-chat.vue b/src/views/system/gen-chat.vue index dc10c4f..a2b1b55 100644 --- a/src/views/system/gen-chat.vue +++ b/src/views/system/gen-chat.vue @@ -119,12 +119,12 @@ - + {{ file.UserFileName }} @@ -146,6 +146,7 @@ v-model="searchFileQuery" prefix-icon="el-icon-search" /> + 上传文件
@@ -173,6 +174,17 @@
+ +
+ + + +
@@ -186,6 +198,7 @@ import { FindUserFileService } from "@/api/file"; import { Check, Loading, DocumentCopy } from "@element-plus/icons-vue"; import MarkdownIt from "markdown-it"; import hljs from "highlight.js"; +import UploadFile from '@/components/upload-file.vue'; import { Session } from "@/types/session"; import { FindSessionService } from "@/api/session"; import { FindModelListByFunctionName } from "@/api/function"; @@ -236,6 +249,7 @@ const selectedFiles = ref([]); // 用于存储已选文件 const selectFileVisible = ref(false); // 控制文件选择对话框的显示与隐藏 const searchFileQuery = ref(""); // 用于搜索文件的查询条件 const filteredFiles = ref([]); // 用于存储过滤后的文件列表 +const uploadFileVisible = ref(false); // 控制上传文件对话框的显示与隐藏 const renderMarkdown = (content: string) => { return md.render(content); @@ -263,12 +277,25 @@ const handleSelectFileVisible = async () => { console.log("handleSelectFileVisible:", selectFileVisible.value); }; +const handleUploadFileClose= async () => { + uploadFileVisible.value = false; // 关闭上传文件对话框 + await getFileListData(); // 获取文件列表 + console.log("handleUploadFileClose:", uploadFileVisible.value); +}; + const handleUploadPicture = () => { // 处理上传图片的逻辑 //选择图片并上传 }; +const uploadMessageFile = () => { + // 处理上传文件的逻辑 + // 这里可以调用上传文件的API + uploadFileVisible.value = true; // 显示上传文件对话框 + console.log("上传文件:", selectedFiles.value); +}; + const handleSelectFileConfirm = () => { // 处理选中的文件 console.log("选中的文件:", selectedFiles.value);