ppts习题插入:个人题库 习题截图放到ppts里面转换

This commit is contained in:
白了个白 2024-12-10 10:24:30 +08:00
parent b7f11c5338
commit 122487cf8b
1 changed files with 11 additions and 8 deletions

View File

@ -118,7 +118,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'
@ -453,13 +453,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);
// });
} }
// //