ppts习题插入:个人题库 习题截图放到ppts里面转换
This commit is contained in:
parent
b7f11c5338
commit
122487cf8b
|
@ -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) {
|
||||||
// 将canvas转换为图像URL
|
emit('addQuizImgBs64', targetElement);
|
||||||
const screenshotUrl = canvas.toDataURL('image/png');
|
}
|
||||||
// 在这里可以将截图保存到本地或上传到服务器
|
// html2canvas(targetElement).then(canvas => {
|
||||||
// console.log(screenshotUrl);
|
// // 将canvas转换为图像URL
|
||||||
emit('addQuizImgBs64', screenshotUrl);
|
// const screenshotUrl = canvas.toDataURL('image/png');
|
||||||
});
|
// // 在这里可以将截图保存到本地或上传到服务器
|
||||||
|
// // console.log(screenshotUrl);
|
||||||
|
// emit('addQuizImgBs64', screenshotUrl);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
// 防抖
|
// 防抖
|
||||||
|
|
Loading…
Reference in New Issue