优化
部署生产环境 / 发布版本 (push) Successful in 18s Details
部署生产环境 / 编译发布 (push) Failing after 3m1s Details

This commit is contained in:
yj 2024-06-12 17:56:06 +08:00
parent cce7d4f389
commit c4f2ce2c21
1 changed files with 33 additions and 22 deletions

View File

@ -92,6 +92,7 @@
alt="" alt=""
id="picture-img" id="picture-img"
style="user-select: none" style="user-select: none"
@load="canvasLoad"
/> />
<canvas id="picture"></canvas> <canvas id="picture"></canvas>
</div> </div>
@ -740,18 +741,6 @@ onMounted(() => {
: (templateInfo.tailsList = JSON.parse(JSON.parse(item.tempData).tempData)); : (templateInfo.tailsList = JSON.parse(JSON.parse(item.tempData).tempData));
} }
}); });
nextTick(() => {
initCanvas();
navListIndex.value = templateInfo.hasPosition ? 0 : 1; //1
if (!templateInfo.hasPosition) {
//
navList.splice(0, 1);
}
setQuestionList(); //
showFabricData(); //
setStepClick(currentNavListIndex.value, false); //
setNavTitle(); //
});
} }
}); });
}); });
@ -788,6 +777,23 @@ watch(
}, },
{ deep: true } { deep: true }
); );
//
const canvasLoad = (): void => {
if (!ctx.value) {
initCanvas();
navListIndex.value = templateInfo.hasPosition ? 0 : 1; //1
if (!templateInfo.hasPosition) {
//
navList.splice(0, 1);
}
setQuestionList(); //
showFabricData(); //
setStepClick(currentNavListIndex.value, false); //
setNavTitle(); //
}
};
// //
const initCanvas = (): void => { const initCanvas = (): void => {
imgDom.value = document.getElementById("picture-img"); imgDom.value = document.getElementById("picture-img");
@ -1941,7 +1947,7 @@ const changeFabricInfo = (bool: boolean): void => {
left: fabricItem.get("customFrom").left, left: fabricItem.get("customFrom").left,
top: fabricItem.get("customFrom").top, top: fabricItem.get("customFrom").top,
width: fabricItem.get("customFrom").width, width: fabricItem.get("customFrom").width,
height: fabricItem.get("customFrom").top, height: fabricItem.get("customFrom").height,
}; };
if (bool) { if (bool) {
switch (navListIndex.value) { switch (navListIndex.value) {
@ -2844,7 +2850,7 @@ const changeData = (): any => {
...row.customFrom, ...row.customFrom,
width: row.width, width: row.width,
height: row.height - 36.16, height: row.height - 36.16,
top: row.top + 20, top: row.top + 16,
left: row.left, left: row.left,
}; };
}); });
@ -2853,7 +2859,7 @@ const changeData = (): any => {
...row.customFrom, ...row.customFrom,
width: row.width, width: row.width,
height: row.height - 36.16, height: row.height - 36.16,
top: row.top + 20, top: row.top + 16,
left: row.left, left: row.left,
}; };
}); });
@ -2862,7 +2868,7 @@ const changeData = (): any => {
...row.customFrom, ...row.customFrom,
width: row.width, width: row.width,
height: row.height - 36.16, height: row.height - 36.16,
top: row.top + 20, top: row.top + 16,
left: row.left, left: row.left,
}; };
}); });
@ -2871,7 +2877,7 @@ const changeData = (): any => {
...row.customFrom, ...row.customFrom,
width: row.width, width: row.width,
height: row.height, height: row.height,
top: row.top + 20, top: row.top + 16,
left: row.left, left: row.left,
}; };
}); });
@ -3138,14 +3144,19 @@ const save = async (isShow: boolean = false): Promise<void> => {
width: 100%; width: 100%;
overflow: auto; overflow: auto;
@mixin isPageType($number, $type) { @mixin isPageType($type) {
width: 100%; width: 100%;
height: 100%; height: 100%;
> #zoom-div { > #zoom-div {
margin: 0 auto; margin: 0 auto;
width: calc(210mm * #{$number}); @if $type == "A3" {
height: 297mm; width: 1570px;
} @else {
width: 1200px;
}
height: auto;
flex-shrink: 0; flex-shrink: 0;
position: relative; position: relative;
transform-origin: left top; transform-origin: left top;
@ -3193,11 +3204,11 @@ const save = async (isShow: boolean = false): Promise<void> => {
} }
.A4 { .A4 {
@include isPageType(1, "A4"); @include isPageType("A4");
} }
.A3 { .A3 {
@include isPageType(2, "A3"); @include isPageType("A3");
} }
} }
} }