From 056cf940822ba60875c5cb2cfdc05dc9df847131 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 6 May 2025 19:14:54 +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 ad28ca02..c709f6d7 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 @@ -102,7 +102,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 8520b830..85dc28ce 100644 --- a/ruoyi-ui/src/components/ImageUpload/index.vue +++ b/ruoyi-ui/src/components/ImageUpload/index.vue @@ -2,6 +2,7 @@
-
+
请上传 @@ -79,7 +80,12 @@ export default { type: Boolean, default: true }, - // 拖动排序 + // 禁用组件(仅查看图片) + disabled: { + type: Boolean, + default: false + }, + // 拖动排序 drag: { type: Boolean, default: true @@ -100,7 +106,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, { @@ -239,12 +245,17 @@ export default {