This commit is contained in:
@QQNZX 2024-03-25 13:24:19 +08:00
parent 0f44748599
commit 2b7894cdc0
2 changed files with 12 additions and 10 deletions

View File

@ -22,6 +22,7 @@ export function addCode(data) {
return request({
url: '/business/tag/tagCode',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
data: data
})
}

View File

@ -206,21 +206,22 @@ export default {
updateCode(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
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();
});
} else {
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.open = false;
this.getList();