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
750d2a21
Commit
750d2a21
authored
Feb 14, 2025
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
44
parent
69323b2f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
15 deletions
+28
-15
index.js
src/api/index.js
+3
-0
tmp-task.html
src/views/report/project/components/tmp-task.html
+0
-0
tmp.html
src/views/report/project/components/tmp.html
+0
-0
taskView.vue
src/views/report/task/components/taskView.vue
+25
-15
No files found.
src/api/index.js
View file @
750d2a21
...
...
@@ -423,6 +423,9 @@ export default {
getProjectInfoById
(
params
)
{
return
fetch
(
`/v1/science-admin/com-project/getProjectInfoById/`
,
params
)
},
export
(
params
)
{
return
fetch
(
`/v1/science-admin/com-project/export/`
,
params
)
},
save
(
params
)
{
return
fetch
(
`/v1/science-admin/com-project/save`
,
params
,
'post'
,
'json'
)
},
...
...
src/views/report/project/components/tmp-task.html
0 → 100644
View file @
750d2a21
This diff is collapsed.
Click to expand it.
src/views/report/project/components/tmp.html
0 → 100644
View file @
750d2a21
This diff is collapsed.
Click to expand it.
src/views/report/task/components/taskView.vue
View file @
750d2a21
...
...
@@ -10,7 +10,7 @@
</div>
<div
class=
"page-footer"
>
<!-- 申报项目详情 -->
<
!--
<a-button
type=
"primary"
@
click=
"onExport"
>
导出
</a-button>
--
>
<
a-button
type=
"primary"
@
click=
"onExport"
>
导出
</a-button
>
<task-info
v-model=
"formData"
:tabsData
.
sync=
"tabsData"
/>
</div>
</a-spin>
...
...
@@ -147,20 +147,30 @@ export default {
}
},
onExport
()
{
this
.
$api
.
project
.
export
({
id
:
this
.
value
}).
then
((
res
)
=>
{
let
blob
=
new
Blob
([
res
],
{
type
:
"application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=utf-8"
,
});
const
fileName
=
this
.
formData
.
projName
+
'.doc'
;
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
);
//释放blob
})
axios
({
url
:
"/v1/science-admin/com-project/export1/"
+
this
.
value
,
method
:
'GET'
,
responseType
:
"blob"
,
headers
:
{
Authorization
:
'Bearer '
+
getToken
(),
'Content-Type'
:
'application/pdf;charset=utf-8'
}
}).
then
(
response
=>
{
console
.
log
(
response
)
const
blob
=
new
Blob
([
response
.
data
],
{
type
:
'application/pdf'
});
const
url
=
window
.
URL
.
createObjectURL
(
blob
);
const
link
=
document
.
createElement
(
'a'
);
link
.
href
=
url
;
const
filename
=
response
.
headers
[
'content-disposition'
]
?
decodeURIComponent
(
response
.
headers
[
'content-disposition'
].
split
(
'filename='
)[
1
])
:
'项目报告.pdf'
;
link
.
setAttribute
(
"download"
,
filename
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
document
.
body
.
removeChild
(
link
);
window
.
URL
.
revokeObjectURL
(
url
);
}).
catch
(
error
=>
{
console
.
error
(
'下载文件出错:'
,
error
);
this
.
$message
.
error
(
'下载文件失败'
);
});
},
callback
(
key
)
{
var
index
=
parseInt
(
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