更换贺报下载的方法35

This commit is contained in:
xuxingjun
2025-01-02 09:33:08 +08:00
parent 60471f2eec
commit b2bec98056

View File

@@ -121,7 +121,7 @@ export default {
return false return false
}, },
async captureAndProcessImage(domElement) { async captureAndProcessImage(domElement) {
// try { try {
// 获取 DOM 元素 // 获取 DOM 元素
// let domElement = this.$refs.xingdownLoad; // let domElement = this.$refs.xingdownLoad;
// 使用 html2canvas 捕获图像,并等待其完成 // 使用 html2canvas 捕获图像,并等待其完成
@@ -150,26 +150,27 @@ export default {
// 调用 base64Excel 函数,并等待其完成 // 调用 base64Excel 函数,并等待其完成
const res = await base64Excel({ base64Img: base64String }); const res = await base64Excel({ base64Img: base64String });
window.location.href = res.path
// window.location.href = res.path
// 检查结果,并处理下载逻辑 // 检查结果,并处理下载逻辑
// if (res.result === '0') { if (res.result === '0') {
// console.log(5555); console.log(5555);
// console.log(res.path + '?t=' + Date.now()); console.log(res.path + '?t=' + Date.now());
// console.log(EWebBridge); console.log(EWebBridge);
// EWebBridge.webCallAppInJs('download', { EWebBridge.webCallAppInJs('download', {
// name: '业绩贺报.png', name: '业绩贺报.png',
// url: res.path, url: res.path,
// }) })
// // .then(() => { // .then(() => {
// // console.log('下载完成') // console.log('下载完成')
// // }).catch(() => { // }).catch(() => {
// // // this.$toast.fail('图片下载失败,请重新下载!') // // this.$toast.fail('图片下载失败,请重新下载!')
// // }) // })
// } }
// } catch (error) { } catch (error) {
// // 处理整个过程中的任何错误 // 处理整个过程中的任何错误
// console.error('Error capturing or processing the image:', error); console.error('Error capturing or processing the image:', error);
// } }
}, },
close() { close() {
console.log(15434678); console.log(15434678);