From 050078c08237238a2706c8bd7c5ea3382f3c01f7 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Tue, 16 Sep 2025 13:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=85=E9=81=93bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadFileFormData/index.vue | 32 ++++---- src/views/dataManage/pro-materials/index.vue | 77 ++++++++++++++++++- src/views/dataManage/product-center/index.vue | 1 + src/views/publicService/components/navBar.vue | 4 +- src/views/publicService/index.vue | 12 +-- 5 files changed, 102 insertions(+), 24 deletions(-) diff --git a/src/components/UploadFileFormData/index.vue b/src/components/UploadFileFormData/index.vue index 272d282..e3c3b7a 100644 --- a/src/components/UploadFileFormData/index.vue +++ b/src/components/UploadFileFormData/index.vue @@ -40,7 +40,7 @@ export default { // 文件类型 fileType: { type: Array, - default: ['png', 'jpg', 'jpeg'], + default: [], }, // 文件大小 fileSize: { @@ -185,20 +185,24 @@ export default { handleChange(file, fileList) { // console.log(file, fileList, 'file, fileList') - // const isFormat = this.fileType.some((e) => file.name.endsWith(e)) - // if (!isFormat) { - // this.$modal.msgError( - // `文件格式不正确, 请上传${this.fileType.join( - // '、', - // )}格式的文件!`, - // ) + if (this.fileType.length > 0) { + const isFormat = this.fileType.some((e) => + file.name.endsWith(e), + ) + if (!isFormat) { + this.$modal.msgError( + `文件格式不正确, 请上传${this.fileType.join( + '、', + )}格式的文件!`, + ) - // this.$emit( - // 'update:fileList', - // fileList.filter((item) => item.uid !== file.uid), - // ) - // return false - // } + this.$emit( + 'update:fileList', + fileList.filter((item) => item.uid !== file.uid), + ) + return false + } + } // 判断文件大小 const isLt = file.size / 1024 / 1024 < this.fileSize diff --git a/src/views/dataManage/pro-materials/index.vue b/src/views/dataManage/pro-materials/index.vue index 3b41c84..a6221d3 100644 --- a/src/views/dataManage/pro-materials/index.vue +++ b/src/views/dataManage/pro-materials/index.vue @@ -107,7 +107,12 @@ - {{ scope.row.files[0].originalName }} + + {{ scope.row.files[0].originalName }} + / @@ -117,6 +122,15 @@ + + @@ -153,7 +167,6 @@ /> - + + +