Commit f44ac5cf by linjinhong

修复问题

parent c02602ef
[{"head_setting":{"gridShow":1,"gridValue":0,"unit":"inch","language":"cn","autoPrint":false,"gridSpacing":1},"version":"1.0.11","print_setting":{"printer":"","xy":"","byInk":2,"byInkVolume":1,"byDoublePrint":3,"bEcoMode":false,"bMaterialBlack":false,"byHighlight":5,"printNum":1,"bFastMode":false,"bUniPrint":false,"bDivide":false,"bPause":false,"byMask":3,"bTransColor":false,"byChoke":2,"minWhiteInkType":0,"bySaturation":5,"byBrightness":5,"byContrast":5,"iCyanBalance":0,"iMagentaBalance":0,"iBlackBalance":0,"iYellowBalance":0,"byMinWhite":1,"bMultiple":false},"production_no":"GCPSC250530092","print_time":"2025-05-30 14:41:29","position_unit":{"x":460.1,"rate":0.9987730061349693,"sx":0,"zIndex":0,"sh":0,"sw":0,"sy":0,"y":463.1,"w":546.1,"h":546.1,"r":0},"position_after_px":{"x":"0.2","rate":1.1247895622895623,"sx":0,"zIndex":0,"sh":0,"sw":0,"sy":0,"y":"0.2","w":"26.8","h":"30.1","r":0},"position_before_px":{"url":"D:\\work\\electron-printer\\print\\Input\\986671a8-dd05-4292-affc-5312074d3a05.png","fileName":"986671a8-dd05-4292-affc-5312074d3a05.png","rate":1.1247895622895623,"w":807.8399999999999,"zIndex":0,"x":5.080000000000041,"y":5.675000000000011,"h":908.65,"r":0},"send_api_data":{"printer":"","xy":"","byInk":2,"byInkVolume":1,"byDoublePrint":3,"bEcoMode":false,"bMaterialBlack":false,"byHighlight":5,"printNum":1,"bFastMode":false,"bUniPrint":false,"bDivide":false,"bPause":false,"byMask":3,"bTransColor":false,"byChoke":2,"minWhiteInkType":0,"bySaturation":5,"byBrightness":5,"byContrast":5,"iCyanBalance":0,"iMagentaBalance":0,"iBlackBalance":0,"iYellowBalance":0,"byMinWhite":1,"bMultiple":false,"byPlatenSize":1,"cmd":"GTXproCMD.exe print -X \"Profile\\986671a8-dd05-4292-affc-5312074d3a05.xml\" -I \"Input\\986671a8-dd05-4292-affc-5312074d3a05.png\" -A \"Output\\986671a8-dd05-4292-affc-5312074d3a05.arxp\" -S 40014501 -L 00300033 -D 0 -W 1","fileName":"986671a8-dd05-4292-affc-5312074d3a05.png","print_cmd":"GTXproCMD.exe send -A \"Output\\986671a8-dd05-4292-affc-5312074d3a05.arxp\" -P \"导出为WPS PDF"}}]
\ No newline at end of file
......@@ -2,7 +2,7 @@
"name": "JomallProductionAssistant",
"productName": "JomallProductionAssistant",
"description": "",
"version": "1.0.11",
"version": "1.0.12",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
......
......@@ -2,12 +2,12 @@ import {
downloadImage,
downloadOtherImage,
toSend,
writeProfileXml
writeProfileXml,
} from "@/server/utils";
const {
cropImageTransparentEdges,
cropTransparentEdges,
processImages
processImages,
} = require("../utils/setImage");
import axios from "axios";
import { returnLogFilePath } from "../utils/log";
......@@ -71,7 +71,7 @@ export default {
const token = req.headers["jwt-token"];
try {
let {
data
data,
} = await axios.post(
`${env}/factory/podJomallOrder/downloadByProduction`,
[req.body[0]],
......@@ -81,26 +81,26 @@ export default {
if (data.code === 200) {
files = data.data;
files = files.map(el => {
files = files.map((el) => {
return { url: `${fileEnv}${el}` };
});
if (req.body[1] === 1) {
downloadImage(files)
.then(data => {
.then((data) => {
res.json({ code: 200, data });
})
.catch(err => {
.catch((err) => {
res.json({ code: 500, msg: err });
});
} else {
downloadOtherImage(files)
.then(data => {
.then((data) => {
console.log(77, data);
res.json({ code: 200, data });
})
.catch(err => {
.catch((err) => {
res.json({ code: 500, msg: err });
});
}
......@@ -120,7 +120,7 @@ export default {
`${env}/factory/podJomallOrderProduct/getSubOrderByThirdSubOrderNumber`,
{
params: q,
headers: { "jwt-token": token }
headers: { "jwt-token": token },
}
);
res.json(data);
......@@ -144,7 +144,7 @@ export default {
const token = req.headers["jwt-token"];
try {
let {
data
data,
} = await axios.post(
`${env}/factory/podJomallOrderProduct/completeDelivery`,
req.body,
......@@ -177,7 +177,7 @@ export default {
console.log("success");
res.json({
code: 200,
msg: q.productionNo + ".zip" + "已下载到桌面"
msg: q.productionNo + ".zip" + "已下载到桌面",
});
})
.on("error", () => {
......@@ -219,8 +219,8 @@ export default {
code: 200,
data: {
fileName,
url: path.join(process.cwd(), "./print/Input/" + fileName)
}
url: path.join(process.cwd(), "./print/Input/" + fileName),
},
});
}
});
......@@ -272,19 +272,23 @@ export default {
console.log(249, body);
toSend(body)
.then(r => {
.then((r) => {
res.send({ code: 200, msg: "操作成功" });
})
.catch(err => {
.catch((err) => {
res.send({ code: 500, msg: err });
});
},
checkUpdate: async (req, res) => {
// const company = "http://10.168.31.188:8096";
console.log("version", req.query.version);
const company = "https://admin.jomalls.com";
try {
let q = `${company}/api/manage/rest/app/checkUpdate?version=${req.query.version}&businessType=production_assistant`;
let { data } = await axios.get(q);
console.log("q", q);
console.log("data", data);
if (data.data) {
q = `${company}/api/manage/rest/app/getLatest?businessType=production_assistant`;
let r = await axios.get(q);
......@@ -314,7 +318,7 @@ export default {
fs.unlinkSync(from);
res.json({ code: 200, msg: "更新成功" });
})
.catch(err => {
.catch((err) => {
res.json({ code: 500, msg: err.message });
});
});
......@@ -360,22 +364,22 @@ export default {
const p = path.join(process.cwd(), "./print/Input/");
const form = new multiparty.Form({ uploadDir: p });
form.parse(req, function(err, fields, files) {
console.log(fields, files, err);
console.log(367, fields, files, err);
if (err) {
res.send({ code: 500, err });
} else {
let list = [];
files.files.forEach(file => {
files.files.forEach((file) => {
let fileName = uuid.v4() + ".png";
fs.renameSync(file.path, path.join(p, fileName));
list.push({
fileName,
url: path.join(process.cwd(), "./print/Input/" + fileName)
url: path.join(process.cwd(), "./print/Input/" + fileName),
});
});
res.json({
code: 200,
data: list
data: list,
});
}
});
......@@ -383,5 +387,5 @@ export default {
console.log(err);
res.json({ code: 500, msg: err });
}
}
},
};
......@@ -203,6 +203,8 @@ export default {
responseType: "blob",
})
.then((res) => {
console.log("item", item);
var url = URL.createObjectURL(res.data);
let img = new Image();
img.crossorigin = "";
......@@ -249,6 +251,8 @@ export default {
}
await Promise.all(list);
let base = canvas.toDataURL("image/png", 1);
// console.log("base", base);
canvas.remove();
imageList.push(base);
}
......@@ -313,17 +317,24 @@ export default {
let designImagesCanvasJsonList = this.detail.drParam;
if (designImagesCanvasJsonList) {
designImagesCanvasJsonList = JSON.parse(designImagesCanvasJsonList);
console.log(316, designImagesCanvasJsonList);
let imageList = await this.canvasToImage(designImagesCanvasJsonList);
// console.log(9999999, imageList);
let fm = new FormData();
for (let img of imageList) {
let filename = uuid.v4().replace("-", "") + ".png";
fm.append("files", this.base64ToFile(img, filename));
}
console.log("fm", fm);
let Sres = await this.$api.post("/saveToPng", fm);
Sres.data.forEach((item, i) => {
item.title = designImagesCanvasJsonList[i].options.title;
item.productionFile = item.url;
});
console.log("Sres", Sres);
imageResList = Sres.data;
this.imgList = [];
if (this.checked) {
......
......@@ -312,7 +312,7 @@ export default {
console.log(w, h, "w,h");
const x = relativeX / this.WHproportion;
const y = relativeY / this.WHproportion;
const r = this.imgList[0].r;
let r = this.imgList[0].r;
console.log(x, y, "x,y");
const x_mm = this.pxToUnit(x, "mm");
const y_mm = this.pxToUnit(y, "mm");
......@@ -322,6 +322,9 @@ export default {
console.log("y_mm", y_mm);
console.log("w_mm", w_mm);
console.log("h_mm", h_mm);
if (r < 0) {
r = 360 - Math.abs(r);
}
return {
x: x_mm,
y: y_mm,
......
......@@ -13,13 +13,15 @@ export default {
},
mounted() {
this.user = this.$dataStore.get("user");
this.$refs.updateDialog.checkUpdate().then(data => {
if (data) {
// 有新版本更新
this.$refs.updateDialog.open(data);
}
this.$refs.updateDialog.checkUpdate().then((data) => {
console.log(17, data);
// if (data) {
// // 有新版本更新
// this.$refs.updateDialog.open(data);
// }
});
}
},
};
</script>
......
......@@ -955,7 +955,7 @@ export default {
gradient = this.getInset(100, right, 0, left);
} else if (isOverTop && isOverBottom) {
console.log("上下");
gradient = this.getInset(100, right, 0, left);
gradient = this.getInset(top, 0, bottom, 100);
} else if (isOverRight) {
console.log("右");
gradient = this.getInset(100, right);
......@@ -1106,10 +1106,14 @@ export default {
<div
v-for="(img, i) in selectImgList"
:key="i"
class="img-item"
class="img-item showImg"
@click.stop.prevent="selectImg(img, i)"
>
<img :key="i" style="width:100%" :src="img.productionFile" />
<img
:key="i"
style="width: auto;height: 190px;"
:src="img.productionFile"
/>
<!-- <span>{{ img.designId }}</span> -->
</div>
</template>
......@@ -1632,11 +1636,15 @@ img {
box-sizing: border-box;
border-color: #409eff !important;
}
.showImg {
max-height: 194px !important;
text-align: center;
width: auto !important;
}
.img-item {
// height: 150px;
width: 180px;
max-height: 215px;
height: 215px;
overflow: hidden;
padding: 5px;
box-sizing: border-box;
......
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