Commit d1c42c47 by linjinhong

修改裁剪问题

parent 4fe89b0a
......@@ -78,11 +78,13 @@ export default {
{ headers: { "jwt-token": token } }
);
let files = [];
console.log(81, data);
if (data.code === 200) {
files = data.data;
files = files.map((el) => {
return { url: `${fileEnv}${el}` };
// return { url: `${el}` };
});
if (req.body[1] === 1) {
......@@ -139,7 +141,7 @@ export default {
res.json({ code: 500, msg: err });
}
},
commitApply: async (req, res) => {},
commitApply: async () => {},
completeDelivery: async (req, res) => {
const token = req.headers["jwt-token"];
try {
......@@ -272,7 +274,7 @@ export default {
console.log(249, body);
toSend(body)
.then((r) => {
.then(() => {
res.send({ code: 200, msg: "操作成功" });
})
.catch((err) => {
......
......@@ -257,12 +257,21 @@ export const toSend = (body) => {
);
resolve("操作成功");
} else {
reject("打印机参数错误");
const errorDetails = `打印命令失败: ${err2.message}`;
return reject(`打印机错误: ${errorDetails}`);
}
}
);
} else {
reject("生成arxp文件失败");
const errorCode = err.code || "UNKNOWN_ERROR";
const errorDetails = [
`生成命令失败: ${body.cmd}`,
`错误代码: ${errorCode}`,
`错误信息: ${err.message}`,
`标准错误输出: ${stderr}`,
].join("\n");
return reject(errorDetails);
}
}
);
......
......@@ -350,7 +350,10 @@ export default {
if (imageResList && imageResList.length) {
let obj = {
type: "sendFile",
value: imageResList,
value: imageResList.map((el, index) => {
el.designId = el.designId || index;
return el;
}),
};
if (
this.detail.mssWidth &&
......@@ -411,7 +414,10 @@ export default {
console.log(260, res.data);
let obj = {
type: "sendFile",
value: newImgList,
value: newImgList.map((el, index) => {
el.designId = el.designId || index;
return el;
}),
};
if (
this.detail.mssWidth &&
......
......@@ -780,6 +780,8 @@ export default {
async cutImgFn() {
this.checkList = JSON.parse(JSON.stringify(this.selectImgList));
try {
console.log("checkList", this.checkList);
const processQueue = await Promise.all(
this.checkList.map(async (el) => {
try {
......@@ -802,10 +804,12 @@ export default {
}
})
);
console.log("processQueue", processQueue);
// 等待所有异步操作完成
await new Promise((resolve) => setTimeout(resolve, 100));
const newMap = new Map(processQueue.map((el) => [el.designId, el]));
console.log("newMap", newMap);
this.selectImgList.forEach((el) => {
if (newMap.has(el.designId)) {
el.fileName = newMap.get(el.designId).fileName;
......
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