From 122487cf8bf26dbd11dd28741a9e7668a990ba97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Tue, 10 Dec 2024 10:24:30 +0800 Subject: [PATCH] =?UTF-8?q?ppts=E4=B9=A0=E9=A2=98=E6=8F=92=E5=85=A5?= =?UTF-8?q?=EF=BC=9A=E4=B8=AA=E4=BA=BA=E9=A2=98=E5=BA=93=20=E4=B9=A0?= =?UTF-8?q?=E9=A2=98=E6=88=AA=E5=9B=BE=E6=94=BE=E5=88=B0ppts=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newClassTaskAssign/myQuestion/index.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue index 2495908..b6a233a 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue @@ -118,7 +118,7 @@ import { Search } from '@element-plus/icons-vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { useRouter, useRoute } from 'vue-router' -import html2canvas from 'html2canvas'; +// import html2canvas from 'html2canvas'; import { listEntpcoursework, listEntpcourseworkLocal } from '@/api/education/entpCourseWork' import { listEvaluationclue } from '@/api/classTask' @@ -453,13 +453,16 @@ const handleDelete = async(item, index) => { */ const captureScreenshot = (id) => { const targetElement = document.getElementById('screenshot-target-' + id); - html2canvas(targetElement).then(canvas => { - // 将canvas转换为图像URL - const screenshotUrl = canvas.toDataURL('image/png'); - // 在这里可以将截图保存到本地或上传到服务器 - // console.log(screenshotUrl); - emit('addQuizImgBs64', screenshotUrl); - }); + if (targetElement) { + emit('addQuizImgBs64', targetElement); + } + // html2canvas(targetElement).then(canvas => { + // // 将canvas转换为图像URL + // const screenshotUrl = canvas.toDataURL('image/png'); + // // 在这里可以将截图保存到本地或上传到服务器 + // // console.log(screenshotUrl); + // emit('addQuizImgBs64', screenshotUrl); + // }); } // 防抖