Merge branch 'FCRS-743-【需求】关于金掌桂开发机构实时出单功能和动态贺报生成的请示' into dev-new

This commit is contained in:
dong.ai
2024-10-23 17:10:12 +08:00
2 changed files with 20 additions and 9 deletions

View File

@@ -67,8 +67,6 @@ export default {
created() {}, created() {},
methods: { methods: {
double_click(index, fn, data) { double_click(index, fn, data) {
console.log(this.tableData[index], 'data')
console.log(this.$refs['th' + index], 6)
let timestamp = 0 let timestamp = 0
this.$refs['th' + index][0].addEventListener('click', () => { this.$refs['th' + index][0].addEventListener('click', () => {
const now = new Date() const now = new Date()

View File

@@ -82,19 +82,32 @@ export default {
}).then((canvas) => { }).then((canvas) => {
// 转换canvas为PNG图片并压缩 // 转换canvas为PNG图片并压缩
canvas.toBlob( canvas.toBlob(
function (blob) { (blob) => {
const a = document.createElement('a') // const a = document.createElement('a')
a.href = URL.createObjectURL(blob) // a.href = URL.createObjectURL(blob)
a.download = '业绩贺报.png' // a.download = '业绩贺报.png'
a.click() // a.click()
// let newimg = new Image() // let newimg = new Image()
// newimg.src = URL.createObjectURL(blob) // newimg.src = URL.createObjectURL(blob)
// newimg.onload = function () { // newimg.onload = function () {
// URL.revokeObjectURL(newimg.src) // URL.revokeObjectURL(newimg.src)
// callback(newimg) // callback(newimg)
// } // }
} this.blobToBase64(blob).then((base64String) => {
// 'image/png', console.log(base64String, '==')
EWebBridge.webCallAppInJs('download', {
name: '开门红方案.png',
url: base64String
})
.then(() => {
console.log('下载完成')
})
.catch(() => {
this.$toast.fail('图片下载失败,请重新下载!')
})
})
},
'image/png'
// quality // quality
) )
}) })