Merge remote-tracking branch 'origin/StableVersion' into develop

This commit is contained in:
X1627315083
2024-09-25 11:14:55 +08:00
12 changed files with 160 additions and 105 deletions

View File

@@ -274,7 +274,6 @@
<div>all</div>
</div>
</div>
<div class="SRExport_img">
<div class="SRExport_img_item_box" v-for="item in allExportSR" @click="selectImg(item)">
<input type="checkbox" v-model="item.checked">
@@ -326,7 +325,7 @@ export default defineComponent({
})
let showUpgradePlan = ref(false);
let canvas = reactive({});
let canvas = ref({});
// let canvasDom = ref()
let canvasWH = ref({
width: 400,
@@ -372,6 +371,7 @@ export default defineComponent({
let imgWidth = {} //这是设置画布等宽
let submitCanvasContent = null
let init = (productData) => {
showUpgradePlan.value = true;
userlikeGroupId = productData.userlikeGroupId
clearTimeout(submitCanvasContent)
@@ -379,7 +379,6 @@ export default defineComponent({
canvasWH.value.height = 100
normalCanvasState.value = []
reverseCanvasState.value = []
showUpgradePlan.value = true;
allBoardData.value.likeDesignCollectionList =
likeDesignCollectionList;
allBoardData.value[productData.key] = productData.imgList;
@@ -590,17 +589,51 @@ export default defineComponent({
position = sketchGroupingItem[sketchXyIndex.minIndex];
}
}
}
if(key == "sketchboardFiles" && sketchGroupingItem.length >2){
}else{
position.x += img.width * scaleWH + margin;
}
img.lock_rotation = true;
canvas.add(img);
oldKey = key;
// setTimeout(() => {
setCanvasImage(img,key,position.x,position.y,allItem)//设置图片
position.height = img.height * scaleWH + margin;
if (key == "sketchboardFiles") {
if (sketchGroupingItem.length <3) {
sketchGroupingItem.push(JSON.parse(JSON.stringify(position)));
}
if (sketchGroupingItem.length >2) {
let sketchXyIndex = {
maxIndex: 0,
maxNum: 0,
minNum: 999999,
minIndex: 0,
};
sketchGroupingItem.forEach(
(sketchItem,sketchIndex) => {
if (sketchItem.y + sketchItem.height < sketchXyIndex.minNum) {
sketchXyIndex.minNum = sketchItem.y + sketchItem.height
sketchXyIndex.minIndex = sketchIndex;
}
if (sketchItem.y + sketchItem.height > sketchXyIndex.maxNum) {
sketchXyIndex.maxNum = sketchItem.y + sketchItem.height
sketchXyIndex.maxIndex = sketchIndex;
}
}
);
sketchGroupingItem[sketchXyIndex.minIndex].y = sketchXyIndex.minNum
// sketchGroupingItem[sketchXyIndex.maxIndex].y = sketchXyIndex.maxNum
if (allBoardData.value[key].length == allItemIndex + 1) {
maxHeight = sketchXyIndex.maxNum
} else {
position = sketchGroupingItem[sketchXyIndex.minIndex];
}
}
}
if(key == "sketchboardFiles" && sketchGroupingItem.length >2){
}else{
position.x += img.width * scaleWH + margin;
}
let str = `${img.width} + ${scaleWH}`
img.lock_rotation = true;
oldKey = key;
resolve()
// }, 1000);
}
canvas.add(img);
},{ crossOrigin: "Anonymous" });
}
});
@@ -838,6 +871,7 @@ export default defineComponent({
let xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", url, true);
xmlhttp.responseType = "blob";
xmlhttp.withCredentials = false;
xmlhttp.onload = function () {
if (this.status == 200) {
resolve(this.response);
@@ -857,15 +891,27 @@ export default defineComponent({
// 下载文件, 并存成ArrayBuffer对象(blob)
zip.file(item.name, data, { binary: true }); // 逐个添加文件
cache[item.title] = data;
});
})
promises.push(promise);
}
Promise.all(promises)
Promise.all(promises)
.then(() => {
function downloadBlob(blob, filename) {
const link = document.createElement('a');
const url = URL.createObjectURL(blob);
link.href = url;
link.download = filename;
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(url);
document.body.removeChild(link);
}
zip.generateAsync({ type: "blob" }).then((content) => {
// 生成二进制流
FileSaver.saveAs(content, "DesignFiles"); // 利用file-saver保存文件 自定义文件名
downloadBlob(content,'DesignFiles')
// FileSaver.saveAs(content, "DesignFiles"); // 利用file-saver保存文件 自定义文件名
isShowMark.value = false;
});
setSubmit()//导出的时候保存
initAligningGuidelines(canvas,true)