Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-purchase
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
张冬
web-purchase
Commits
4e48c5f9
Commit
4e48c5f9
authored
Nov 07, 2020
by
张冬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传文件优化
parent
842be083
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
Upload.vue
src/components/Upload/Upload.vue
+3
-2
specialUpload.vue
src/components/Upload/specialUpload.vue
+5
-2
Sidebar.vue
src/components/common/Sidebar.vue
+3
-0
No files found.
src/components/Upload/Upload.vue
View file @
4e48c5f9
...
...
@@ -71,7 +71,7 @@ export default {
},
max
:
{
type
:
Number
,
default
:
99
default
:
100
}
},
data
()
{
...
...
@@ -98,7 +98,7 @@ export default {
this
.
$emit
(
'input'
,
value
);
},
beforeUpload
(
file
)
{
this
.
loading
=
true
const
max
=
this
.
max
;
const
isLt2M
=
file
.
size
/
1024
/
1024
<
max
;
if
(
!
isLt2M
)
{
...
...
@@ -109,6 +109,7 @@ export default {
this
.
$message
.
warning
(
`每次只能上传
${
this
.
limit
}
个文件`
);
return
;
}
this
.
loading
=
true
// 生成的文件名称
let
objName
=
getFileNameUUID
();
// 调用 ali-oss 中的方法
...
...
src/components/Upload/specialUpload.vue
View file @
4e48c5f9
...
...
@@ -12,7 +12,7 @@
action
multiple
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<el-button
size=
"small"
type=
"primary"
v-loading
.
fullscreen
.
lock=
"loading"
>
点击上传
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
>
{{
tip
}}
</div>
</el-upload>
</div>
...
...
@@ -92,7 +92,7 @@ export default {
},
max
:
{
type
:
Number
,
default
:
99
default
:
100
},
fileList
:
{
type
:
Array
,
...
...
@@ -101,6 +101,7 @@ export default {
},
data
()
{
return
{
loading
:
false
,
tableData
:
[],
columns
:
[
{
...
...
@@ -151,6 +152,7 @@ export default {
this
.
$message
.
warning
(
`每次只能上传
${
this
.
limit
}
个文件`
);
return
;
}
this
.
loading
=
true
// 生成的文件名称
let
objName
=
getFileNameUUID
();
// 调用 ali-oss 中的方法
...
...
@@ -165,6 +167,7 @@ export default {
res
.
fileUrl
=
res
.
url
;
this
.
fileList
.
push
(
res
);
this
.
$emit
(
'input'
,
this
.
fileList
);
this
.
loading
=
false
});
},
handleRemove
(
file
,
fileList
,
index
)
{
...
...
src/components/common/Sidebar.vue
View file @
4e48c5f9
...
...
@@ -98,4 +98,7 @@ export default {
.sidebar
>
ul
{
height
:
100%
;
}
.el-menu-item
i
{
color
:
#AFB0B3
;
}
</
style
>
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