Merge branch 'main' into zouyf_dev

This commit is contained in:
“zouyf” 2024-12-10 10:40:07 +08:00
commit c79911cc99
1 changed files with 11 additions and 8 deletions

View File

@ -119,7 +119,7 @@
import { Search } from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
import html2canvas from 'html2canvas'; // import html2canvas from 'html2canvas';
import { listEntpcoursework, listEntpcourseworkLocal } from '@/api/education/entpCourseWork' import { listEntpcoursework, listEntpcourseworkLocal } from '@/api/education/entpCourseWork'
import { listEvaluationclue } from '@/api/classTask' import { listEvaluationclue } from '@/api/classTask'
@ -458,13 +458,16 @@ const handleDelete = async(item, index) => {
*/ */
const captureScreenshot = (id) => { const captureScreenshot = (id) => {
const targetElement = document.getElementById('screenshot-target-' + id); const targetElement = document.getElementById('screenshot-target-' + id);
html2canvas(targetElement).then(canvas => { if (targetElement) {
// canvasURL emit('addQuizImgBs64', targetElement);
const screenshotUrl = canvas.toDataURL('image/png'); }
// // html2canvas(targetElement).then(canvas => {
// console.log(screenshotUrl); // // canvasURL
emit('addQuizImgBs64', screenshotUrl); // const screenshotUrl = canvas.toDataURL('image/png');
}); // //
// // console.log(screenshotUrl);
// emit('addQuizImgBs64', screenshotUrl);
// });
} }
// //