From 2a9053ef8b4271370835d77c79b826dd38c0e5e4 Mon Sep 17 00:00:00 2001 From: "MY-SH\\lenovo" <1312913002@qq.com> Date: Tue, 12 Dec 2023 18:01:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=88=A4=E6=96=AD=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/FileUpload/index.vue | 26 ++++++++++++------- .../src/views/ehs/ehsNoticeMessage/index.vue | 19 +++++++++----- ruoyi-ui/src/views/index_v1.vue | 2 +- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index c7f6b0a..0f3241b 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -20,7 +20,7 @@
请上传 - + 的文件
@@ -66,6 +66,11 @@ export default { isShowTip: { type: Boolean, default: true + }, + // 默认判断文件类型 + noFileType: { + type: Boolean, + default: false } }, data() { @@ -113,14 +118,17 @@ export default { methods: { // 上传前校检格式和大小 handleBeforeUpload(file) { - // 校检文件类型 - if (this.fileType) { - const fileName = file.name.split('.'); - const fileExt = fileName[fileName.length - 1]; - const isTypeOk = this.fileType.indexOf(fileExt) >= 0; - if (!isTypeOk) { - this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`); - return false; + // 不检查文件类型 + if(!this.noFileType){ + // 校检文件类型 + if (this.fileType) { + const fileName = file.name.split('.'); + const fileExt = fileName[fileName.length - 1]; + const isTypeOk = this.fileType.indexOf(fileExt) >= 0; + if (!isTypeOk) { + this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`); + return false; + } } } // 校检文件大小 diff --git a/ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue b/ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue index a8c3480..5779796 100644 --- a/ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue +++ b/ruoyi-ui/src/views/ehs/ehsNoticeMessage/index.vue @@ -138,7 +138,7 @@ - + @@ -157,20 +157,25 @@ - + - + @@ -413,7 +418,7 @@ export default { }, // 查询弹框内部分页 - handleListFile(row){ + diloagListFile(row){ this.loading = true; this.openFile = true; let data = { pageNum : this.pageNum, pageSize: this.pageSize, "noticeMessageId":row.noticeMessageId} diff --git a/ruoyi-ui/src/views/index_v1.vue b/ruoyi-ui/src/views/index_v1.vue index d2d2ec6..405cb9e 100644 --- a/ruoyi-ui/src/views/index_v1.vue +++ b/ruoyi-ui/src/views/index_v1.vue @@ -25,7 +25,7 @@ - +