Commit 5cd974fb by huaying

fix: 导出标签值

parent 03a98a9b
......@@ -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);
}
})
},
// 添加和编辑标签值
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment