diff --git a/src/renderer/store/modules/chat.js b/src/renderer/store/modules/chat.js index facd463..59e13e3 100644 --- a/src/renderer/store/modules/chat.js +++ b/src/renderer/store/modules/chat.js @@ -205,6 +205,7 @@ const defaultData = { yellow_last: 0, //黄色墨盒遗留 system_ip: '', //主机IP system_name: '', //主机名称 + is_set_cddev: 1, // 左右盘仓 strong_list: [ { diff --git a/src/renderer/views/dashboard/index.vue b/src/renderer/views/dashboard/index.vue index e06ae58..532d588 100644 --- a/src/renderer/views/dashboard/index.vue +++ b/src/renderer/views/dashboard/index.vue @@ -424,7 +424,8 @@ export default { showAll: false, workShow: false, isNew: true, - saveWorkList: {} + saveWorkList: {}, + is_set_cddev: false } }, watch: { @@ -482,15 +483,18 @@ export default { } this.default_cd = data.strongList this.printer_info = { ...data } - if (that.printer_info.is_set_cddev == 1) { + if (this.printer_info.is_set_cddev == 1) { + if (this.is_set_cddev) return + this.is_set_cddev = true this.$confirm('上下光驱未设置,请前往设置', '温馨提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { + this.is_set_cddev = false this.goSet('/manage') }).catch(() => { - + this.is_set_cddev = false }); } }, @@ -535,10 +539,10 @@ export default { '$store.state.chat.isConnect': { handler(val) { if (val) { - this.$message({ - message: '服务已连接', - type: 'success' - }) + // this.$message({ + // message: '服务已连接', + // type: 'success' + // }) this.serviceLoading = false } this.isConnect = val @@ -866,14 +870,17 @@ export default { return } if (that.printer_info.is_set_cddev == 1) { - this.$confirm('上下光驱未设置,请前往设置', '温馨提示', { + if (that.is_set_cddev) return + that.is_set_cddev = true + that.$confirm('上下光驱未设置,请前往设置', '温馨提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { + that.is_set_cddev = false that.goSet('/manage') }).catch(() => { - + that.is_set_cddev = false }); return } @@ -893,14 +900,17 @@ export default { return } if (that.printer_info.is_set_cddev == 1) { - this.$confirm('上下光驱未设置,请前往设置', '温馨提示', { + if (that.is_set_cddev) return + that.is_set_cddev = true + that.$confirm('上下光驱未设置,请前往设置', '温馨提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { + that.is_set_cddev = false that.goSet('/manage') }).catch(() => { - + that.is_set_cddev = false }); return } diff --git a/src/renderer/views/manage/index.vue b/src/renderer/views/manage/index.vue index 7c7dbe4..9354705 100644 --- a/src/renderer/views/manage/index.vue +++ b/src/renderer/views/manage/index.vue @@ -527,51 +527,68 @@ export default { this.cdShow = false }, cdSubmit() { - let top = this.cdList.filter((item) => item.cdType === 2) - let bottom = this.cdList.filter((item) => item.cdType === 3) - if (!top || top.length === 0) { - this.$message({ - message: '请设置上光驱', - type: 'error' - }) - return - } - if (!bottom || bottom.length === 0) { - this.$message({ - message: '请设置下光驱', - type: 'error' - }) - return - } - if (top.length > 1) { - this.$message({ - message: '上光驱只能设置一个', - type: 'error' - }) - return - } - if (bottom.length > 1) { - this.$message({ - message: '下光驱只能设置一个', - type: 'error' - }) - return + let device_list = [ + { + device_path: this.cdList[0].dev_path, + device_pos: 2 + } + ] + if (this.$store.state.chat.printer_info.printer_name !== 'SE3') { + let top = this.cdList.filter((item) => item.cdType === 2) + let bottom = this.cdList.filter((item) => item.cdType === 3) + if (!top || top.length === 0) { + this.$message({ + message: '请设置上光驱', + type: 'error' + }) + return + } + if (!bottom || bottom.length === 0) { + this.$message({ + message: '请设置下光驱', + type: 'error' + }) + return + } + if (top.length > 1) { + this.$message({ + message: '上光驱只能设置一个', + type: 'error' + }) + return + } + if (bottom.length > 1) { + this.$message({ + message: '下光驱只能设置一个', + type: 'error' + }) + return + } + device_list = [ + { + device_path: top[0].dev_path, + device_pos: 2 + }, + { + device_path: bottom[0].dev_path, + device_pos: 1 + } + ] + } else { + if (!this.cdList[0].cdType) { + this.$message({ + message: '请设置光驱', + type: 'error' + }) + return + } } this.$store .dispatch('chat/websocketsend', { req_name: 'setCDDevice', req_type: 2, req_info: { - device_list: [ - { - device_path: top[0].dev_path, - device_pos: 2 - }, - { - device_path: bottom[0].dev_path, - device_pos: 1 - } - ] + device_list: device_list } }) .then(() => {