|
|
@@ -8,7 +8,7 @@
|
|
|
>
|
|
|
<template #saves>
|
|
|
<el-button type="primary" @click="saveHandler" :disabled="draw.drawing">
|
|
|
- {{$t('sys.save')}}
|
|
|
+ {{ $t("sys.save") }}
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template #nav>
|
|
|
@@ -46,7 +46,7 @@ import { loading } from "@/example/loadding.ts";
|
|
|
import { IRect } from "konva/lib/types";
|
|
|
|
|
|
const props = defineProps<{ title: string }>();
|
|
|
-const emit = defineEmits<{ (e: "screenshot", val: boolean): void }>();
|
|
|
+const emit = defineEmits<{ (e: "screenshot", val: false | number): void }>();
|
|
|
|
|
|
const goOverview = async () => {
|
|
|
await saveHandler();
|
|
|
@@ -65,7 +65,8 @@ const goTab = (tab: TabsPaneContext) => {
|
|
|
|
|
|
const draw = useDraw();
|
|
|
const getCoverImage = (format: string): Promise<[IRect, Blob]> => {
|
|
|
- emit("screenshot", true);
|
|
|
+ const pixelRatio = 8;
|
|
|
+ emit("screenshot", pixelRatio);
|
|
|
return loading(async () => {
|
|
|
const pop = draw.mode.push(Mode.readonly);
|
|
|
const oldMat = draw.viewer.viewMat;
|
|
|
@@ -84,7 +85,7 @@ const getCoverImage = (format: string): Promise<[IRect, Blob]> => {
|
|
|
await asyncTimeout(16);
|
|
|
|
|
|
let fileBlob = await (draw.stage!.toBlob({
|
|
|
- pixelRatio: 2,
|
|
|
+ pixelRatio,
|
|
|
mimeType: format,
|
|
|
quality: 1,
|
|
|
...rect,
|
|
|
@@ -140,12 +141,12 @@ const actions = [
|
|
|
URL.revokeObjectURL(url);
|
|
|
}
|
|
|
await saveAs(fileBlob, `${filename}.${ext}`);
|
|
|
- ElMessage.success(ui18n.t('sys.actions.download.success'));
|
|
|
+ ElMessage.success(ui18n.t("sys.actions.download.success"));
|
|
|
},
|
|
|
- text: ui18n.t('sys.actions.download.name'),
|
|
|
+ text: ui18n.t("sys.actions.download.name"),
|
|
|
icon: "download",
|
|
|
},
|
|
|
- baseActions.lang
|
|
|
+ baseActions.lang,
|
|
|
],
|
|
|
];
|
|
|
|