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 {