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() {},
methods: {
double_click(index, fn, data) {
console.log(this.tableData[index], 'data')
console.log(this.$refs['th' + index], 6)
let timestamp = 0
this.$refs['th' + index][0].addEventListener('click', () => {
const now = new Date()

View File

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