Commit 9bf5f2af by linjinhong

修改已知问题

parent 2edfa954
[{"head_setting":{"gridShow":1,"gridValue":0,"unit":"inch","language":"cn","autoPrint":false,"gridSpacing":1},"version":"1.0.22","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":"GCPSC2509083421","print_time":"2025-10-08 16:18:35","position_unit":{"x":408.8,"rate":1.396341463414634,"sx":0,"zIndex":0,"sh":0,"sw":0,"sy":0,"y":458.6,"w":594.4,"h":826.7,"r":0},"position_after_px":{"x":"2.9","rate":1.4331087584215592,"sx":0,"zIndex":0,"sh":0,"sw":0,"sy":0,"y":"0.0","w":"21.2","h":"30.4","r":0},"position_before_px":{"url":"D:\\work\\electron-printer\\print4.0\\Input\\245f2d56-84c9-477b-ab0c-4a499b4f9ed9.png","fileName":"245f2d56-84c9-477b-ab0c-4a499b4f9ed9.png","rate":1.4331087584215592,"w":640.5654801880457,"zIndex":0,"x":88.71725990597713,"y":1,"h":918,"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\\245f2d56-84c9-477b-ab0c-4a499b4f9ed9.xml\" -I \"Input\\245f2d56-84c9-477b-ab0c-4a499b4f9ed9.png\" -A \"Output\\245f2d56-84c9-477b-ab0c-4a499b4f9ed9.arxp\" -S 31744546 -L 04440010 -D 0 -W 1","fileName":"245f2d56-84c9-477b-ab0c-4a499b4f9ed9.png","print_cmd":"GTXproCMD.exe send -A \"Output\\245f2d56-84c9-477b-ab0c-4a499b4f9ed9.arxp\" -P \"Brother GTX-6 FileOutput"}},{"head_setting":{"gridShow":1,"gridValue":0,"unit":"inch","language":"cn","autoPrint":false,"gridSpacing":1},"version":"1.0.22","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":"GCPSC2509182750","print_time":"2025-10-08 16:07:44","position_unit":{"x":408.8,"rate":1.396341463414634,"sx":0,"zIndex":0,"sh":0,"sw":0,"sy":0,"y":458.6,"w":594.4,"h":826.7,"r":0},"position_after_px":{"x":"4.5","rate":0.4027777777777778,"sx":0,"zIndex":0,"sh":0,"sw":0,"sy":0,"y":"11.6","w":"18.1","h":"7.3","r":0},"position_before_px":{"url":"D:\\work\\electron-printer\\print4.0\\Input\\a9c1ae48-1adb-46e5-adb0-56e32cf09645.png","fileName":"a9c1ae48-1adb-46e5-adb0-56e32cf09645.png","rate":0.4027777777777778,"w":545.3333333333333,"zIndex":0,"x":136.33333333333337,"y":350.1759259259259,"h":219.64814814814812,"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\\a9c1ae48-1adb-46e5-adb0-56e32cf09645.xml\" -I \"Input\\a9c1ae48-1adb-46e5-adb0-56e32cf09645.png\" -A \"Output\\a9c1ae48-1adb-46e5-adb0-56e32cf09645.arxp\" -S 26991089 -L 06801739 -D 0 -W 1","fileName":"a9c1ae48-1adb-46e5-adb0-56e32cf09645.png","print_cmd":"GTXproCMD.exe send -A \"Output\\a9c1ae48-1adb-46e5-adb0-56e32cf09645.arxp\" -P \"Brother GTX-6 FileOutput"}}]
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<GTOPTION xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<szFileName />
<uiCopies>1</uiCopies>
<byPlatenSize>1</byPlatenSize>
<bEcoMode>false</bEcoMode>
<byInk>2</byInk>
<bMaterialBlack>false</bMaterialBlack>
<bMultiple>false</bMultiple>
<byHighlight>5</byHighlight>
<byMask>3</byMask>
<bFastMode>false</bFastMode>
<bDivide>false</bDivide>
<bPause>false</bPause>
<bTransColor>false</bTransColor>
<byChoke>2</byChoke>
<byMinWhite>1</byMinWhite>
<bySaturation>5</bySaturation>
<byBrightness>5</byBrightness>
<byContrast>5</byContrast>
<iCyanBalance>0</iCyanBalance>
<bUniPrint>false</bUniPrint>
<iMagentaBalance>0</iMagentaBalance>
<iYellowBalance>0</iYellowBalance>
<iBlackBalance>0</iBlackBalance>
<byResolution>1</byResolution>
</GTOPTION>
\ No newline at end of file
......@@ -111,60 +111,95 @@ export default {
res.json({ code: 500, msg: e });
}
},
// downloadBySubOrderNumber: async (req, res) => {
// const params = req.body;
// const token = req.headers["jwt-token"];
// console.log(72, params);
// const urlArr = {
// CN: "factory/podJomallOrderProductCn/downloadDesignImages",
// US: "factory/podJomallOrderProductUs/downloadDesignImages",
// GC: "factory/podJomallOrder/downloadByProduction",
// };
// let url = urlArr[params.orderType];
// console.log(126, url);
// try {
// let { data } = await axios.post(`${env}/${url}`, [...params.ids], {
// headers: { "jwt-token": token },
// });
// let files = [];
// console.log(81, data);
// if (data.code === 200) {
// if (!data.data) data.data = [data.message];
// files = data.data;
// files = files.map((el) => {
// return { url: `${fileEnv}${el}` };
// // return { url: `${el}` };
// });
// if (params.device === 1) {
// downloadImage(files)
// .then((data) => {
// res.json({ code: 200, data });
// })
// .catch((err) => {
// res.json({ code: 500, msg: err });
// });
// } else {
// downloadOtherImage(files)
// .then((data) => {
// console.log(77, data);
// res.json({ code: 200, data });
// })
// .catch((err) => {
// res.json({ code: 500, msg: err });
// });
// }
// } else {
// res.json(data);
// }
// } catch (err) {
// console.log(err);
// res.json({ code: 500, msg: err });
// }
// },
downloadBySubOrderNumber: async (req, res) => {
const params = req.body;
const token = req.headers["jwt-token"];
console.log(72, params);
const urlArr = {
const urlMap = {
CN: "factory/podJomallOrderProductCn/downloadDesignImages",
US: "factory/podJomallOrderProductUs/downloadDesignImages",
GC: "factory/podJomallOrder/downloadByProduction",
};
let url = urlArr[params.orderType];
console.log(126, url);
try {
let { data } = await axios.post(`${env}/${url}`, [...params.ids], {
const url = urlMap[params.orderType];
const { data } = await axios.post(`${env}/${url}`, [...params.ids], {
headers: { "jwt-token": token },
});
let files = [];
console.log(81, data);
if (data.code === 200) {
if (!data.data) data.data = [data.message];
files = data.data;
files = files.map((el) => {
return { url: `${fileEnv}${el}` };
// return { url: `${el}` };
});
if (params.device === 1) {
downloadImage(files)
.then((data) => {
res.json({ code: 200, data });
})
.catch((err) => {
res.json({ code: 500, msg: err });
});
} else {
downloadOtherImage(files)
.then((data) => {
console.log(77, data);
res.json({ code: 200, data });
})
.catch((err) => {
res.json({ code: 500, msg: err });
});
}
} else {
res.json(data);
if (data.code !== 200) {
return res.json(data);
}
let files = data.data || [data.message];
files = files.map((el) => ({ url: `${fileEnv}${el}` }));
const downloadFunc =
params.device === 1 ? downloadImage : downloadOtherImage;
const result = await downloadFunc(files);
res.json({ code: 200, data: result });
} catch (err) {
console.log(err);
res.json({ code: 500, msg: err });
console.error("Download error:", err);
res.status(500).json({ code: 500, msg: err });
}
},
findByPodProductionNo: async (req, res) => {
......
......@@ -5,7 +5,7 @@ var path = require("path");
var request = require("request");
var uuid = require("uuid");
const compressing = require("compressing");
import { createWriteStream } from "fs";
const { getVersion } = require("@/server/utils/store");
function getCurrentVersion() {
......
......@@ -98,7 +98,7 @@ export default {
mounted() {
// console.log(pkg, "pkg");
this.$nextTick(() => {
this.$refs.searchRef.focus();
this.$refs.searchRef?.focus();
this.selectGridIndex = 0;
this.setting.gridValue = 0;
});
......@@ -299,15 +299,12 @@ export default {
this.$message.success(res.msg);
},
async saveImgByUrl(url) {
return new Promise(async (resolve, reject) => {
try {
let res = await this.$api.post("/saveImgByUrl", { url });
resolve(res.data);
} catch (e) {
reject(e.message);
}
});
try {
let res = await this.$api.post("/saveImgByUrl", { url });
return res.data;
} catch (e) {
throw new Error(e.message); // 或者直接 throw e;
}
},
async hasDesignImagesCanvasJsonList(designImagesCanvasJsonList) {
let imageResList = [];
......@@ -452,12 +449,6 @@ export default {
type: "warning",
});
try {
await this.$api.post("/cleanDirectorySync");
} catch (error) {
console.error("清理目录时发生错误:", error.msg);
}
if (this.productionNo.includes("_")) {
const parts = this.productionNo.split("_");
// 查找第一个包含"PSC"的片段
......@@ -505,7 +496,7 @@ export default {
ipcRenderer.send("win-subScreen", findByPodProductionNo.data);
this.$dataStore.set("production_no", this.productionNo);
this.productionNo = "";
this.$refs.searchRef.focus();
this.$refs.searchRef?.focus();
} catch (err) {
console.log(err);
if (!err.data) {
......@@ -514,7 +505,7 @@ export default {
);
}
this.productionNo = "";
this.$refs.searchRef.focus();
this.$refs.searchRef?.focus();
} finally {
this.isFirst = false;
}
......@@ -732,23 +723,6 @@ export default {
<div>
<div class="page-header">
<div class="left-btn">
<!-- <el-tooltip content="文件">-->
<!-- <el-button style="margin-right: 8px" size="small">文件</el-button>-->
<!-- </el-tooltip>-->
<!-- <el-dropdown
trigger="click"
@command="handleCommand"
:hide-on-click="false"
split-button
style="margin-right: 10px;width: 100%;"
>
设备类型:{{ selectedOption }}
<el-dropdown-menu slot="dropdown" style="width: 100%;">
<el-dropdown-item :command="'兄弟'">兄弟</el-dropdown-item>
<el-dropdown-item :command="'其他'">其他</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<div class="selectInput">
<div>设备类型:</div>
......@@ -785,11 +759,7 @@ export default {
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-tooltip content="字体">-->
<!-- <el-button size="small">-->
<!-- <img style="width: 13px;height: 13px" src="@/static/icon/ziti.png" alt="">-->
<!-- </el-button>-->
<!-- </el-tooltip>-->
<el-tooltip content="图片">
<el-upload
accept=".png"
......@@ -804,20 +774,7 @@ export default {
</el-button>
</el-upload>
</el-tooltip>
<!-- <el-tooltip content="撤销">-->
<!-- <el-button @click="changeActionIndex('+')"-->
<!-- :disabled="actionList.length===0 || actionIndex<-1 || actionIndex===actionList.length-1 " icon=""-->
<!-- size="small">-->
<!-- <img style="width: 14px;height: 14px" src="@/static/icon/chehuizuo.png" alt="">-->
<!-- </el-button>-->
<!-- </el-tooltip>-->
<!-- <el-tooltip content="恢复">-->
<!-- <el-button @click="changeActionIndex('-')"-->
<!-- :disabled="actionList.length===0 || actionIndex<=-1" icon=""-->
<!-- size="small">-->
<!-- <img style="width: 14px;height: 14px" src="@/static/icon/chehuiyou.png" alt="">-->
<!-- </el-button>-->
<!-- </el-tooltip>-->
<el-tooltip content="背景色">
<el-color-picker
style="margin-right: 3px"
......@@ -908,18 +865,7 @@ export default {
>检查更新
</el-button>
</el-form-item>
<!-- <el-form-item label="自动打印模式">-->
<!-- <el-switch @change="(e)=>settingChange('autoPrint',e)" v-model="setting.autoPrint"></el-switch>-->
<!-- </el-form-item>-->
</el-form>
<!-- <div class="form-block">-->
<!-- <div @click="setDefaultSetting" class="block-item">重置应用程序设置</div>-->
<!-- </div>-->
<!-- <div class="form-block">-->
<!-- <div class="block-item">隐私政策</div>-->
<!-- <div class="block-item">版本信息</div>-->
<!-- </div>-->
</div>
<el-tooltip slot="reference" content="设置">
<el-button style="margin-right: 8px" size="small">
......@@ -931,12 +877,6 @@ export default {
</el-button>
</el-tooltip>
</el-popover>
<!-- <el-tooltip content="打印">-->
<!-- <el-button @click="showPrintDialog=true" size="small" type="primary">打印</el-button>-->
<!-- </el-tooltip>-->
<!-- <el-tooltip content="添加模板">-->
<!-- <el-button size="small">添加模板</el-button>-->
<!-- </el-tooltip>-->
</div>
<div class="center-input">
<el-input
......
......@@ -13,7 +13,7 @@ import { mmToPx, extractValue } from "@/utils";
const path = require("path");
const fs = require("fs");
const uuid = require("uuid");
import { startLoading, endLoading } from "@/utils/axios.js";
// import { startLoading, endLoading } from "@/utils/axios.js";
import { mapState } from "vuex";
......@@ -933,8 +933,8 @@ export default {
console.error("错误", error);
}
},
startLoading,
endLoading,
// startLoading,
// endLoading,
handleClick(event) {
// 获取点击的元素
......@@ -1104,6 +1104,30 @@ export default {
return data;
}
},
clearImagecCache() {
this.$confirm(
"清除图片缓存后,Ctrl+z则将无法回退上一生产单的图片,确实是否进行该操作?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
).then(async () => {
try {
this.imgList = [];
this.selectImgList = [];
this.selectIndex = -1;
this.selectImgIndex = 0;
this.detail = {};
await this.$api.post("/cleanDirectorySync");
this.$message.success("清除图片缓存成功");
} catch (error) {
console.error("清理目录时发生错误:", error.msg);
this.$message.error("清理目录时发生错误,请重试");
}
});
},
},
mounted() {
this.imgHeight = window.screen.height + "px";
......@@ -1140,6 +1164,7 @@ export default {
console.log(this.detail, "this.detail");
this.imgList = [];
this.selectImgList = [];
this.selectIndex = -1;
if (value.length > 0) {
this.selectImgList = value;
......@@ -1216,11 +1241,17 @@ export default {
style="display: flex;justify-content: space-between;align-items: center;padding: 0 10px;"
>
<div>素材图</div>
<div>
<div v-if="selectImgList.length">
<el-button
type="primary"
size="small"
style="margin: 5px;"
@click="clearImagecCache"
>清除图片缓存
</el-button>
<el-button
type="primary"
size="small"
v-if="selectImgList.length"
style="margin: 5px;"
@click="downloadImg"
>下载原素材
......@@ -1228,7 +1259,6 @@ export default {
<el-button
type="primary"
size="small"
v-if="selectImgList.length"
style="margin: 5px;"
@click="cutImgFn"
>裁切
......@@ -1254,43 +1284,6 @@ export default {
</div>
<el-empty v-else description="素材图为空"></el-empty>
</div>
<!-- <PicScrollbarBox boxTitle="素材图" emptyTitle="素材图为空">
<template #titleRight>
<div>
<el-button
type="primary"
size="small"
v-if="selectImgList.length"
style="margin: 5px;"
@click="downloadImg"
>下载原素材
</el-button>
<el-button
type="primary"
size="small"
v-if="selectImgList.length"
style="margin: 5px;"
@click="cutImgFn"
>裁切
</el-button>
</div>
</template>
<template #mainContent>
<div
v-for="(img, i) in selectImgList"
:key="i"
class="img-item showImg"
@click.stop.prevent="selectImg(img, i)"
>
<img
:key="i"
style="width: auto;max-height: 190px;max-width: 200px;"
:src="img.productionFile"
/>
</div>
</template>
</PicScrollbarBox> -->
</div>
<div class="product-information">
<div class="title">
......@@ -1594,7 +1587,6 @@ export default {
</div>
</div>
</div>
<!-- <div class="imgBox" style=""></div> -->
</div>
<!-- <div
class="print-tip"
......
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