From d7534812c8199bf1e9faa0279b63e434737d6374 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 16 四月 2021 16:06:27 +0800
Subject: [PATCH] 2021-04-16

---
 src/tabviews/zshare/actionList/printbutton/index.jsx |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 323d5ab..0117190 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -81,7 +81,7 @@
    * @description 瑙﹀彂鎸夐挳鎿嶄綔
    */
   actionTrigger = (triggerId, record) => {
-    const { setting, Tab, BID, btn, selectedData } = this.props
+    const { Tab, BID, btn, selectedData } = this.props
     const { loading } = this.state
 
     if ((triggerId && btn.uuid !== triggerId) || loading) return
@@ -111,14 +111,6 @@
       notification.warning({
         top: 92,
         message: this.state.dict['main.action.confirm.selectSingleLine'],
-        duration: 5
-      })
-      return
-    } else if (!setting.primaryKey) {
-      // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾槸鍚﹁缃富閿�
-      notification.warning({
-        top: 92,
-        message: '鏈缃富閿紒',
         duration: 5
       })
       return
@@ -358,17 +350,21 @@
         let _param = { ...param, ...formdata }
         params.push(_param)
       } else if (btn.Ot === 'requiredSgl') {
-        param[setting.primaryKey] = data[0][setting.primaryKey]
+        if (setting.primaryKey) {
+          param[setting.primaryKey] = data[0][setting.primaryKey]
+        }
 
         let _param = { ...param, ...formdata }
 
         params.push(_param)
       } else if (btn.Ot === 'requiredOnce') {
-        let ids = data.map(d => { return d[setting.primaryKey]})
-        ids = ids.filter(Boolean)
-        ids = ids.join(',')
-
-        param[setting.primaryKey] = ids
+        if (setting.primaryKey) {
+          let ids = data.map(d => { return d[setting.primaryKey]})
+          ids = ids.filter(Boolean)
+          ids = ids.join(',')
+  
+          param[setting.primaryKey] = ids
+        }
 
         let _param = { ...param, ...formdata }
 
@@ -376,7 +372,10 @@
       } else if (btn.Ot === 'required') {
         params = data.map((cell, index) => {
           let _param = { ...param }
-          _param[setting.primaryKey] = cell[setting.primaryKey]
+          
+          if (setting.primaryKey) {
+            _param[setting.primaryKey] = cell[setting.primaryKey]
+          }
 
           formlist.forEach(_data => {
             if (index !== 0 && _data.readin && cell.hasOwnProperty(_data.key)) {
@@ -1269,7 +1268,7 @@
           type="link"
           title={show === 'icon' ? btn.label : ''}
           loading={loading}
-          style={btn.btnstyle}
+          style={btn.style}
           icon={show === 'text' ? '' : (btn.icon || '')}
           onClick={() => {this.actionTrigger()}}
         >{show === 'icon' && btn.icon ? '' : btn.label}</Button>

--
Gitblit v1.8.0