|
@@ -25,7 +25,7 @@ import {
|
|
|
tableCoverHeight,
|
|
|
overviewData,
|
|
|
} from "../../store.ts";
|
|
|
-import { nextTick, onUnmounted } from "vue";
|
|
|
+import { nextTick, onUnmounted, reactive } from "vue";
|
|
|
import { DataGroupId } from "@/constant/index.ts";
|
|
|
import { Group } from "konva/lib/Group";
|
|
|
import { Mode } from "@/constant/mode.ts";
|
|
@@ -103,17 +103,16 @@ const setViewToTableCover = async () => {
|
|
|
|
|
|
const pop = draw.mode.push(Mode.readonly);
|
|
|
const rect = getRect();
|
|
|
- const rectScale = (rect.width || 1080) / (rect.height || 850);
|
|
|
+ let width = rect.width;
|
|
|
+ let height = rect.height;
|
|
|
+ const rectScale = width / height;
|
|
|
const tableCoverScale = tableCoverWidth / tableCoverHeight;
|
|
|
const padding = 70;
|
|
|
|
|
|
- let width: number, height: number;
|
|
|
if (rectScale > tableCoverScale) {
|
|
|
- width = 1080;
|
|
|
- height = width / rectScale;
|
|
|
+ height = width / tableCoverScale;
|
|
|
} else {
|
|
|
- height = 850;
|
|
|
- width = rectScale * height;
|
|
|
+ width = tableCoverScale * height;
|
|
|
}
|
|
|
if (width < padding * 2) {
|
|
|
width += padding * 2;
|