From 00e0dbbf98347b1e47a7e0aedd41baa61f7567ed Mon Sep 17 00:00:00 2001
From: fuyongxin <110568259@qq.com>
Date: Wed, 03 Jun 2026 08:47:03 +0800
Subject: [PATCH] 修改配置nacos,后端gateway端口
---
ruoyi-ui/src/components/ImageUpload/index.vue | 43 +++++++++++++++++++++++++++++++++++++------
1 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index 338007f..85dc28c 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -2,6 +2,7 @@
<div class="component-upload-image">
<el-upload
multiple
+ :disabled="disabled"
:action="uploadImgUrl"
list-type="picture-card"
:on-success="handleUploadSuccess"
@@ -22,7 +23,7 @@
</el-upload>
<!-- 上传提示 -->
- <div class="el-upload__tip" slot="tip" v-if="showTip">
+ <div class="el-upload__tip" slot="tip" v-if="showTip && !disabled">
请上传
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
@@ -45,6 +46,7 @@
<script>
import { getToken } from "@/utils/auth"
+import Sortable from 'sortablejs'
export default {
props: {
@@ -61,20 +63,30 @@
// 图片数量限制
limit: {
type: Number,
- default: 5,
+ default: 5
},
// 大小限制(MB)
fileSize: {
type: Number,
- default: 5,
+ default: 5
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
- default: () => ["png", "jpg", "jpeg"],
+ default: () => ["png", "jpg", "jpeg"]
},
// 是否显示提示
isShowTip: {
+ type: Boolean,
+ default: true
+ },
+ // 禁用组件(仅查看图片)
+ disabled: {
+ type: Boolean,
+ default: false
+ },
+ // 拖动排序
+ drag: {
type: Boolean,
default: true
}
@@ -91,6 +103,20 @@
Authorization: "Bearer " + getToken(),
},
fileList: []
+ }
+ },
+ mounted() {
+ if (this.drag && !this.disabled) {
+ this.$nextTick(() => {
+ const element = this.$refs.imageUpload?.$el?.querySelector('.el-upload-list')
+ Sortable.create(element, {
+ onEnd: (evt) => {
+ const movedItem = this.fileList.splice(evt.oldIndex, 1)[0]
+ this.fileList.splice(evt.newIndex, 0, movedItem)
+ this.$emit("input", this.listToString(this.fileList))
+ }
+ })
+ })
}
},
watch: {
@@ -219,12 +245,17 @@
<style scoped lang="scss">
// .el-upload--picture-card 控制加号部分
::v-deep.hide .el-upload--picture-card {
- display: none;
+ display: none;
}
+
+::v-deep .el-upload-list--picture-card.is-disabled + .el-upload--picture-card {
+ display: none !important;
+}
+
// 去掉动画效果
::v-deep .el-list-enter-active,
::v-deep .el-list-leave-active {
- transition: all 0s;
+ transition: all 0s;
}
::v-deep .el-list-enter, .el-list-leave-active {
--
Gitblit v1.9.3