Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7fd56430
authored
Jan 04, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复多文件上传一个一个选择上传第二个文件上传失效的问题
parent
5e265a90
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
src/components/UploadFile/src/UploadFile.vue
+4
-1
No files found.
src/components/UploadFile/src/UploadFile.vue
View file @
7fd56430
...
@@ -100,7 +100,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {
...
@@ -100,7 +100,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {
// 文件上传成功
// 文件上传成功
const
handleFileSuccess
:
UploadProps
[
'onSuccess'
]
=
(
res
:
any
):
void
=>
{
const
handleFileSuccess
:
UploadProps
[
'onSuccess'
]
=
(
res
:
any
):
void
=>
{
message
.
success
(
'上传成功'
)
message
.
success
(
'上传成功'
)
fileList
.
value
.
shift
()
// 删除自身
const
index
=
fileList
.
value
.
findIndex
((
item
)
=>
item
.
response
?.
data
===
res
.
data
)
fileList
.
value
.
splice
(
index
,
1
)
uploadList
.
value
.
push
({
name
:
res
.
data
,
url
:
res
.
data
})
uploadList
.
value
.
push
({
name
:
res
.
data
,
url
:
res
.
data
})
if
(
uploadList
.
value
.
length
==
uploadNumber
.
value
)
{
if
(
uploadList
.
value
.
length
==
uploadNumber
.
value
)
{
fileList
.
value
.
push
(...
uploadList
.
value
)
fileList
.
value
.
push
(...
uploadList
.
value
)
...
@@ -144,6 +146,7 @@ watch(
...
@@ -144,6 +146,7 @@ watch(
fileList
.
value
.
push
(
fileList
.
value
.
push
(
...
val
.
split
(
','
).
map
((
url
)
=>
({
name
:
url
.
substring
(
url
.
lastIndexOf
(
'/'
)
+
1
),
url
}))
...
val
.
split
(
','
).
map
((
url
)
=>
({
name
:
url
.
substring
(
url
.
lastIndexOf
(
'/'
)
+
1
),
url
}))
)
)
return
}
}
// 情况2:数组
// 情况2:数组
fileList
.
value
.
push
(
fileList
.
value
.
push
(
...
...
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