Commit c2d059ee by linjinhong

fix:修改切换压板后图片的问题

parent 268b6f56
...@@ -443,7 +443,7 @@ export default { ...@@ -443,7 +443,7 @@ export default {
async hasDesignImagesCanvasJsonList(designImagesCanvasJsonList, bool) { async hasDesignImagesCanvasJsonList(designImagesCanvasJsonList, bool) {
let imageResList = []; let imageResList = [];
let isCustom = false;
//当adjustable有值时 直接赋值宽高 //当adjustable有值时 直接赋值宽高
if ( if (
!this.checked && !this.checked &&
...@@ -453,7 +453,7 @@ export default { ...@@ -453,7 +453,7 @@ export default {
) { ) {
designImagesCanvasJsonList = JSON.parse(designImagesCanvasJsonList); designImagesCanvasJsonList = JSON.parse(designImagesCanvasJsonList);
if (!designImagesCanvasJsonList[0].images) { if (!designImagesCanvasJsonList[0].images) {
isCustom = true; this.detail.isCustom = true;
let imageList = await this.canvasToImage(designImagesCanvasJsonList); let imageList = await this.canvasToImage(designImagesCanvasJsonList);
let fm = new FormData(); let fm = new FormData();
for (let img of imageList) { for (let img of imageList) {
...@@ -557,7 +557,6 @@ export default { ...@@ -557,7 +557,6 @@ export default {
let obj = { let obj = {
type: "sendFile", type: "sendFile",
value: [...newImgList], value: [...newImgList],
isCustom,
}; };
if ( if (
...@@ -690,7 +689,7 @@ export default { ...@@ -690,7 +689,7 @@ export default {
designImagesCanvasJsonList, designImagesCanvasJsonList,
this.desktopDevice === 3 ? (localItem ? true : false) : false, this.desktopDevice === 3 ? (localItem ? true : false) : false,
); );
this.$store.commit("setProductDetail", findByPodProductionNo.data); this.$store.commit("setProductDetail", this.detail);
ipcRenderer.send("win-subScreen", findByPodProductionNo.data); ipcRenderer.send("win-subScreen", findByPodProductionNo.data);
this.$dataStore.set("production_no", this.productionNo); this.$dataStore.set("production_no", this.productionNo);
this.productionNo = ""; this.productionNo = "";
......
...@@ -341,7 +341,10 @@ export default { ...@@ -341,7 +341,10 @@ export default {
} }
if (this.imgList?.length) { if (this.imgList?.length) {
this.getBackFile({ files: this.imgList }); this.getBackFile({
files: this.imgList,
size: this.detail.designImageSize || null,
});
} }
}, },
immediate: true, immediate: true,
...@@ -759,7 +762,9 @@ export default { ...@@ -759,7 +762,9 @@ export default {
); );
return img?.productionFile; return img?.productionFile;
}, },
getBackFile({ files, size, isCustom }, callback) { getBackFile({ files, size }, callback) {
console.log(333333333);
let that = this; let that = this;
let bw = document.getElementById("line"); let bw = document.getElementById("line");
let bh = bw.clientHeight; let bh = bw.clientHeight;
...@@ -829,9 +834,9 @@ export default { ...@@ -829,9 +834,9 @@ export default {
that.showImgSetting = true; that.showImgSetting = true;
if (this.newDesktopDevice != 3) { if (this.newDesktopDevice != 3) {
if (size && !files[i].isCut) { if (size && !files[i].isCut) {
console.log(7898, isCustom); console.log(7898, this.detail);
isCustom ? that.ev("center") : that.ev("cover"); this.detail.isCustom ? that.ev("center") : that.ev("cover");
} else { } else {
that.ev("x_center"); that.ev("x_center");
} }
...@@ -1267,7 +1272,7 @@ export default { ...@@ -1267,7 +1272,7 @@ export default {
// console.log(1297, this.newDesktopDevice); // console.log(1297, this.newDesktopDevice);
bus.$on("busEmit", (v) => { bus.$on("busEmit", (v) => {
let { type, value, size, isCustom } = v; let { type, value, size } = v;
switch (type) { switch (type) {
case "completeMessage": case "completeMessage":
...@@ -1293,19 +1298,21 @@ export default { ...@@ -1293,19 +1298,21 @@ export default {
height: this.detail.mssHeight, height: this.detail.mssHeight,
}; };
} }
if (this.selectImgIndex != -1 && this.selectImgList.length) { console.log(1296, this.detail);
this.getBackFile(
{ // if (this.selectImgIndex != -1 && this.selectImgList.length) {
files: [this.selectImgList[this.selectImgIndex]], // this.getBackFile(
size: this.detail.designImageSize || null, // {
}, // files: [this.selectImgList[this.selectImgIndex]],
() => { // size: this.detail.designImageSize || null,
this.imgHistoryList.push( // },
JSON.parse(JSON.stringify(this.imgList)), // () => {
); // this.imgHistoryList.push(
}, // JSON.parse(JSON.stringify(this.imgList)),
); // );
} // },
// );
// }
break; break;
case "index": case "index":
this.indexChange(value); this.indexChange(value);
...@@ -1353,7 +1360,6 @@ export default { ...@@ -1353,7 +1360,6 @@ export default {
{ {
files: [value[this.selectImgIndex]], files: [value[this.selectImgIndex]],
size: this.detail.designImageSize || null, size: this.detail.designImageSize || null,
isCustom,
}, },
() => { () => {
this.imgHistoryList.push( this.imgHistoryList.push(
...@@ -1819,9 +1825,9 @@ export default { ...@@ -1819,9 +1825,9 @@ export default {
> >
<b style="color: red" v-else>该生产单需要拖动设计打印</b> <b style="color: red" v-else>该生产单需要拖动设计打印</b>
</div> </div>
<div class="print-tip" v-else> <!-- <div class="print-tip" v-else>
<b style="color: red">该生产单需要拖动设计打印</b> <b style="color: red">该生产单需要拖动设计打印</b>
</div> </div> -->
</div> </div>
<img <img
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment