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
1525bd8b
Commit
1525bd8b
authored
Nov 29, 2023
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化下载zip方法新增遮罩层
parent
b8e2eeaa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
download.js
ruoyi-ui/src/plugins/download.js
+8
-1
No files found.
ruoyi-ui/src/plugins/download.js
View file @
1525bd8b
import
axios
from
'axios'
import
{
Message
}
from
'element-ui'
import
{
Loading
,
Message
}
from
'element-ui'
import
{
saveAs
}
from
'file-saver'
import
{
getToken
}
from
'@/utils/auth'
import
errorCode
from
'@/utils/errorCode'
import
{
blobValidate
}
from
"@/utils/ruoyi"
;
const
baseURL
=
process
.
env
.
VUE_APP_BASE_API
let
downloadLoadingInstance
;
export
default
{
name
(
name
,
isDelete
=
true
)
{
...
...
@@ -44,6 +45,7 @@ export default {
},
zip
(
url
,
name
)
{
var
url
=
baseURL
+
url
downloadLoadingInstance
=
Loading
.
service
({
text
:
"正在下载数据,请稍候"
,
spinner
:
"el-icon-loading"
,
background
:
"rgba(0, 0, 0, 0.7)"
,
})
axios
({
method
:
'get'
,
url
:
url
,
...
...
@@ -57,6 +59,11 @@ export default {
}
else
{
this
.
printErrMsg
(
res
.
data
);
}
downloadLoadingInstance
.
close
();
}).
catch
((
r
)
=>
{
console
.
error
(
r
)
Message
.
error
(
'下载文件出现错误,请联系管理员!'
)
downloadLoadingInstance
.
close
();
})
},
saveAs
(
text
,
name
,
opts
)
{
...
...
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