From e0af7e8fad8a71d02ba5d6c08b2e383e0e213431 Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Fri, 23 Feb 2024 16:00:27 +0800 Subject: [PATCH] =?UTF-8?q?Bug:ID1000473=E3=80=91=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=A7=86=E9=A2=91=E9=A1=B6=E9=83=A8=E6=8C=87?= =?UTF-8?q?=E5=BC=95=E7=9A=84=E8=A7=86=E9=A2=91=E6=B2=A1=E6=9C=89=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E6=92=AD=E6=94=BE=EF=BC=8C=E5=90=8E=E7=AE=A1=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/instrument/index.vue | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index fa3d5ca..16285a3 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -1279,6 +1279,17 @@ import draggable from 'vuedraggable' export default { name: 'Instrument', components: { Treeselect, draggable }, + props: { + // 大小限制(MB) + fileSize: { + type: Number, + default: 1, + }, + fileType: { + type: Array, + default: () => ["bmp", "gif", "jpg", "jpeg", "png", "mp4", "avi", "rmvb"], + }, + }, data() { return { // 遮罩层 @@ -1504,15 +1515,6 @@ export default { sortMode: [], }, newModeOptionList: [], - fileType: { - type: Array, - default: () => ["bmp", "gif", "jpg", "jpeg", "png", "mp4", "avi", "rmvb"], - }, - // 大小限制(MB) - fileSize: { - type: Number, - default: 1, - }, } }, created() { @@ -2447,7 +2449,7 @@ export default { if (this.fileType) { const fileName = file.name.split('.'); const fileExt = fileName[fileName.length - 1]; - const isTypeOk = this.fileType.default().indexOf(fileExt) >= 0; + const isTypeOk = this.fileType.indexOf(fileExt) >= 0; if (!isTypeOk) { this.$modal.msgError(`文件格式不正确`); return false; @@ -2458,7 +2460,7 @@ export default { if (this.fileSize) { const isLt = file.size / 1024 / 1024 < this.fileSize; if (!isLt) { - this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize.default} MB!`); + this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`); return false; } }