Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
yn-science-front
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
徐俊
yn-science-front
Commits
62e338b1
Commit
62e338b1
authored
Feb 18, 2025
by
徐俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xujun
parent
8819516f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
projectView.vue
src/views/report/project/components/projectView.vue
+30
-3
No files found.
src/views/report/project/components/projectView.vue
View file @
62e338b1
<
template
>
<
template
>
<div
class=
"app-content layoutEmbedded"
style=
"height: 76vh;overflow: auto;"
>
<div
class=
"app-content layoutEmbedded"
style=
"height: 76vh;overflow: auto;"
>
<a-spin
:spinning=
"loading"
style=
"width: 100%;height: 100%;"
>
<a-spin
:spinning=
"loading"
style=
"width: 100%;height: 100%;"
>
...
@@ -165,8 +164,36 @@ export default {
...
@@ -165,8 +164,36 @@ export default {
})
})
},
},
onProjectExport
()
{
onProjectExport
()
{
this
.
$api
.
project
.
projectExport
({
id
:
this
.
value
}).
then
((
res
)
=>
{
this
.
loading
=
true
this
.
$message
.
success
(
data
.
msg
)
this
.
$api
.
project
.
projectExport
({
id
:
this
.
value
},
{
responseType
:
'blob'
,
headers
:
{
'Accept'
:
'application/pdf'
}
}).
then
((
res
)
=>
{
const
contentType
=
res
.
headers
[
'content-type'
]
if
(
contentType
&&
contentType
.
includes
(
'application/pdf'
))
{
let
blob
=
new
Blob
([
res
.
data
],
{
type
:
'application/pdf'
});
const
fileName
=
this
.
formData
.
projName
+
'.pdf'
;
let
downloadElement
=
document
.
createElement
(
'a'
)
let
href
=
window
.
URL
.
createObjectURL
(
blob
);
downloadElement
.
href
=
href
;
downloadElement
.
download
=
fileName
;
document
.
body
.
appendChild
(
downloadElement
);
downloadElement
.
click
();
document
.
body
.
removeChild
(
downloadElement
);
window
.
URL
.
revokeObjectURL
(
href
);
this
.
$message
.
success
(
'导出成功'
)
}
else
{
this
.
$message
.
error
(
'导出失败:返回格式错误'
)
}
this
.
loading
=
false
}).
catch
((
error
)
=>
{
console
.
error
(
'导出错误:'
,
error
)
this
.
$message
.
error
(
'导出失败,请稍后重试'
)
this
.
loading
=
false
})
})
},
},
callback
(
key
)
{
callback
(
key
)
{
...
...
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