Compare commits
No commits in common. "80ac4a6e1c938a8593e62d55fbfddb0153cc1def" and "1987783fdaba481e08837221fc5296b6d66e408f" have entirely different histories.
80ac4a6e1c
...
1987783fda
|
@ -163,7 +163,6 @@ import QuestToPPTist from '@/views/classTask/newClassTaskAssign/questToPPTist/in
|
||||||
import MaterialDialog from './MaterialDialog.vue'
|
import MaterialDialog from './MaterialDialog.vue'
|
||||||
import { PPTApi } from '../../../api'
|
import { PPTApi } from '../../../api'
|
||||||
import TextCreateImg from '@/components/ai-kolors/index.vue'
|
import TextCreateImg from '@/components/ai-kolors/index.vue'
|
||||||
import { toPng, toJpeg } from 'html-to-image' // 引入html-to-image库
|
|
||||||
|
|
||||||
const mainStore = useMainStore()
|
const mainStore = useMainStore()
|
||||||
const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore)
|
const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore)
|
||||||
|
@ -208,10 +207,8 @@ const insertImageElement = (files: FileList) => {
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
const onhtml2canvas = async (html: HTMLElement) => {
|
const onhtml2canvas = (imgbs64: string) => {
|
||||||
//createImageElement(imgbs64);
|
createImageElement(imgbs64)
|
||||||
const ele = await toPng(html)
|
|
||||||
createImageElement(ele);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const shapePoolVisible = ref(false)
|
const shapePoolVisible = ref(false)
|
||||||
|
|
|
@ -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,16 +453,13 @@ 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);
|
||||||
if (targetElement) {
|
html2canvas(targetElement).then(canvas => {
|
||||||
emit('addQuizImgBs64', targetElement);
|
// 将canvas转换为图像URL
|
||||||
}
|
const screenshotUrl = canvas.toDataURL('image/png');
|
||||||
// html2canvas(targetElement).then(canvas => {
|
// 在这里可以将截图保存到本地或上传到服务器
|
||||||
// // 将canvas转换为图像URL
|
// console.log(screenshotUrl);
|
||||||
// const screenshotUrl = canvas.toDataURL('image/png');
|
emit('addQuizImgBs64', screenshotUrl);
|
||||||
// // 在这里可以将截图保存到本地或上传到服务器
|
});
|
||||||
// // console.log(screenshotUrl);
|
|
||||||
// emit('addQuizImgBs64', screenshotUrl);
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 防抖
|
// 防抖
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Search } from '@element-plus/icons-vue'
|
import { Search } from '@element-plus/icons-vue'
|
||||||
//import html2canvas from 'html2canvas';
|
import html2canvas from 'html2canvas';
|
||||||
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
|
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
|
||||||
|
|
||||||
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'
|
||||||
|
@ -439,16 +439,13 @@ const getPaginationList = ( page, limit ) => {
|
||||||
*/
|
*/
|
||||||
const captureScreenshot = (id) => {
|
const captureScreenshot = (id) => {
|
||||||
const targetElement = document.getElementById('screenshot-target-' + id);
|
const targetElement = document.getElementById('screenshot-target-' + id);
|
||||||
if (targetElement) {
|
html2canvas(targetElement).then(canvas => {
|
||||||
emit('addQuizImgBs64', targetElement);
|
// 将canvas转换为图像URL
|
||||||
}
|
const screenshotUrl = canvas.toDataURL('image/png');
|
||||||
// html2canvas(targetElement).then(canvas => {
|
// 在这里可以将截图保存到本地或上传到服务器
|
||||||
// // 将canvas转换为图像URL
|
// console.log(screenshotUrl);
|
||||||
// const screenshotUrl = canvas.toDataURL('image/png');
|
emit('addQuizImgBs64', screenshotUrl);
|
||||||
// // 在这里可以将截图保存到本地或上传到服务器
|
});
|
||||||
// // console.log(screenshotUrl);
|
|
||||||
// emit('addQuizImgBs64', screenshotUrl);
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue