This commit is contained in:
parent
23c397e18a
commit
d07dd4455c
|
@ -185,6 +185,7 @@ const applyCanvasPresetScale = (value: number) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
createTextElement,
|
||||||
createImageElement,
|
createImageElement,
|
||||||
createChartElement,
|
createChartElement,
|
||||||
createTableElement,
|
createTableElement,
|
||||||
|
@ -200,7 +201,14 @@ const insertImageElement = (files: FileList) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const onhtml2canvas = (imgbs64: string) => {
|
const onhtml2canvas = (imgbs64: string) => {
|
||||||
createImageElement(imgbs64)
|
//createImageElement(imgbs64)
|
||||||
|
console.log('imgbs64->',imgbs64)
|
||||||
|
createTextElement({
|
||||||
|
left: 200,
|
||||||
|
top: 200,
|
||||||
|
width: 500,
|
||||||
|
height: 500,
|
||||||
|
}, { content: imgbs64 })
|
||||||
}
|
}
|
||||||
|
|
||||||
const shapePoolVisible = ref(false)
|
const shapePoolVisible = ref(false)
|
||||||
|
@ -416,3 +424,8 @@ const imgVisible = ref(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style>
|
||||||
|
::v-deep {
|
||||||
|
@import "@/assets/styles/JYStyle.css";
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -439,6 +439,9 @@ const getPaginationList = ( page, limit ) => {
|
||||||
*/
|
*/
|
||||||
const captureScreenshot = (id) => {
|
const captureScreenshot = (id) => {
|
||||||
const targetElement = document.getElementById('screenshot-target-' + id);
|
const targetElement = document.getElementById('screenshot-target-' + id);
|
||||||
|
emit('addQuizImgBs64', targetElement.outerHTML);
|
||||||
|
return;
|
||||||
|
|
||||||
html2canvas(targetElement).then(canvas => {
|
html2canvas(targetElement).then(canvas => {
|
||||||
// 将canvas转换为图像URL
|
// 将canvas转换为图像URL
|
||||||
const screenshotUrl = canvas.toDataURL('image/png');
|
const screenshotUrl = canvas.toDataURL('image/png');
|
||||||
|
|
Loading…
Reference in New Issue