From 755cfc615a007631f1a15b2571c156b03d70f1ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com>
Date: Tue, 10 Dec 2024 10:39:39 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E8=AF=95=E9=A2=98=E5=88=86=E9=A1=B5?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=9B=9E=E9=A1=B6=E9=83=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../views/classTask/container/newTask/taskTypeView.vue | 4 ++--
.../classTask/newClassTaskAssign/myQuestion/index.vue | 9 +++++++--
.../newClassTaskAssign/searchQuestion/index.vue | 9 +++++++--
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue
index 0496bee..218f71c 100644
--- a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue
+++ b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue
@@ -949,11 +949,11 @@ const showExamAnalyseDrawer = (row) => {
}
const tableRef = ref();
-const getPaginationList = ( page, limit ) => {
+const getPaginationList = async ( page, limit ) => {
paginationParams.pageNum = page;
paginationParams.pageSize = limit;
//console.log(page, limit)
- handleQueryFromEntpCourseWork(0);
+ await handleQueryFromEntpCourseWork(0);
// 重置滚动条至顶部
tableRef.value.setScrollTop(0);
}
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
index 2495908..5d2664c 100644
--- a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
@@ -49,6 +49,7 @@
:data="workResource.entpCourseWorkList"
style="width: 100%; height: calc(100% - 55px);"
v-loading="pageParams.loading"
+ ref="tableRef"
>
@@ -364,11 +365,15 @@ const showExamAnalyseDrawer = (row) => {
proxy.$refs.examDetailsDrawerRef.acceptParams(activeParams);
})
}
-const getPaginationList = ( page, limit ) => {
+
+const tableRef = ref();
+const getPaginationList = async ( page, limit ) => {
paginationParams.pageNum = page;
paginationParams.pageSize = limit;
console.log(page, limit)
- handleQueryFromEntpCourseWork(0);
+ await handleQueryFromEntpCourseWork(0);
+ // 重置滚动条至顶部
+ tableRef.value.setScrollTop(0);
}
/** 单题上传弹出框----纠错修改框 */
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
index 6c418e8..9cf6b7e 100644
--- a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
@@ -62,6 +62,7 @@
:data="workResource.entpCourseWorkList"
style="width: 100%; height: calc(100% - 50px);"
v-loading="pageParams.loading"
+ ref="tableRef"
>
@@ -396,11 +397,15 @@ const showExamAnalyseDrawer = (row) => {
proxy.$refs.examDetailsDrawerRef.acceptParams(activeParams);
})
}
-const getPaginationList = ( page, limit ) => {
+
+const tableRef = ref();
+const getPaginationList = async ( page, limit ) => {
paginationParams.pageNum = page;
paginationParams.pageSize = limit;
console.log(page, limit)
- handleQueryFromEntpCourseWork(0);
+ await handleQueryFromEntpCourseWork(0);
+ // 重置滚动条至顶部
+ tableRef.value.setScrollTop(0);
}
From b47feb4a3a999903b7aa7c8dd91a56e4fbf1c6b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com>
Date: Tue, 10 Dec 2024 10:46:22 +0800
Subject: [PATCH 2/4] 1
---
.../AixPPTist/src/views/Editor/CanvasTool/index.vue | 7 ++-----
.../newClassTaskAssign/myQuestion/index.vue | 12 ++++--------
.../newClassTaskAssign/searchQuestion/index.vue | 12 ++++--------
3 files changed, 10 insertions(+), 21 deletions(-)
diff --git a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue
index d7de64d..265ecec 100644
--- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue
+++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue
@@ -162,7 +162,6 @@ import PopoverMenuItem from '../../../components/PopoverMenuItem.vue'
import QuestToPPTist from '@/views/classTask/newClassTaskAssign/questToPPTist/index.vue'
import MaterialDialog from './MaterialDialog.vue'
import TextCreateImg from '@/components/ai-kolors/index.vue'
-import { toPng, toJpeg } from 'html-to-image' // 引入html-to-image库
const mainStore = useMainStore()
const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore)
@@ -200,10 +199,8 @@ const insertImageElement = (files: FileList) => {
getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))
}
-const onhtml2canvas = async (html: HTMLElement) => {
- //createImageElement(imgbs64);
- const ele = await toPng(html)
- createImageElement(ele);
+const onhtml2canvas = async (imgbs64: String) => {
+ createImageElement(imgbs64);
}
const shapePoolVisible = ref(false)
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
index 54118ca..255d0b4 100644
--- a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
@@ -120,6 +120,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 { toPng } from 'html-to-image' // 引入html-to-image库
import { listEntpcoursework, listEntpcourseworkLocal } from '@/api/education/entpCourseWork'
import { listEvaluationclue } from '@/api/classTask'
@@ -459,15 +460,10 @@ const handleDelete = async(item, index) => {
const captureScreenshot = (id) => {
const targetElement = document.getElementById('screenshot-target-' + id);
if (targetElement) {
- emit('addQuizImgBs64', targetElement);
+ toPng(targetElement).then(canvas => {
+ emit('addQuizImgBs64', canvas);
+ });
}
- // html2canvas(targetElement).then(canvas => {
- // // 将canvas转换为图像URL
- // const screenshotUrl = canvas.toDataURL('image/png');
- // // 在这里可以将截图保存到本地或上传到服务器
- // // console.log(screenshotUrl);
- // emit('addQuizImgBs64', screenshotUrl);
- // });
}
// 防抖
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
index 9cf6b7e..e0da12e 100644
--- a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
@@ -107,6 +107,7 @@