From 4e8847f93f2fcba8046c2f9fc66df5511a066b5b Mon Sep 17 00:00:00 2001 From: Shan Ao <178391389@qq.com> Date: Mon, 17 Feb 2025 09:37:56 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=9C=E4=BD=93=E7=B3=BB=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E2=80=9D=E4=B8=AD=E4=B8=8A=E4=BC=A0=E7=9A=84=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9B=AE=E5=89=8D=E5=8F=AA=E8=83=BD=E6=98=AFpdf=EF=BC=8C?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E6=A0=BC=E5=BC=8F=E7=9A=84=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E4=B8=8D=E4=BA=86=EF=BC=8C=E5=BB=BA=E8=AE=AE=E8=83=BD=E5=B0=86?= =?UTF-8?q?word=E3=80=81excel=E5=8F=8A=E7=85=A7=E7=89=87=E7=9A=84=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=8A=E4=BC=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “事件起因”建议去掉,与“原因分析及责任认定”中部分重合。“报出日期”的时间填写意义不大,建议去除。 事故事件中照片只能上传一张,多了就不让上传了,应该能上传多张,限制一下数量即可。附件也是只能上传pdf,其他格式上传不了,应能上传其他格式的文件。 --- .../accident/event/components/addOrEdit.vue | 146 ++++++++---------- src/views/filemananger/mfolder/index.vue | 58 ++++--- 2 files changed, 97 insertions(+), 107 deletions(-) diff --git a/src/views/accident/event/components/addOrEdit.vue b/src/views/accident/event/components/addOrEdit.vue index c971ec2..0caef1d 100644 --- a/src/views/accident/event/components/addOrEdit.vue +++ b/src/views/accident/event/components/addOrEdit.vue @@ -1,7 +1,7 @@ @@ -82,12 +83,12 @@ - {{ form.FFILE.name }} 上传 @@ -115,7 +116,7 @@ :on-change="handleChangePDF2" :before-upload = "beforeFileUpload2" :auto-upload="false" - accept=".pdf" + accept=".pdf, .doc, .xls, .jpg, .png, .jpeg" class="upload-demo" action="#"> 选取文件 @@ -162,7 +163,16 @@ class="video-player vjs-custom-skin"/> - + + +
+ +
+
+
@@ -180,11 +190,14 @@ export default { directives: { waves }, data() { return { + config: config, txtPre: '', + imgUrl: '', dialogFormUpload: false, dialogForm: false, listLoading: true, treeLoading: false, + dialogViewImg: false, dialogBatchUpload: false, add: false, del: false, @@ -259,7 +272,10 @@ export default { this.urlToBlob() }, methods: { - + goViewImg(filePath) { + this.imgUrl = this.config.fileUrl + filePath + this.dialogViewImg = true + }, urlToBlob() {}, // 上一页 prePage() { @@ -321,20 +337,18 @@ export default { console.log(file) }, handleChangePDF(file, fileList) { - const types = ['application/pdf'] - const isImage = types.includes(file.raw.type) - if (!isImage) { - this.$message.error('上传文件只能是 PDF 格式!') + const types = ['pdf', 'doc', 'xls', 'jpg', 'png', 'jpeg'] + if (!types.includes(file.name.substring(file.name.lastIndexOf('.') + 1))) { + this.$message.error('上传文件只支持【' + types + '】格式!') fileList.pop() } else { this.form.FFILE = file.raw } }, handleChangePDF2(file, fileList) { - const types = ['application/pdf'] - const isImage = types.includes(file.raw.type) - if (!isImage) { - this.$message.error('上传文件只能是 PDF 格式!') + const types = ['pdf', 'doc', 'xls', 'jpg', 'png', 'jpeg'] + if (!types.includes(file.name.substring(file.name.lastIndexOf('.') + 1))) { + this.$message.error('上传文件只支持【' + types + '】格式!') fileList.pop() } }, @@ -355,23 +369,21 @@ export default { // return false // }, beforeFileUpload2(file) { - var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1) - const extension = testmsg === 'pdf' - if (!extension) { - this.$confirm(`上传文件只能是pdf格式!`) - } else { + const types = ['pdf', 'doc', 'xls', 'jpg', 'png', 'jpeg'] + if (types.includes(file.name.substring(file.name.lastIndexOf('.') + 1))) { this.fileList.push(file) + } else { + this.$confirm('上传文件只支持【' + types + '】格式!') } this.$forceUpdate() return false }, beforeFileUpload(file) { - var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1) - const extension = testmsg === 'pdf' - if (!extension) { - this.$confirm(`上传文件只能是pdf格式!`) - } else { + const types = ['pdf', 'doc', 'xls', 'jpg', 'png', 'jpeg'] + if (types.includes(file.name.substring(file.name.lastIndexOf('.') + 1))) { this.form.FFILE = file + } else { + this.$confirm('上传文件只支持【' + types + '】格式!') } this.$forceUpdate() return false