| | |
| | | } |
| | | socket.send(JSON.stringify(request)) |
| | | } else { |
| | | printerList.forEach((cell, index) => { |
| | | setTimeout(() => {socket.send(JSON.stringify(cell))}, 500 * index) |
| | | }) |
| | | this.syncMessageSend(printerList) |
| | | |
| | | this.execSuccess({ |
| | | ErrCode: 'S', |
| | |
| | | } |
| | | socket.send(JSON.stringify(request)) |
| | | } else { |
| | | printerList.forEach((cell, index) => { |
| | | setTimeout(() => {socket.send(JSON.stringify(cell))}, 500 * index) |
| | | }) |
| | | this.syncMessageSend(printerList) |
| | | |
| | | this.execSuccess({ |
| | | ErrCode: 'S', |
| | |
| | | } |
| | | |
| | | if (data && data.cmd === 'getPrinters' && data.status) { |
| | | printerList.forEach((cell, index) => { |
| | | printerList = printerList.map(cell => { |
| | | if (cell.task.printer === 'lackprinter') { |
| | | cell.task.printer = data.defaultPrinter |
| | | } |
| | | setTimeout(() => {socket.send(JSON.stringify(cell))}, 500 * index) |
| | | return cell |
| | | }) |
| | | |
| | | this.syncMessageSend(printerList) |
| | | |
| | | this.execSuccess({ |
| | | ErrCode: 'S', |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | syncMessageSend = (list) => { |
| | | let param = list.shift() |
| | | |
| | | if (socket && param) { |
| | | socket.send(JSON.stringify(param)) |
| | | } |
| | | |
| | | if (list && list.length > 0) { |
| | | setTimeout(() => {this.syncMessageSend(list)}, 3000) |
| | | } |
| | | } |
| | | /** |
| | | * @description 操作成功后处理 |
| | | * 1、excel导出,成功后取消导出按钮加载中状态 |