From 0594fe8d97286a535177f8ba05972d0305fc7dee Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 17 二月 2020 14:15:58 +0800
Subject: [PATCH] 2020-02-17

---
 src/tabviews/tableshare/actionList/index.jsx |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/src/tabviews/tableshare/actionList/index.jsx b/src/tabviews/tableshare/actionList/index.jsx
index 77d8372..4b1444c 100644
--- a/src/tabviews/tableshare/actionList/index.jsx
+++ b/src/tabviews/tableshare/actionList/index.jsx
@@ -118,7 +118,12 @@
       this.refreshdata(item, 'excelOut')
     } else if (item.OpenType === 'excelIn') {
       if (item.verify && item.verify.sheet && item.verify.columns && item.verify.columns.length > 0) {
-        this.refs.excelIn.exceltrigger(item)
+        let primaryId = '' // 瀵煎叆鏃惰Id
+        if (item.Ot === 'requiredSgl') {
+          primaryId = data[0][setting.primaryKey] || ''
+        }
+
+        this.refs.excelIn.exceltrigger(item, primaryId)
       } else {
         notification.warning({
           top: 92,
@@ -791,19 +796,35 @@
     })
   }
 
-  getexceldata = (data, btn, errors) => {
-    if (errors && errors.length > 0) {
-      notification.warning({
-        top: 92,
-        message: errors.join(',') + '琛ㄥご璁剧疆閿欒锛�',
-        duration: 10
-      })
+  getexceldata = (data, btn, errors, primaryId) => {
+    if (errors) {
+      if (errors === 'notexit') {
+        notification.warning({
+          top: 92,
+          message: '宸ヤ綔琛ㄣ��' + btn.verify.sheet + '銆嬩笉瀛樺湪锛�',
+          duration: 10
+        })
+      } else if (errors === 'empty') {
+        notification.warning({
+          top: 92,
+          message: '宸ヤ綔琛ㄣ��' + btn.verify.sheet + '銆嬩负绌猴紒',
+          duration: 10
+        })
+      } else if (errors === 'headerError') {
+        notification.warning({
+          top: 92,
+          message: '宸ヤ綔琛ㄣ��' + btn.verify.sheet + '銆嬭〃澶磋缃敊璇紒',
+          duration: 10
+        })
+      }
+      
       return
     }
+
     if (!data || data.length === 0) {
       notification.warning({
         top: 92,
-        message: '鏈幏鍙栧埌excel鏁版嵁锛�',
+        message: '鏈幏鍙栧埌宸ヤ綔琛ㄣ��' + btn.verify.sheet + '銆嬫暟鎹紒',
         duration: 10
       })
       return
@@ -820,7 +841,8 @@
     }
 
     let param = {
-      BID: this.props.BID
+      BID: this.props.BID,
+      ID: primaryId
     }
 
     param.LText = Utils.formatOptions(result.sql)

--
Gitblit v1.8.0