| | |
| | | }) |
| | | } |
| | | } |
| | | console.log(JSON.stringify(printdata)) |
| | | |
| | | if (list.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印信息!', |
| | | duration: 10 |
| | | }) |
| | | this.setState({loadingUuid: ''}) |
| | | return |
| | | } |
| | | |
| | | if (!socket || socket.readyState !== 1 || socket.url !== 'ws://' + item.verify.linkUrl) { |
| | | socket = new WebSocket('ws://' + item.verify.linkUrl) |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | if (data && data.defaultPrinter) { |
| | | if (data && data.cmd === 'getPrinters' && data.status) { |
| | | printdata.task.printer = data.defaultPrinter |
| | | this.setState({loadingUuid: ''}) |
| | | notification.success({ |
| | |
| | | duration: 2 |
| | | }) |
| | | socket.send(JSON.stringify(printdata)) |
| | | } else if (data && data.message && !data.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: data.message, |
| | | duration: 10 |
| | | }) |
| | | this.setState({loadingUuid: ''}) |
| | | } |
| | | } |
| | | |