@@ -145,7 +145,7 @@
-
@@ -309,11 +309,11 @@ const props = defineProps({
default: true
},
height: {
- type: Number,
+ type: [Number,String],
default: 700,
},
width: {
- type: Number,
+ type: [Number,String],
default: 1000,
},
data: {
@@ -685,6 +685,20 @@ const getCanvasBase64 = async () =>{
return base64
}
+const getCanvasBlob = async () =>{
+ return await app.exportImage({
+ type: 'image/jpeg',
+ renderBg: exportRenderBackground.value,
+ paddingX: exportImagePaddingX.value,
+ paddingY: exportImagePaddingY.value,
+ onlySelected: exportOnlySelected.value,
+ useBlob: true,
+ backgroundColor: '#ffffff'
+ })
+}
+
+
+
watch(() => props.data, (newVal) => {
if (newVal) {
setCanvasData(newVal)
@@ -773,7 +787,8 @@ defineExpose({
showFit,
getCanvasJson,
getCanvasBase64,
- setCanvasData
+ setCanvasData,
+ getCanvasBlob
})
@@ -895,7 +910,7 @@ ol {
font-size: 14px;
color: #000;
- :deep(.jsontree_tree) {
+ /deep/ .jsontree_tree {
font-family: 'Trebuchet MS', Arial, sans-serif !important;
}
}
diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue
index 910de4a..b90edd4 100644
--- a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue
+++ b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue
@@ -9,11 +9,11 @@
设计新作业