From 46708ceee48a951e8f1d0a209652657fb291280c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 6 May 2025 19:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=96=B0=E5=A2=9Edisabled=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/components/FileUpload/index.vue | 4 ++-- ruoyi-ui/src/components/ImageUpload/index.vue | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index 1b8a56f1..ca37c55b 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -84,7 +84,7 @@ export default { type: Boolean, default: false }, - // 拖动排序 + // 拖动排序 drag: { type: Boolean, default: true @@ -103,7 +103,7 @@ export default { } }, mounted() { - if (this.drag) { + if (this.drag && !this.disabled) { this.$nextTick(() => { const element = this.$refs.uploadFileList?.$el || this.$refs.uploadFileList Sortable.create(element, { diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue index d4429851..e837dae3 100644 --- a/ruoyi-ui/src/components/ImageUpload/index.vue +++ b/ruoyi-ui/src/components/ImageUpload/index.vue @@ -2,6 +2,7 @@
-
+
请上传 @@ -80,7 +81,12 @@ export default { type: Boolean, default: true }, - // 拖动排序 + // 禁用组件(仅查看图片) + disabled: { + type: Boolean, + default: false + }, + // 拖动排序 drag: { type: Boolean, default: true @@ -102,7 +108,7 @@ export default { } }, mounted() { - if (this.drag) { + if (this.drag && !this.disabled) { this.$nextTick(() => { const element = this.$refs.imageUpload?.$el?.querySelector('.el-upload-list') Sortable.create(element, { @@ -245,12 +251,17 @@ export default {