Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
sts网站
Commits
46708cee
Commit
46708cee
authored
May 06, 2025
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片上传组件新增disabled属性
parent
ecd20155
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
index.vue
ruoyi-ui/src/components/FileUpload/index.vue
+2
-2
index.vue
ruoyi-ui/src/components/ImageUpload/index.vue
+16
-5
No files found.
ruoyi-ui/src/components/FileUpload/index.vue
View file @
46708cee
...
...
@@ -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
,
{
...
...
ruoyi-ui/src/components/ImageUpload/index.vue
View file @
46708cee
...
...
@@ -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
>
...
...
@@ -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 {
<
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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment