From 348f5c87f356dba46139b6c176c43889e6a02a27 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Sat, 6 May 2023 17:35:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/inout/DialogCheck.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/inout/DialogCheck.vue b/src/views/inout/DialogCheck.vue index 55ed8ef..a03a280 100644 --- a/src/views/inout/DialogCheck.vue +++ b/src/views/inout/DialogCheck.vue @@ -145,6 +145,7 @@ :on-change="uploadOnchange" :on-success="uploadHandleSuccess" :on-error="uploadHandleError" + :on-before="uploadHandleBefore" :file-list="fileList" :data="{type:'image2'}" :auto-upload="true"> @@ -347,7 +348,14 @@ export default { uploadHandleError() { }, - + uploadHandleBefore(file){ + let isJPG = file.type === 'image/jpeg'; + let isPNG = file.type === 'image/png'; + if(!isJPG&&!isPNG){ + this.$message.error('只能上传jpg或png格式'); + } + return isJPG || isPNG; + }, showImgViewer(row){ this.certFileUrl = this.BASE_URL + "/udiwms/image/register/file/getImage?type=image2&name="; this.imgList=[];