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 {