Commit 88da4bfd authored by 宁天庆's avatar 宁天庆

修改复制

parent 1ea469c2
This diff is collapsed.
This diff is collapsed.
......@@ -7142,6 +7142,7 @@ export function getScreenshotWithImg(action, options = {}) {
// ctx_newCanvas.closePath();
//获取插入图片的元素,并在canvas上进行绘制
let imagePromises = [];
if ($('#luckysheet-image-showBoxs')) {
var imgs = $('#luckysheet-image-showBoxs img');
imgs.each(function(i) {
......@@ -7150,11 +7151,21 @@ export function getScreenshotWithImg(action, options = {}) {
var top = parent.css("top").replace('px', '');
var width = parent.css("width").replace('px', '');
var height = parent.css("height").replace('px', '');
imagePromises.push(new Promise((resolve, reject) => {
var img = new Image()
img.src = $(this).attr("src");
ctx_newCanvas.drawImage(img, left, top, width, height);
img.onload = () => {
ctx_newCanvas.drawImage(img, left - (visibledatacolumn[stc - 1] || 0), top - visibledatarow[str - 1] || 0, width, height);
resolve()
}
img.onerror = () => resolve();
}));
});
}
Promise.all(imagePromises).then((d) => {
//获取统计图元素,并在canvas上进行绘制
let targetDoms = document.querySelectorAll('.luckysheet-modal-dialog.luckysheet-modal-dialog-chart.luckysheet-data-visualization-chart');
var chartCount = 0;
......@@ -7166,6 +7177,8 @@ export function getScreenshotWithImg(action, options = {}) {
action(newCanvas.get(0).toDataURL("image/png", 1));
}
}
});
}
/**
......
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