Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
memberTag-web
Overview
Overview
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
memberTag
memberTag-web
Commits
5cd974fb
Commit
5cd974fb
authored
Aug 01, 2022
by
huaying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 导出标签值
parent
03a98a9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
manual-tag-value-edit.vue
src/view/manualTag/manual-tag-value-edit.vue
+21
-21
No files found.
src/view/manualTag/manual-tag-value-edit.vue
View file @
5cd974fb
...
...
@@ -197,28 +197,28 @@ export default {
methods
:
{
// 导出标签值
importTagValue
()
{
window
.
open
(
`http://gicdev.demogic.com/gic-member-tag-web/memberTag/exportMemberTag?requestProject=member-tag&tagId=
${
this
.
$route
.
query
.
tagId
}
&tagName=
${
this
.
$route
.
query
.
tagName
}
`
);
//
window.open(`http://gicdev.demogic.com/gic-member-tag-web/memberTag/exportMemberTag?requestProject=member-tag&tagId=${this.$route.query.tagId}&tagName=${this.$route.query.tagName}`);
// return
//
const paras = {
//
tagId: this.$route.query.tagId,
//
tagName: this.$route.query.tagName
//
}
//
getRequest('/memberTag/exportMemberTag', paras).then(res=>{
//
if(res.status == '200') {
//
let blob = new Blob([res.data], {
//
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
//
});
//
// 3.创建一个临时的url指向blob对象
//
let objectUrl = window.URL.createObjectURL(blob);
//
// 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
//
let a = document.createElement("a");
//
a.setAttribute("href", objectUrl);
//
a.setAttribute("download", `${this.$route.query.tagName}-${new Date().toLocaleDateString()}`);
//
a.click();
//
// 5.释放这个临时的对象url
//
window.URL.revokeObjectURL(objectUrl);
//
}
//
})
const
paras
=
{
tagId
:
this
.
$route
.
query
.
tagId
,
tagName
:
this
.
$route
.
query
.
tagName
}
getRequest
(
'/memberTag/exportMemberTag'
,
paras
).
then
(
res
=>
{
if
(
res
.
status
==
'200'
)
{
let
blob
=
new
Blob
([
res
.
data
],
{
type
:
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
,
});
// 3.创建一个临时的url指向blob对象
let
objectUrl
=
window
.
URL
.
createObjectURL
(
blob
);
// 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
let
a
=
document
.
createElement
(
"a"
);
a
.
setAttribute
(
"href"
,
objectUrl
);
a
.
setAttribute
(
"download"
,
`
${
this
.
$route
.
query
.
tagName
}
-
${
new
Date
().
toLocaleDateString
()}
`
);
a
.
click
();
// 5.释放这个临时的对象url
window
.
URL
.
revokeObjectURL
(
objectUrl
);
}
})
},
// 添加和编辑标签值
...
...
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