From 2d1ecb2628680c31ed075261b40d6f16ca6363dd Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 11 三月 2020 13:39:29 +0800
Subject: [PATCH] 2020-03-11

---
 src/tabviews/tableshare/actionList/index.jsx |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/tabviews/tableshare/actionList/index.jsx b/src/tabviews/tableshare/actionList/index.jsx
index 51cfdbe..92f83e0 100644
--- a/src/tabviews/tableshare/actionList/index.jsx
+++ b/src/tabviews/tableshare/actionList/index.jsx
@@ -627,7 +627,17 @@
         })
       }
     }
-    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 {
@@ -685,7 +695,7 @@
         }
       }
 
-      if (data && data.defaultPrinter) {
+      if (data && data.cmd === 'getPrinters' && data.status) {
         printdata.task.printer = data.defaultPrinter
         this.setState({loadingUuid: ''})
         notification.success({
@@ -694,6 +704,13 @@
           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: ''})
       }
     }
 

--
Gitblit v1.8.0