Commit 8814bdc9 by linjinhong

添加其他机器清除功能

parent acee4b3d
...@@ -246,6 +246,8 @@ export default { ...@@ -246,6 +246,8 @@ export default {
let body = req.body; let body = req.body;
writeProfileXml(body); // 写入xml文件 writeProfileXml(body); // 写入xml文件
// GTXproCMD.exe print -X "Profile\\CO12.xml" -I "Input\\sample.png" -A "Output\\pO12.arxp" -S 03000400 -L 02540254 // GTXproCMD.exe print -X "Profile\\CO12.xml" -I "Input\\sample.png" -A "Output\\pO12.arxp" -S 03000400 -L 02540254
console.log(249, body);
toSend(body) toSend(body)
.then((r) => { .then((r) => {
res.send({ code: 200, msg: "操作成功" }); res.send({ code: 200, msg: "操作成功" });
......
...@@ -154,9 +154,9 @@ export const toSend = (body) => { ...@@ -154,9 +154,9 @@ export const toSend = (body) => {
body.cmd, body.cmd,
{ cwd: path.join(process.cwd(), "print"), shell: true }, { cwd: path.join(process.cwd(), "print"), shell: true },
(err, stdout, stderr) => { (err, stdout, stderr) => {
console.log(stdout, 1); // console.log(stdout, 1);
console.log(stderr, 2); // console.log(stderr, 2);
console.log(err, 4); console.log("err", err);
if (!err) { if (!err) {
exec( exec(
body.print_cmd, body.print_cmd,
......
import Vue from "vue"; import Vue from "vue";
import Vuex from "vuex"; import Vuex from "vuex";
Vue.use(Vuex); Vue.use(Vuex);
const defaultSetting = { const defaultSetting = {
gridShow: 1, gridShow: 1,
language: "cn", language: "cn",
gridValue: 1, gridValue: 1,
autoPrint: false, autoPrint: false,
gridSpacing: "10mm" gridSpacing: "10mm",
}; };
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
actionList: [], actionList: [],
imgList: [], imgList: [],
desktopDevice: 1, //1是兄弟,2是其他
actionIndex: -1, actionIndex: -1,
systemSetting: { systemSetting: {
gridShow: 1, gridShow: 1,
...@@ -21,8 +21,8 @@ export default new Vuex.Store({ ...@@ -21,8 +21,8 @@ export default new Vuex.Store({
unit: "mm", unit: "mm",
language: "cn", language: "cn",
autoPrint: false, autoPrint: false,
gridSpacing: 10 gridSpacing: 10,
} },
}, },
mutations: { mutations: {
setDefaultSetting(state) { setDefaultSetting(state) {
...@@ -39,7 +39,10 @@ export default new Vuex.Store({ ...@@ -39,7 +39,10 @@ export default new Vuex.Store({
}, },
changeImgList(state, value) { changeImgList(state, value) {
state.imgList = value; state.imgList = value;
} },
changeDesktopDevice(state, value) {
state.desktopDevice = value;
},
}, },
getters: { getters: {
systemSetting(state) { systemSetting(state) {
...@@ -49,8 +52,8 @@ export default new Vuex.Store({ ...@@ -49,8 +52,8 @@ export default new Vuex.Store({
return state.actionList; return state.actionList;
}, },
getActionIndex: (state) => state.actionIndex, getActionIndex: (state) => state.actionIndex,
imgList: (state) => state.imgList imgList: (state) => state.imgList,
}, },
actions: {}, actions: {},
modules: {} modules: {},
}); });
...@@ -342,6 +342,14 @@ export default { ...@@ -342,6 +342,14 @@ export default {
handleCommand(command) { handleCommand(command) {
this.selectedOption = command; // 根据选中的项来更新 selectedOption this.selectedOption = command; // 根据选中的项来更新 selectedOption
}, },
changeDesktopDeviceFn(value) {
this.$store.commit("changeDesktopDevice", value);
if (value === 2) {
this.$store.commit("changeImgList", []);
}
console.log(347, value);
},
}, },
}; };
</script> </script>
...@@ -382,7 +390,11 @@ export default { ...@@ -382,7 +390,11 @@ export default {
<div class="selectInput"> <div class="selectInput">
<div>设备类型:</div> <div>设备类型:</div>
<el-select v-model="desktopDevice" placeholder="请选择设备类型"> <el-select
v-model="desktopDevice"
@change="changeDesktopDeviceFn"
placeholder="请选择设备类型"
>
<el-option label="兄弟" :value="1"> </el-option> <el-option label="兄弟" :value="1"> </el-option>
<el-option label="其他" :value="2"> </el-option> <el-option label="其他" :value="2"> </el-option>
</el-select> </el-select>
......
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