更换贺报下载的方法16

This commit is contained in:
xuxingjun
2024-12-26 15:24:29 +08:00
parent 13739a7530
commit 1bece27866

View File

@@ -45,9 +45,6 @@ export default {
downLoadJin: false,
}
},
beforeCreate() {
this.$refs.xingdownLoad = null;
},
created() {
// this.isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
// if(this.isIOS) {
@@ -59,7 +56,7 @@ export default {
this.getList()
},
beforeDestroy(){
this.$refs.xingdownLoad = null;
this.$refs.xingdownLoad.parentNode.removeChild(this.$refs.xingdownLoad);
},
methods: {
getList() {
@@ -134,12 +131,13 @@ export default {
scale: 1,
dpi: 300
});
domElement = null
// 将画布转换为 Blob并等待其完成
const blob = await new Promise((resolve, reject) => {
canvas.toBlob(resolve, 'image/png');
console.log(3333);
});
// let arr = false
// // 将 Blob 转换为 Base64 字符串,并等待其完成
// if(arr == false) {
@@ -156,7 +154,6 @@ export default {
// 调用 base64Excel 函数,并等待其完成
const res = await base64Excel({ base64Img: base64String });
// 检查结果,并处理下载逻辑
if (res.result === '0') {
console.log(5555);
@@ -200,8 +197,9 @@ export default {
},
close() {
this.$emit('child-colse', '1')
this.$refs.xingdownLoad.parentNode.removeChild(this.$refs.xingdownLoad);
this.$emit('child-colse', '1')
}
}
}