diff --git a/src/renderer/App.vue b/src/renderer/App.vue index ab2fb13..82dc8fa 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -59,6 +59,16 @@ export default { }, deep: true, immediate: true + }, + '$store.state.chat.clearError': { + handler(val) { + let that = this + if (val) { + that.$notify.closeAll() + } + }, + deep: true, + immediate: true } }, methods: { @@ -94,8 +104,27 @@ export default { '确定' ) ] + if (data.noJump) { + btns = [ + that.$createElement( + 'el-button', + { + props: { type: 'primary', size: 'mini' }, + style: { marginLeft: '10px' }, + on: { + click: () => { + that.errors.splice(that.errors.indexOf(data.message), 1) + notifyInstance.close() + } + } + }, + '确定' + ) + ] + } if (data.confirm) { - btns[1] = that.$createElement( + let index = data.noJump ? 0 : 1 + btns[index] = that.$createElement( 'el-button', { props: { type: 'primary', size: 'mini' }, diff --git a/src/renderer/components/workAdd/files/file.vue b/src/renderer/components/workAdd/files/file.vue index 4b03cfb..d107305 100644 --- a/src/renderer/components/workAdd/files/file.vue +++ b/src/renderer/components/workAdd/files/file.vue @@ -170,6 +170,7 @@ export default { size: res.size, folder: false, }; + calcSize(item, _this.folderCalcCallback); return } _this.insertList({ diff --git a/src/renderer/components/workAdd/workAdd.vue b/src/renderer/components/workAdd/workAdd.vue index e8f242d..1b2de25 100644 --- a/src/renderer/components/workAdd/workAdd.vue +++ b/src/renderer/components/workAdd/workAdd.vue @@ -635,7 +635,7 @@ export default { console.error('Error reading file:', error) } } - let isISO = fileList.every(item => item.name.indexOf('ISO') > -1 || item.name.indexOf('IMG') > -1) + let isISO = fileList.every(item => item.name.indexOf('.ISO') > -1 || item.name.indexOf('.IMG') > -1 || item.name.indexOf('.iso') > -1 || item.name.indexOf('.img') > -1) if (that.form.copy_type == 2) { if (fileList.length != 1 || !isISO) { this.$notify({ diff --git a/src/renderer/store/modules/chat.js b/src/renderer/store/modules/chat.js index 9cdc64e..254c46d 100644 --- a/src/renderer/store/modules/chat.js +++ b/src/renderer/store/modules/chat.js @@ -10,26 +10,26 @@ const PrinterStatus = { P: '正在打印' } -// 设备报错 -const printer_errors = { - '0x11': '从光盘桶抓取到光驱时,光盘为空,请添加光盘后点击重试', - '0x12': '从光盘桶抓取到光驱时,抓取错误,请将该光盘放入光盘桶后点击重试', - '0x13': '从光盘桶抓取到光驱时,其他错误,请将该光盘放入光盘桶后点击重试', - '0x14': '从光盘桶抓取到打印托盘时,光盘为空,请添加光盘后点击重试', - '0x15': '从光盘桶抓取到打印托盘时,抓取错误,请将该光盘放入光盘桶后点击重试', - '0x16': '从光盘桶抓取到打印托盘时,其他错误,请将该光盘放入光盘桶后点击重试', - '0x17': '从光驱抓取到打印托盘时,光盘为空,请检查光驱弹出并将该光盘放入后点击重试', - '0x18': '从光驱抓取到打印托盘时,抓取错误,请将该光盘重新放入光驱后点击重试', - '0x19': '从光驱抓取到打印托盘时,其他错误,请将该光盘重新放入光驱后点击重试', - '0x1a': '从打印托盘抓取到出口时,光盘为空,请检查打印托盘弹出并将该光盘放入后点击重试', - '0x1b': '从打印托盘抓取到出口时,抓取错误,请将光该盘重新放入托盘后点击重试', - '0x1c': '从打印托盘抓取到出口时,其他错误,请将该光盘重新放入托盘后点击重试', - '0x1d': '从光驱抓取到出口时,光盘为空,光盘为空,请检查光驱弹出并将该光盘放入后点击重试', - '0x1e': '从光驱抓取到出口时,抓取错误,请将该光盘重新放入光驱后点击重试', - '0x1f': '从光驱抓取到出口时,其他错误,请将该光盘重新放入光驱后点击重试', - '0x21': '作业开始时设备错误,请清除故障后点击重试', - '0x10001': '通讯失败,请检查设备' -} +// // 设备报错 +// const printer_errors = { +// '0x11': '从光盘桶抓取到光驱时,光盘为空,请添加光盘后点击重试', +// '0x12': '从光盘桶抓取到光驱时,抓取错误,请将该光盘放入光盘桶后点击重试', +// '0x13': '从光盘桶抓取到光驱时,其他错误,请将该光盘放入光盘桶后点击重试', +// '0x14': '从光盘桶抓取到打印托盘时,光盘为空,请添加光盘后点击重试', +// '0x15': '从光盘桶抓取到打印托盘时,抓取错误,请将该光盘放入光盘桶后点击重试', +// '0x16': '从光盘桶抓取到打印托盘时,其他错误,请将该光盘放入光盘桶后点击重试', +// '0x17': '从光驱抓取到打印托盘时,光盘为空,请检查光驱弹出并将该光盘放入后点击重试', +// '0x18': '从光驱抓取到打印托盘时,抓取错误,请将该光盘重新放入光驱后点击重试', +// '0x19': '从光驱抓取到打印托盘时,其他错误,请将该光盘重新放入光驱后点击重试', +// '0x1a': '从打印托盘抓取到出口时,光盘为空,请检查打印托盘弹出并将该光盘放入后点击重试', +// '0x1b': '从打印托盘抓取到出口时,抓取错误,请将光该盘重新放入托盘后点击重试', +// '0x1c': '从打印托盘抓取到出口时,其他错误,请将该光盘重新放入托盘后点击重试', +// '0x1d': '从光驱抓取到出口时,光盘为空,光盘为空,请检查光驱弹出并将该光盘放入后点击重试', +// '0x1e': '从光驱抓取到出口时,抓取错误,请将该光盘重新放入光驱后点击重试', +// '0x1f': '从光驱抓取到出口时,其他错误,请将该光盘重新放入光驱后点击重试', +// '0x21': '作业开始时设备错误,请清除故障后点击重试', +// '0x10001': '通讯失败,请检查设备' +// } // 提交任务报错 const submitErros = { @@ -56,7 +56,7 @@ const Error = { 4: '墨盒容量低', 5: '机械臂移动错误,请按功能按钮重试。', 6: '设备处于离线状态', - 7: '设备门盖被打开,请关闭门盖。', + 7: '设备门盖被打开,为了避免打印机失联请关闭门盖。', 8: '从打印托盘上抓取光盘时错误,请手动将光盘取走再点击重试。', 9: '多张光盘被抓取或移动,请检查后手动将光盘放回原处再点重试,如重试后继续错误,则需校准设备后再来重试。', 10: '从进盘仓到光驱的过程中,抓取错误,请手动将光盘放回进盘仓后重试。', @@ -66,7 +66,7 @@ const Error = { 14: '检测墨盒错误', 15: '校准光盘桶失败', 16: '等待打印完成超时', - 17: '从打印托盘抓取光盘时未找到光盘。', + 17: '从打印托盘抓取光盘时未找到光盘,请检查后手动将光盘取走后再点重试。', 18: '设备清洗', 19: '从光驱上抓取光盘时错误,请手动将光盘取走再点击重试', 32: '其他错误', @@ -230,6 +230,7 @@ const defaultData = { system_ip: '', //主机IP system_name: '', //主机名称 is_set_cddev: 0, + serial_no: '', //设备序列号 // 左右光盘桶 strong_list: [ { @@ -326,6 +327,7 @@ const getDefaultState = () => { refreshTime: 10, // 错误信息 printer_error: {}, + clearError: false, ...defaultData } } @@ -381,12 +383,12 @@ const actions = { strong_list[info.strong_list[i].strong_pos] = info.strong_list[i] } info.strongList = strong_list - if (info.cover_flag && info.printer_name !== 'SE3') { - // commit('setData', { name: 'printer_error', data: { type: 'error', notify: '设备门盖被打开,请关闭门盖。' } }) - } - if (info.calibration_flag) { - commit('setData', { name: 'printer_error', data: { type: 'error', notify: '请校准打印机。' } }) - } + // if (info.cover_flag && info.printer_name !== 'SE3') { + // commit('setData', { name: 'printer_error', data: { type: 'error', notify: '设备门盖被打开,请关闭门盖。' } }) + // } + // if (info.calibration_flag) { + // commit('setData', { name: 'printer_error', data: { type: 'error', notify: '请校准打印机。' } }) + // } commit('setData', { name: 'printer_info', data: info }) // 驱动信息 } else if (data.resp_name === 'cd_info') { @@ -463,13 +465,15 @@ const actions = { if (error.error) { let errors = error.error let continues = [8, 9, 10, 11, 12, 17, 19] + let nojumps = [7, 8, 9, 10, 11, 12, 17, 19] for (let i = 0; i < errors.length; i++) { setTimeout(() => { let req = continues.indexOf(errors[i]) > -1 ? 'continue_task' : '' + let noJump = nojumps.indexOf(errors[i]) > -1 if (req) { - commit('setData', { name: 'printer_error', data: { type: 'error', confirm: Error[errors[i]], req: req } }) + commit('setData', { name: 'printer_error', data: { type: 'error', confirm: Error[errors[i]], req: req, noJump: noJump } }) } else { - commit('setData', { name: 'printer_error', data: { type: 'error', notify: Error[errors[i]] } }) + commit('setData', { name: 'printer_error', data: { type: 'error', notify: Error[errors[i]], noJump: noJump } }) } }, 500) } @@ -514,6 +518,12 @@ const actions = { commit('setData', { name: 'printer_error', data: { type: 'error', notify: printer_errors[error.printer_error] } }) } } + // 清除错误提示 + } else if (data.resp_name === 'clean_iface_err') { + commit('setData', { name: 'clearError', data: true }) + setTimeout(() => { + commit('setData', { name: 'clearError', data: false }) + }, 1000); // 执行错误提示 } else { if (data.resp_info.res_code === 0) { @@ -543,12 +553,12 @@ const actions = { websocketsend({ commit, dispatch }, res) { return new Promise((resolve, reject) => { if (!state.serviceStatus) { - commit('setData', { name: 'printer_error', data: { type: 'warning', message: '服务连接中,请耐心等待' } }) + commit('setData', { name: 'printer_error', data: { type: 'warning', message: '服务连接中,请耐心等待', noJump: true } }) reject() return } if (!state.isConnect) { - commit('setData', { name: 'printer_error', data: { type: 'warning', message: '请先打开服务' } }) + commit('setData', { name: 'printer_error', data: { type: 'warning', message: '请先打开服务', noJump: true } }) reject() return } diff --git a/src/renderer/views/dashboard/index.vue b/src/renderer/views/dashboard/index.vue index d4d7eb4..5fb748b 100644 --- a/src/renderer/views/dashboard/index.vue +++ b/src/renderer/views/dashboard/index.vue @@ -68,13 +68,13 @@
{{ item }} @@ -96,13 +96,13 @@
{{ item }} @@ -142,7 +142,7 @@
-
系统序列号:
+
系统序列号:{{ printer_info.serial_no }}
主机名:{{ printer_info.system_name }}
主机IP:{{ printer_info.system_ip }}
缓存空间:0G(共0G)
@@ -534,9 +534,9 @@ export default { this.is_set_cddev = true this.goSet('/manage?type=cddev') } - if (this.printer_info.cartridge_flag == 0) { - this.$store.commit('chat/setData', { name: 'printer_error', data: { type: 'error', notify: '请检查墨盒错误或墨盒未安装,否则作业将失败。' } }) - } + // if (this.printer_info.cartridge_flag == 0) { + // this.$store.commit('chat/setData', { name: 'printer_error', data: { type: 'error', notify: '请检查墨盒错误或墨盒未安装,否则作业将失败。', noJump: true } }) + // } }, deep: true, immediate: true @@ -584,6 +584,13 @@ export default { // type: 'success' // }) this.serviceLoading = false + that.$store + .dispatch('chat/websocketsend', { + req_name: 'get_printer_info', + req_type: 2, + req_info: {} + }) + .then(() => { }) } this.isConnect = val }, @@ -730,10 +737,10 @@ export default { }) return } - // that.$message({ - // message: that.runList[index].label, - // type: 'success' - // }) + that.$message({ + message: that.runList[index].label, + type: 'success' + }) clearTimeout(outTimer) switch (that.runVal) { case 1: @@ -885,7 +892,7 @@ export default { }, // 更换左右磁盘类型 handleCommandCD(e, type) { - that.printer_info.strongList[type].cd_type = parseInt(e) + // that.printer_info.strongList[type].cd_type = parseInt(e) that.changeCD.req_info.strong_list[type - 1].strong_type = parseInt(e) }, sureCD() {