From 42fae277ae5ebe794fc070bf38482a919eb661fc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 25 十一月 2020 14:36:02 +0800
Subject: [PATCH] 2020-11-25

---
 src/templates/subtableconfig/index.jsx |   30 +++++++++++-------------------
 1 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index 6cdd3a1..a5e680a 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -63,7 +63,6 @@
     thawButtons: [],         // 宸查�夋嫨瑕佽В鍐荤殑鎸夐挳
     activeKey: '0',          // 榛樿灞曞紑鍩烘湰淇℃伅
     chartview: null,         // 褰撳墠瑙嗗浘
-    pasteContent: null,      // 绮樿创鍐呭
     openEdition: ''          // 缂栬緫鐗堟湰鏍囪锛岄槻姝㈠浜烘搷浣�
   }
 
@@ -922,13 +921,17 @@
         config: res.config
       })
     } else if (res.type === 'paste') {
-      this.setState({
-        pasteContent: res.content
-      }, () => {
-        this.setState({
-          pasteContent: null
-        })
-      })
+      let config = fromJS(this.state.config).toJS()
+      if (res.content.copyType === 'search') {
+        config.search.push(res.content)
+      } else if (res.content.copyType === 'action') {
+        config.action.push(res.content)
+      } else if (res.content.copyType === 'columns' && res.content.columns && res.content.columns.length > 0) {
+        config.columns = config.columns.filter(col => !col.origin)
+        config.columns = [...config.columns, ...res.content.columns]
+      }
+
+      this.setState({config})
     }
   }
 
@@ -1099,21 +1102,16 @@
                 config={config}
                 mainsearch={!this.props.editSubTab && this.props.editTab.mainsearch ? this.props.editTab.mainsearch : ''}
                 MenuID={config.uuid}
-                permFuncField={this.props.permFuncField}
                 updatesetting={this.updateconfig}
               />
               <SearchComponent
-                menu={{MenuID: config.uuid, MenuName: config.tabName}}
                 config={config}
-                pasteContent={this.state.pasteContent}
-                sysRoles={this.props.sysRoles}
                 updatesearch={this.updatesearch}
               />
               <div className="chart-view" style={{position: 'relative'}}>
                 {/* 瑙嗗浘缁� 鏉冮檺 浼氬憳绛夌骇20+ */}
                 {this.props.memberLevel >= 20 ? <ChartGroupComponent
                   config={config}
-                  sysRoles={this.props.sysRoles}
                   updatechartgroup={this.updatechartgroup}
                 /> : null}
                 {config.charts.map(item => {
@@ -1128,16 +1126,12 @@
                           menu={{MenuID: config.uuid, MenuName: config.tabName, MenuNo: config.tabNo, fstMenuList: this.props.menu.fstMenuList}}
                           config={config}
                           tabs={this.state.tabviews}
-                          pasteContent={this.state.pasteContent}
-                          usefulFields={this.props.permFuncField}
                           setSubConfig={this.setSubConfig}
                           updateaction={this.updateaction}
                         />
                         <ColumnComponent
                           config={config}
                           menu={this.props.menu}
-                          sysRoles={this.props.sysRoles}
-                          pasteContent={this.state.pasteContent}
                           updatecolumn={this.updateconfig}
                         />
                       </Col>
@@ -1191,8 +1185,6 @@
 
 const mapStateToProps = (state) => {
   return {
-    sysRoles: state.sysRoles,
-    permFuncField: state.permFuncField,
     memberLevel: state.memberLevel
   }
 }

--
Gitblit v1.8.0