king
2020-07-31 5ae8e447c55f61508546e00559f54eb623a5c803
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -826,9 +826,7 @@
        }
        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',
@@ -849,9 +847,7 @@
        }
        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',
@@ -881,12 +877,14 @@
      }
      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',
@@ -913,6 +911,18 @@
      })
    }
  }
  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导出,成功后取消导出按钮加载中状态