前端
This commit is contained in:
parent
0f44748599
commit
2b7894cdc0
@ -22,6 +22,7 @@ export function addCode(data) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/business/tag/tagCode',
|
url: '/business/tag/tagCode',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
responseType: 'blob', // 表明返回服务器返回的数据类型
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -206,21 +206,22 @@ export default {
|
|||||||
updateCode(this.form).then(response => {
|
updateCode(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
||||||
const url = window.URL.createObjectURL(blob);
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = url;
|
|
||||||
|
|
||||||
// 设置下载文件的名称
|
|
||||||
link.setAttribute('download', 'exportedFile.xlsx');
|
|
||||||
|
|
||||||
// 模拟点击链接进行下载
|
|
||||||
link.click();
|
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addCode(this.form).then(response => {
|
addCode(this.form).then(response => {
|
||||||
|
|
||||||
|
const blob = new Blob([response], { type: 'application/zip' });
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
|
||||||
|
// 设置下载文件的名称
|
||||||
|
link.setAttribute('download', '1');
|
||||||
|
|
||||||
|
// 模拟点击链接进行下载
|
||||||
|
link.click();
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
Loading…
Reference in New Issue
Block a user