From 8de65f09741983670ebf973d0d8ad156d404ad4f Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Wed, 21 Jun 2023 16:20:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enterprise/unmannedVideo/videoData/index.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/views/enterprise/unmannedVideo/videoData/index.vue b/src/views/enterprise/unmannedVideo/videoData/index.vue index 598de80..09d5cd7 100644 --- a/src/views/enterprise/unmannedVideo/videoData/index.vue +++ b/src/views/enterprise/unmannedVideo/videoData/index.vue @@ -52,7 +52,8 @@
- + +
{{ item.title }} @@ -117,6 +118,7 @@ multiple :limit="1" :on-success="uploadSuccess" + :before-upload="beforeUpload" style="width: 100%" > 点击上传 @@ -234,6 +236,15 @@ const searchSn = ref(""); // 项目或者工程名字 const searchName = ref(""); +// 文件上传之前的钩子函数 +const beforeUpload = file => { + console.log(file); + const type = file.type; + if (type != "video/mp4") { + ElMessage.error("请上传视频文件"); + return false; + } +}; // 页面的项目名称和工程名称的div点击事件 const onSearch = async (params: ResAiProjectPage | ResAiEngineerPage) => { const { result } = await getAIQuestionPage(