From a82d726906f0264b96a5b1a82d932d0c3c38714e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 05 一月 2021 18:30:21 +0800
Subject: [PATCH] 2021-01-05

---
 src/tabviews/commontable/index.jsx |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index 627c9dd..a6d155d 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -225,10 +225,6 @@
         config.easyCode = _curUserConfig.easyCode || config.easyCode || ''
 
         config.action = config.action.map(item => {
-          if (item.execMode) {
-            item.OpenType = 'funcbutton'
-          }
-
           if (_curUserConfig.action[item.uuid]) {
             delete _curUserConfig.action[item.uuid].label
             item = {...item, ..._curUserConfig.action[item.uuid]}
@@ -267,10 +263,8 @@
 
       config.action.forEach(item => {
         item.logLabel = MenuName + '-' + item.label // 鐢ㄤ簬sPC_TableData_InUpDe璁板綍鎿嶄綔鎸夐挳
-        if (item.execMode) {
-          item.OpenType = 'funcbutton'
-        }
-
+        item.$menuId = this.props.MenuID
+        
         if (item.position === 'toolbar') {
           _actions.push(item)
         } else if (item.position === 'grid') {
@@ -744,16 +738,18 @@
   /**
    * @description 瀵煎嚭Excel鏃讹紝鑾峰彇椤甸潰鎼滅储鎺掑簭绛夊弬鏁�
    */
-  getexceloutparam = () => {
-    const { MenuName } = this.props
+  getexceloutparam = (menuId, btnId) => {
+    const { MenuName, MenuID } = this.props
     const { arr_field, orderBy, search, setting} = this.state
 
-    return {
+    if (MenuID !== menuId) return
+
+    MKEmitter.emit('execExcelout', MenuID, btnId, {
       arr_field: arr_field,
       orderBy: orderBy || setting.order,
       search: search,
       menuName: MenuName
-    }
+    })
   }
 
   /**
@@ -918,6 +914,7 @@
     MKEmitter.addListener('reloadData', this.reloadData)
     MKEmitter.addListener('reloadMenuView', this.reloadMenuView)
     MKEmitter.addListener('resetActiveMenu', this.resetActiveMenu)
+    MKEmitter.addListener('getexceloutparam', this.getexceloutparam)
   }
 
   /**
@@ -931,6 +928,7 @@
     MKEmitter.removeListener('reloadData', this.reloadData)
     MKEmitter.removeListener('reloadMenuView', this.reloadMenuView)
     MKEmitter.removeListener('resetActiveMenu', this.resetActiveMenu)
+    MKEmitter.removeListener('getexceloutparam', this.getexceloutparam)
   }
 
   render() {
@@ -968,7 +966,6 @@
                       selectedData={selectedData}
                       ContainerId={this.state.ContainerId}
                       refreshdata={this.refreshbyaction}
-                      getexceloutparam={this.getexceloutparam}
                     />
                   </div>
                   <div className="main-table-box">
@@ -1021,7 +1018,6 @@
                     loading={this.state.loading}
                     ContainerId={this.state.ContainerId}
                     refreshdata={this.refreshbyaction}
-                    getexceloutparam={this.getexceloutparam}
                     handleTableId={this.handleTableId}
                   />
                 </Col>
@@ -1034,7 +1030,6 @@
                     plot={item}
                     config={config}
                     data={this.state.data}
-                    getexceloutparam={this.getexceloutparam}
                     loading={this.state.loading}
                   />
                 </Col>

--
Gitblit v1.8.0