diff --git a/package.json b/package.json
index 5034c80..0f251bf 100644
--- a/package.json
+++ b/package.json
@@ -57,6 +57,7 @@
"file-saver": "^2.0.5",
"hfmath": "^0.0.2",
"html-to-image": "^1.11.11",
+ "html2canvas": "^1.4.1",
"im_electron_sdk": "^8.0.5904",
"js-cookie": "^3.0.5",
"jsencrypt": "^3.3.2",
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 749e1ab..a0d73aa 100644
--- a/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue
+++ b/src/renderer/src/AixPPTist/src/views/Editor/CanvasTool/index.vue
@@ -81,7 +81,7 @@
-
+
@@ -116,9 +116,10 @@
v-model:visible="classWorkTaskVisible"
:width="880"
>
- { createLatexElement(data); classWorkTaskVisible = false }"
+ @update="data => { onhtml2canvas(data); classWorkTaskVisible = false }"
/>
@@ -147,7 +148,7 @@ import Modal from '../../../components/Modal.vue'
import Divider from '../../../components/Divider.vue'
import Popover from '../../../components/Popover.vue'
import PopoverMenuItem from '../../../components/PopoverMenuItem.vue'
-import SearchQuestion from '@/views/classTask/newClassTaskAssign/searchQuestion/index.vue'
+import QuestToPPTist from '@/views/classTask/newClassTaskAssign/questToPPTist/index.vue'
const mainStore = useMainStore()
const { creatingElement, creatingCustomShape, showSelectPanel, showSearchPanel, showNotesPanel } = storeToRefs(mainStore)
@@ -185,6 +186,10 @@ const insertImageElement = (files: FileList) => {
getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))
}
+const onhtml2canvas = (imgbs64: string) => {
+ createImageElement(imgbs64)
+}
+
const shapePoolVisible = ref(false)
const linePoolVisible = ref(false)
const chartPoolVisible = ref(false)
@@ -357,6 +362,9 @@ const toggleNotesPanel = () => {
font-size: 13px;
}
}
+.class-work-task-modal{
+ height: 80vh;
+}
@media screen and (width <= 1200px) {
.right-handler .text {
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
index e605b51..23970f4 100644
--- a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue
@@ -40,7 +40,7 @@
查找
- 添加习题
+ 添加习题
@@ -58,9 +58,9 @@
-
-
-
+
+
+
{{ scope.row.entpname }} {{ scope.row.editusername }}
{{ scope.row.worktag }}
@@ -70,7 +70,8 @@
-
+
选取该题
+
添加
纠错
@@ -117,6 +118,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 { listEntpcoursework, listEntpcourseworkLocal } from '@/api/education/entpCourseWork'
import { listEvaluationclue } from '@/api/classTask'
@@ -136,7 +138,7 @@ const router = useRouter()
// 定义要发送的emit事件
-const emit = defineEmits(['addQuiz'])
+let emit = defineEmits(['addQuiz', 'addQuizImgBs64'])
const { proxy } = getCurrentInstance()
const userStore = useUserStore().user
const {
@@ -150,6 +152,10 @@ const props = defineProps({
type: Object,
default: () => ({})
},
+ isHtml2canvas: {// 是否截屏
+ type: Boolean,
+ default: () => false
+ },
})
const knowledgePointProps = ref({value: 'thirdId', label: 'title'});
@@ -440,6 +446,22 @@ const handleDelete = async(item, index) => {
// ElMessage('试题已经存在')
// }
};
+
+/**
+ * 把该题区域id 获取为截屏区域
+ * @param id 试题id
+ */
+ const captureScreenshot = (id) => {
+ const targetElement = document.getElementById('screenshot-target-' + id);
+ html2canvas(targetElement).then(canvas => {
+ // 将canvas转换为图像URL
+ const screenshotUrl = canvas.toDataURL('image/png');
+ // 在这里可以将截图保存到本地或上传到服务器
+ // console.log(screenshotUrl);
+ emit('addQuizImgBs64', screenshotUrl);
+ });
+}
+
// 防抖
const debounceQueryData = debounce(() => {
console.log("防抖 加载数据中...")
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue
new file mode 100644
index 0000000..26be2e9
--- /dev/null
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/questToPPTist/index.vue
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
index b24c080..d09d913 100644
--- a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue
@@ -71,9 +71,9 @@
-
-
-
+
+
+
{{ scope.row.entpname }} {{ scope.row.editusername }}
{{ scope.row.worktag }}
@@ -83,7 +83,8 @@
- 添加
+ 选取该题
+ 添加
@@ -104,7 +105,7 @@