|
|
@ -7,6 +7,7 @@ import ProjectAddModel from '../components/projectAddModel' |
|
|
|
import { Model } from 'echarts'; |
|
|
|
import { login } from '../../auth/actions/auth'; |
|
|
|
import { createCanvas, loadImage, registerFont } from 'canvas' |
|
|
|
import { dataURItoBlob } from 'react-jsonschema-form/lib/utils'; |
|
|
|
|
|
|
|
|
|
|
|
const QrCode = (props) => { |
|
|
@ -91,60 +92,11 @@ const QrCode = (props) => { |
|
|
|
width: 260, height: 60, background: '#e1d4d42e', display: 'flex', |
|
|
|
justifyContent: 'center', alignItems: 'center', borderTop: '1px solid #3c383824' |
|
|
|
}}> |
|
|
|
{/* <a href={`${v.qrCode + '?filename=' + encodeURIComponent(v.name)}.png`}> */} |
|
|
|
<a href={`${v.qrCode}.png`}> |
|
|
|
<Button type="primary" onClick={() => { |
|
|
|
// const aa = (v) => {
|
|
|
|
// const img = new Image(),
|
|
|
|
// canvas = createCanvas(460, 490),
|
|
|
|
// ctx = canvas.getContext('2d')
|
|
|
|
// img.crossOrigin = 'anonymous'
|
|
|
|
// img.onload = function () {
|
|
|
|
// const w = 460, h = 490
|
|
|
|
|
|
|
|
// ctx.drawImage(img, 0, 0,460,490)
|
|
|
|
// ctx.beginPath()
|
|
|
|
// ctx.font = 'dcscsdcsd'
|
|
|
|
// ctx.fillStyle = '#000'
|
|
|
|
// ctx.fillText('5315', w, h)
|
|
|
|
// ctx.closePath()
|
|
|
|
// const save_link = document.createElement('a')
|
|
|
|
// save_link.href = canvas.toDataURl('image/png')
|
|
|
|
// save_link.download = 'dcscds.png'
|
|
|
|
// document.body.appendChild(save_link)
|
|
|
|
// save_link.click()
|
|
|
|
// save_link.remove()
|
|
|
|
// }
|
|
|
|
// img.src = v
|
|
|
|
// }
|
|
|
|
// aa(v.qrCode)
|
|
|
|
// console.log(v.qrCode.replace('/[\r\n]/g',""));
|
|
|
|
|
|
|
|
// function base64ToFile (url, name) {
|
|
|
|
|
|
|
|
// let mime = name.substring(name.lastIndexOf('.') + 1)
|
|
|
|
// let bstr = atob(url);
|
|
|
|
// let n = bstr.length;
|
|
|
|
// let u8arr = new Uint8Array(n);
|
|
|
|
|
|
|
|
// while (n--) {
|
|
|
|
// u8arr[n] = bstr.charCodeAt(n);
|
|
|
|
// }
|
|
|
|
// return new Blob([u8arr], { type: mime });
|
|
|
|
// }
|
|
|
|
|
|
|
|
// function downloadFile(url,name='15313'){
|
|
|
|
// let a=document.createElement('a');
|
|
|
|
// a.setAttribute('href',url)
|
|
|
|
// a.setAttribute('download',name)
|
|
|
|
// a.setAttribute('target','_blank')
|
|
|
|
// let b=document.createEvent('MouseEvents')
|
|
|
|
// b.initEvent('click',true,true)
|
|
|
|
// a.dispatchEvent
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
}}>下载二维码</Button> |
|
|
|
{/* </a> */} |
|
|
|
</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|