Commit a9b6af24 authored by 田翔's avatar 田翔

fix: 出件称改

parent 6cb3baa5
Pipeline #89070 passed with stages
...@@ -229,7 +229,7 @@ const QRCodeDesign = (props, ref) => { ...@@ -229,7 +229,7 @@ const QRCodeDesign = (props, ref) => {
console.log('can', can.toDataURL()) console.log('can', can.toDataURL())
let a = document.createElement('a'); let a = document.createElement('a');
a.setAttribute('href', can.toDataURL()); //toDataUrl:将canvas画布信息转化为base64格式图片 a.setAttribute('href', can.toDataURL()); //toDataUrl:将canvas画布信息转化为base64格式图片
a.setAttribute('download', `${row.AccountName}_${row.DeviceCode}`); //这个是必须的,否则会报错 a.setAttribute('download', `${row.DeviceName}_${row.DeviceCode}`); //这个是必须的,否则会报错
a.setAttribute('target', '_self'); a.setAttribute('target', '_self');
a.click(); a.click();
setLoading(false) setLoading(false)
...@@ -340,7 +340,7 @@ const QRCodeDesign = (props, ref) => { ...@@ -340,7 +340,7 @@ const QRCodeDesign = (props, ref) => {
const can = await html2canvas(canvas, { allowTaint: false, useCORS: true, width: 310, scale: 2 }) const can = await html2canvas(canvas, { allowTaint: false, useCORS: true, width: 310, scale: 2 })
let img = new Image() let img = new Image()
img.src = can.toDataURL('image/png') img.src = can.toDataURL('image/png')
zip.file(`${row.AccountName}_${row.DeviceCode}.png`, dataURLtoBlob(img.src)) zip.file(`${row.DeviceName}_${row.DeviceCode}.png`, dataURLtoBlob(img.src))
} }
} }
zip.generateAsync({ type: 'blob' }).then((res) => { zip.generateAsync({ type: 'blob' }).then((res) => {
......
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