Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-presale
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 201ec580
authored
Apr 12, 2024
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
上传文件添加loading
1 parent
b09ce3ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
src/assets/loading.png
src/views/taskList/index.vue
src/assets/loading.png
0 → 100644
View file @
201ec58
1023 Bytes
src/views/taskList/index.vue
View file @
201ec58
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
上传文件
上传文件
<input
type=
"file"
style=
"opacity: 0;width: 0;height: 0;"
ref=
"file"
accept=
".xlsx"
@
change=
"uploadFile"
/>
<input
type=
"file"
style=
"opacity: 0;width: 0;height: 0;"
ref=
"file"
accept=
".xlsx"
@
change=
"uploadFile"
/>
</el-button>
</el-button>
<img
v-if=
"fileLoading"
class=
"loading-img"
:src=
"require('@/assets/loading.png')"
alt=
""
/>
<div
class=
"file-wrap"
v-if=
"uploadFormObj.fileName"
>
<div
class=
"file-wrap"
v-if=
"uploadFormObj.fileName"
>
<div
class=
"file-box"
@
click=
"toOpenPDF(uploadFormObj.fileUrl)"
>
<div
class=
"file-box"
@
click=
"toOpenPDF(uploadFormObj.fileUrl)"
>
<div
class=
"info"
v-if=
"uploadFormObj.fileName"
>
<div
class=
"info"
v-if=
"uploadFormObj.fileName"
>
...
@@ -72,6 +73,7 @@ export default {
...
@@ -72,6 +73,7 @@ export default {
taskStatusEnum
,
taskStatusEnum
,
shelfStatusEnum
,
shelfStatusEnum
,
isVisible
:
false
,
isVisible
:
false
,
fileLoading
:
false
,
uploadRules
:
{
uploadRules
:
{
taskMonth
:
[{
required
:
true
,
message
:
'请选择任务时间'
,
trigger
:
'change'
}],
taskMonth
:
[{
required
:
true
,
message
:
'请选择任务时间'
,
trigger
:
'change'
}],
taskCount
:
[{
required
:
true
,
message
:
'请输入任务数'
,
trigger
:
'change'
}],
taskCount
:
[{
required
:
true
,
message
:
'请输入任务数'
,
trigger
:
'change'
}],
...
@@ -345,12 +347,14 @@ export default {
...
@@ -345,12 +347,14 @@ export default {
},
},
// 上传excel
// 上传excel
uploadFile
(
e
)
{
uploadFile
(
e
)
{
this
.
fileLoading
=
true
const
file
=
e
.
srcElement
.
files
[
0
]
const
file
=
e
.
srcElement
.
files
[
0
]
let
AllImgExt
=
'.xlsx'
//文件格式判断
let
AllImgExt
=
'.xlsx'
//文件格式判断
let
extName
=
file
.
name
.
substring
(
file
.
name
.
lastIndexOf
(
'.'
)).
toLowerCase
()
let
extName
=
file
.
name
.
substring
(
file
.
name
.
lastIndexOf
(
'.'
)).
toLowerCase
()
if
(
AllImgExt
!==
extName
)
{
if
(
AllImgExt
!==
extName
)
{
this
.
$message
.
error
(
'文件格式不正确'
)
this
.
$message
.
error
(
'文件格式不正确'
)
this
.
$refs
.
file
.
value
=
''
this
.
$refs
.
file
.
value
=
''
this
.
fileLoading
=
false
return
false
return
false
}
}
this
.
uploadFormObj
.
fileName
=
file
.
name
this
.
uploadFormObj
.
fileName
=
file
.
name
...
@@ -377,6 +381,7 @@ export default {
...
@@ -377,6 +381,7 @@ export default {
})
})
.
finally
(
end
=>
{
.
finally
(
end
=>
{
this
.
$refs
.
file
.
value
=
''
this
.
$refs
.
file
.
value
=
''
this
.
fileLoading
=
false
})
})
}
}
},
},
...
@@ -434,6 +439,7 @@ export default {
...
@@ -434,6 +439,7 @@ export default {
},
},
handleClose
()
{
handleClose
()
{
this
.
isVisible
=
false
this
.
isVisible
=
false
this
.
fileLoading
=
false
this
.
uploadFormObj
=
{
this
.
uploadFormObj
=
{
id
:
''
,
id
:
''
,
fileUrl
:
''
,
fileUrl
:
''
,
...
@@ -459,6 +465,21 @@ export default {
...
@@ -459,6 +465,21 @@ export default {
/
deep
/
.task-input
{
/
deep
/
.task-input
{
width
:
284px
;
width
:
284px
;
}
}
.loading-img
{
width
:
24px
;
height
:
24px
;
vertical-align
:
middle
;
margin-left
:
12px
;
animation
:
rotate
2s
linear
infinite
;
}
@keyframes
rotate
{
from
{
transform
:
rotate
(
0deg
);
/* 动画开始时的旋转角度 */
}
to
{
transform
:
rotate
(
360deg
);
/* 动画结束时的旋转角度 */
}
}
.file-wrap
{
.file-wrap
{
margin
:
8px
0
0
154px
;
margin
:
8px
0
0
154px
;
display
:
flex
;
display
:
flex
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment