From abf582fbe18c20ab4f01458a9209878c77fea9c0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 15 一月 2020 18:59:52 +0800
Subject: [PATCH] 2020-01-15

---
 src/templates/comtableconfig/actionform/index.jsx     |  116 +--
 src/templates/subtableconfig/source.jsx               |   33 -
 src/templates/comtableconfig/tabdragelement/index.jsx |    1 
 src/templates/comtableconfig/source.jsx               |   39 -
 src/templates/comtableconfig/index.jsx                |  299 +++++----
 src/templates/comtableconfig/tabform/index.jsx        |   13 
 src/templates/subtableconfig/index.jsx                | 1117 +++++++++----------------------------
 src/templates/tableshare/formconfig.js                |   72 +-
 src/templates/comtableconfig/settingform/index.jsx    |    1 
 src/templates/subtableconfig/actionform/index.jsx     |    6 
 src/templates/tableshare/editcard/index.jsx           |   15 
 11 files changed, 559 insertions(+), 1,153 deletions(-)

diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx
index d20dd80..7ce988f 100644
--- a/src/templates/comtableconfig/actionform/index.jsx
+++ b/src/templates/comtableconfig/actionform/index.jsx
@@ -167,10 +167,15 @@
     }
   }
 
-  // 鎵撳紑鏂瑰紡鎴栨樉绀轰綅缃彉鍖�
+  /**
+   * @description 涓嬫媺鍒囨崲
+   * 1銆佹墦寮�鏂瑰紡鍒囨崲锛岄噸缃彲瑙佽〃鍗曞拰琛ㄥ崟鍊�
+   * 2銆佹樉绀轰綅缃垏鎹紝閲嶇疆閫夋嫨琛�
+   * 3銆佸垏鎹㈡爣绛剧被鍨嬶紝閲嶇疆鍙�夋爣绛�
+   */
   openTypeChange = (key, value) => {
     if (key === 'OpenType') {
-      let _options = null
+      let _options = []
       if (value === 'innerpage') {
         _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position']
       } else if (value === 'outerpage') {
@@ -192,64 +197,57 @@
           _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method']
         }
       }
+
+      let _fieldval = {}
+      
+      let _formlist = this.state.formlist.map(item => {
+        item.hidden = !_options.includes(item.key)
+
+        if (item.hidden) return item
+
+        if (item.key === 'intertype') {
+          _fieldval.intertype = this.state.interType
+        } else if (item.key === 'Ot') {
+          if (value === 'innerpage' || this.state.position === 'grid') {
+            item.options = this.state.reqOptionSgl
+            _fieldval.Ot = 'requiredSgl'
+          } else if (['outerpage', 'blank', 'tab', 'popview'].includes(value)) {
+            item.options = this.state.reqOptions
+            _fieldval.Ot = 'requiredSgl'
+          } else {
+            item.options = this.state.reqOptionsMutil
+          }
+        } else if (item.key === 'sqlType') {
+          if (['prompt', 'exec'].includes(value)) {
+            item.options = this.state.deleteOptions
+          } else {
+            item.options = this.state.insertUpdateOptions
+          }
+          _fieldval.sqlType = ''
+        }
+
+        return item
+      })
+
       this.setState({
         openType: value,
-        formlist: this.state.formlist.map(item => {
-          if (_options) {
-            item.hidden = !_options.includes(item.key)
-            if (item.key === 'intertype') {
-              item.initVal = this.state.interType
-            }
-          }
-          if (item.key === 'Ot') {
-            if (value === 'innerpage' || this.state.position === 'grid') {
-              item.options = this.state.reqOptionSgl
-              item.initVal = 'requiredSgl'
-            } else if (['outerpage', 'blank', 'tab', 'popview'].includes(value)) {
-              item.options = this.state.reqOptions
-              item.initVal = 'requiredSgl'
-            } else {
-              item.options = this.state.reqOptionsMutil
-            }
-            item.hidden = true
-          } else if (item.key === 'sqlType') {
-            if (['prompt', 'exec'].includes(value)) {
-              item.options = this.state.deleteOptions
-            } else {
-              item.options = this.state.insertUpdateOptions
-            }
-            item.initVal = ''
-            item.hidden = true
-          }
-          return item
-        })
+        formlist: _formlist
       }, () => {
-        if (['excelIn', 'excelOut'].includes(value)) return
-
-        this.setState({
-          formlist: this.state.formlist.map(item => {
-            if (item.key === 'Ot') {
-              item.hidden = false
-            } else if (item.key === 'sqlType' && ['prompt', 'exec', 'pop'].includes(value)) {
-              item.hidden = false
-            }
-            return item
-          })
-        })
+        this.props.form.setFieldsValue(_fieldval)
       })
     } else if (key === 'position') {
+      let _fieldval = {}
+
       this.setState({
         position: value,
         formlist: this.state.formlist.map(item => {
           if (item.key === 'Ot') {
             if (this.state.openType === 'innerpage' || value === 'grid') {
               item.options = this.state.reqOptionSgl
-              item.initVal = 'requiredSgl'
-              item.hidden = true
+              _fieldval.Ot = 'requiredSgl'
             } else if (['outerpage', 'blank', 'tab', 'popview'].includes(this.state.openType)) {
               item.options = this.state.reqOptions
-              item.initVal = 'requiredSgl'
-              item.hidden = true
+              _fieldval.Ot = 'requiredSgl'
             } else {
               item.options = this.state.reqOptionsMutil
             }
@@ -257,17 +255,11 @@
           return item
         })
       }, () => {
-        this.setState({
-          formlist: this.state.formlist.map(item => {
-            if (item.key === 'Ot') {
-              item.hidden = false
-            }
-            return item
-          })
-        })
+        this.props.form.setFieldsValue(_fieldval)
       })
     } else if (key === 'tabType') {
       let _tabs = this.props.tabs.filter(tab => tab.type === value)
+      let _fieldval = {}
 
       this.setState({
         formlist: this.state.formlist.map(item => {
@@ -279,20 +271,12 @@
               },
               ..._tabs
             ]
-            item.initVal = ''
-            item.hidden = true
+            _fieldval.linkTab = ''
           }
           return item
         })
       }, () => {
-        this.setState({
-          formlist: this.state.formlist.map(item => {
-            if (item.key === 'linkTab') {
-              item.hidden = false
-            }
-            return item
-          })
-        })
+        this.props.form.setFieldsValue(_fieldval)
       })
     }
   }
@@ -306,10 +290,12 @@
       } else {
         _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method']
       }
+
       this.setState({
         interType: value,
         formlist: this.state.formlist.map(item => {
           item.hidden = !_options.includes(item.key)
+
           if (item.key === 'interface') {
             item.readonly = false
           } else if (item.key === 'sysInterface') {
diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx
index feacc6b..5fcbc29 100644
--- a/src/templates/comtableconfig/index.jsx
+++ b/src/templates/comtableconfig/index.jsx
@@ -47,8 +47,6 @@
   state = {
     dict: CommonDict,        // 瀛楀吀
     config: null,            // 椤甸潰閰嶇疆
-    visible: false,          // 鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪锛屾ā鎬佹鏄剧ず鎺у埗
-    modalTitle: '',          // 妯℃�佹鐨勬爣棰�
     tableVisible: false,     // 鏁版嵁琛ㄥ瓧娈垫ā鎬佹
     addType: '',             // 娣诲姞绫诲瀷-鎼滅储鏉′欢鎴栨樉绀哄垪
     tableColumns: [],        // 琛ㄦ牸鏄剧ず鍒�
@@ -67,7 +65,7 @@
     originMenu: null,        // 鍘熷鑿滃崟
     originActions: null,     // 鍘熷鎸夐挳淇℃伅锛屼娇鐢ㄥ凡鏈夌敤鎴锋ā鏉�
     delActions: [],          // 鍒犻櫎鎸夐挳鍒楄〃
-    copyActions: [],         // 鍒犻櫎鎸夐挳鍒楄〃
+    copyActions: [],         // 澶嶅埗鎸夐挳缁�
     funcLoading: false,      // 瀛樺偍杩囩▼鍒涘缓涓�
     showColumnName: false,   // 鏄剧ず鍒楀瓧娈靛悕鎺у埗
     tabviews: [],            // 鎵�鏈夋爣绛鹃〉
@@ -349,10 +347,13 @@
     this.setState({
       modaltype: type === 'copy' ? 'actionCopy' : 'actionEdit',
       card: card,
-      formlist: getActionForm(card, functip, this.state.config, this.props.permFuncField)
+      formlist: getActionForm(card, functip, this.state.config, this.props.permFuncField, 'main')
     })
   }
 
+  /**
+   * @description 鏄剧ず鍒椾笌鍚堝苟鍒楃紪杈戯紝鑾峰彇琛ㄥ崟淇℃伅
+   */
   handleColumn = (card) => {
     if (card.type !== 'colspan') {
       this.setState({
@@ -368,6 +369,9 @@
     }
   }
 
+  /**
+   * @description 鏍囩缂栬緫锛岀瓫閫夊彲閫夌殑涓嬬骇鏍囩涓庡凡鍏宠仈鐨勪笅绾ф爣绛�
+   */
   handleTab = (card) => {
     const { config } = this.state
 
@@ -386,12 +390,12 @@
       let _tabMap = new Map()
       let _usedTabMap = new Map()
 
-      config[nextTabId].forEach(tab => { // 涓嬬骇鎵�鏈夌殑鏍囩
+      config[nextTabId].forEach(tab => {        // 涓嬬骇鎵�鏈夌殑鏍囩
         menus.push(tab)
         _tabMap.set(tab.uuid, true)
       })
 
-      config[card.groupId].forEach(tab => { // 鍚岀骇鏍囩宸查�夌殑涓嬬骇鏍囩
+      config[card.groupId].forEach(tab => {     // 鍚岀骇鏍囩宸查�夌殑涓嬬骇鏍囩
         if (tab.uuid === card.uuid) return
 
         tab.subtabs.forEach(subtab => {
@@ -403,7 +407,7 @@
         _usedTabMap.set(subtab, true)
       })
 
-      subtabs = subtabs.filter(tab => _tabMap.has(tab.uuid) && !_usedTabMap.has(tab.uuid))
+      subtabs = subtabs.filter(tabId => _tabMap.has(tabId) && !_usedTabMap.has(tabId))
       menus = menus.filter(tab => !_usedTabMap.has(tab.uuid))
     } else {
       subtabs = []
@@ -474,6 +478,9 @@
     })
   }
 
+  /**
+   * @description 鎿嶄綔鍒楃紪杈�
+   */
   handleGridBtn = () => {
     this.setState({
       modaltype: 'gridbtn'
@@ -484,7 +491,7 @@
    * @description 鎼滅储銆佹寜閽�佹樉绀哄垪淇敼鍚庢彁浜や繚瀛�
    * 1銆佹悳绱㈡潯浠朵繚瀛�
    * 2銆佹寜閽寘鎷甯哥紪杈戝拰澶嶅埗锛屽鍒舵椂,鏈熬娣诲姞,濡傛寜閽负琛ㄥ崟锛堜繚瀛樿嚦鏁版嵁搴擄級锛屽鍒舵寜閽甶d瀛樹簬澶嶅埗鍒楄〃锛堢偣鍑讳笉淇濆瓨鏃跺垹闄わ級
-   * 3銆佹坊鍔犳垨缂栬緫鍒楋紝淇濆瓨鏃讹紝濡傛寜閽綅缃缃负琛ㄦ牸锛屽垯淇敼鎿嶄綔鍒楁樉绀虹姸鎬�
+   * 3銆佸鎸夐挳浣嶇疆璁剧疆涓鸿〃鏍硷紝鍒欎慨鏀规搷浣滃垪鏄剧ず鐘舵��
    */
   handleSubmit = () => {
     const { menu } = this.props
@@ -557,7 +564,7 @@
 
         // 鍒ゆ柇鏄惁瀛樺湪鎿嶄綔鍒�
         let _hasGridbtn = _action.filter(act => act.position === 'grid').length > 0
-        let _gridBtn = {...config.gridBtn}
+        let _gridBtn = config.gridBtn
 
         if (_gridBtn) {
           _gridBtn.display = _hasGridbtn
@@ -605,20 +612,14 @@
       })
     } else if (modaltype === 'tabs') {
       this.tabsFormRef.handleConfirm().then(res => {
-        let isupdate = false
         let _tabgroup = config[res.values.groupId].map(item => {
           if (item.uuid === res.values.uuid) {
-            isupdate = true
             return res.values
           } else {
             return item
           }
         })
         _tabgroup = _tabgroup.filter(item => !item.origin)
-  
-        if (!isupdate) { // 鎿嶄綔涓嶆槸淇敼锛屾坊鍔犲厓绱犺嚦鍒楄〃
-          _tabgroup.push(res.values)
-        }
 
         this.setState({
           config: {...config, [res.values.groupId]: _tabgroup},
@@ -628,6 +629,9 @@
     }
   }
 
+  /**
+   * @description 鍙栨秷淇濆瓨锛屽鏋滃厓绱犱负鏂版坊鍏冪礌锛屽垯浠庡簭鍒椾腑鍒犻櫎
+   */
   editModalCancel = () => {
     const { config, card, modaltype } = this.state
 
@@ -642,6 +646,9 @@
       } else if (modaltype === 'columns' || modaltype === 'colspan') {
         let _columns = config.columns.filter(item => item.uuid !== card.uuid)
         _config = {...config, columns: _columns}
+      } else if (modaltype === 'tabs') {
+        let _tabgroup = config[card.groupId].filter(item => item.uuid !== card.uuid)
+        _config = {...config, [card.groupId]: _tabgroup}
       } else {
         _config = config
       }
@@ -664,7 +671,7 @@
    */
   creatFunc = () => {
     const { menu } = this.props
-    let _config = JSON.parse(JSON.stringify(this.state.config))
+    const { config } = this.state
 
     this.actionFormRef.handleConfirm().then(res => {
       let btn = res         // 鎸夐挳淇℃伅
@@ -719,11 +726,11 @@
 
               let _param = {
                 funcName: btn.innerFunc,
-                name: _config.setting.tableName || '',
+                name: config.setting.tableName || '',
                 fields: fields,
                 menuNo: menu.MenuNo
               }
-              newLText = Utils.formatOptions(Utils.getfunc(_param, btn, menu, _config))
+              newLText = Utils.formatOptions(Utils.getfunc(_param, btn, menu, config))
               DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName))
               resolve(true)
             } else {
@@ -738,18 +745,17 @@
         } else {
           let _param = {
             funcName: btn.innerFunc,
-            name: _config.setting.tableName || '',
+            name: config.setting.tableName || '',
             fields: '',
             menuNo: menu.MenuNo
           }
-          newLText = Utils.formatOptions(Utils.getfunc(_param, btn, menu, _config))
+          newLText = Utils.formatOptions(Utils.getfunc(_param, btn, menu, config))
           DelText = Utils.formatOptions(Utils.dropfunc(_param.funcName))
           resolve(true)
         }
       }).then(res => {
         // 鑾峰彇浜戠鍙婃湰鍦帮紝鏄惁宸插瓨鍦ㄨ瀛樺偍杩囩▼鐨勪俊鎭�
         if (res === false) return res
-        if (res !== false) return false
 
         let sysDefer = new Promise(resolve => {
           Api.getSystemConfig({
@@ -918,34 +924,24 @@
           return
         }
 
-        let isupdate = false
-        _config.action = _config.action.map(item => {
+        let _action = config.action.map(item => {
           if (item.uuid === btn.uuid) {
-            isupdate = true
             return btn
           } else {
             return item
           }
         })
-        _config.action = _config.action.filter(item => !item.origin)
+        _action = _action.filter(item => !item.origin)
 
+        // 鍒ゆ柇鏄惁瀛樺湪鎿嶄綔鍒�
+        let _hasGridbtn = _action.filter(act => act.position === 'grid').length > 0
+        let _gridBtn = config.gridBtn
 
-        if (!isupdate) { // 鎿嶄綔涓嶆槸淇敼锛屾坊鍔犲厓绱犺嚦鍒楄〃
-          _config.action.push(btn)
-        }
-
-        let gridbtn = _config.action.filter(act => act.position === 'grid')
-        let _display = false
-
-        if (gridbtn.length > 0) {
-          _display = true
-        }
-
-        if (_config.gridBtn) {
-          _config.gridBtn.display = _display
+        if (_gridBtn) {
+          _gridBtn.display = _hasGridbtn
         } else {
-          _config.gridBtn = {
-            display: _display,
+          _gridBtn = {
+            display: _hasGridbtn,
             Align: 'center',
             IsSort: 'false',
             uuid: Utils.getuuid(),
@@ -958,7 +954,7 @@
         }
 
         this.setState({
-          config: _config,
+          config: {...config, action: _action, gridBtn: _gridBtn},
           funcLoading: false
         })
       })
@@ -1187,30 +1183,40 @@
   }
 
   deleteElement = (element) => {
+    const { config } = this.state
     let _this = this
+
     confirm({
       content: `纭畾鍒犻櫎<<${element.card.label}>>鍚楋紵`,
       okText: this.state.dict['header.confirm'],
       cancelText: this.state.dict['header.cancel'],
       onOk() {
-        let _config = JSON.parse(JSON.stringify(_this.state.config))
+        let _config = null
 
         if (element.type === 'tabs') {
-          _config[element.card.groupId] = _config[element.card.groupId].filter(item => {
+          let _tabgroup = config[element.card.groupId].filter(item => {
             if (item.uuid === element.card.uuid) {
               return false
             } else {
               return true
             }
           })
+          _config = {...config, [element.card.groupId]: _tabgroup}
         } else {
-          _config[element.type] = _config[element.type].filter(item => {
+          let list = config[element.type].filter(item => {
             if (item.uuid === element.card.uuid) {
               return false
             } else {
               return true
             }
           })
+          
+          _config = {...config, [element.type]: list}
+
+          // 鍒犻櫎鎸夐挳鏃跺垽鏂槸鍚﹀瓨鍦ㄦ搷浣滃垪
+          if (element.type === 'action' && _config.gridBtn) {
+            _config.gridBtn.display = _config.action.filter(act => act.position === 'grid').length > 0
+          }
         }
 
         _this.setState({
@@ -1315,9 +1321,9 @@
         return
       }
 
-      let btnParam = { // 娣诲姞鑿滃崟鎸夐挳
+      let btnParam = {             // 娣诲姞鑿滃崟鎸夐挳
         func: 'sPC_Button_AddUpt',
-        Type: 40, // 娣诲姞鑿滃崟涓嬬殑鎸夐挳
+        Type: 40,                  // 娣诲姞鑿滃崟涓嬬殑鎸夐挳type涓�40锛屾寜閽笅鐨勬寜閽畉ype涓�60
         ParentID: menu.MenuID,
         MenuNo: res.menuNo,
         Template: menu.PageParam.Template || '',
@@ -1406,7 +1412,7 @@
   }
 
   /**
-   * @description 淇濆瓨鎴栦慨鏀硅彍鍗曟寜閽�
+   * @description 淇濆瓨鎴栦慨鏀硅彍鍗曟寜閽泦
    */
   submitAction = (btnParam, tabParam) => {
     const { config } = this.state
@@ -1559,6 +1565,9 @@
     })
   }
 
+  /**
+   * @description 鐐瑰嚮杩斿洖鏃讹紝鍒ゆ柇閰嶇疆淇濆瓨鐘舵��
+   */
   cancelConfig = () => {
     const { menu } = this.props
     const { config, originMenu } = this.state
@@ -1613,6 +1622,9 @@
     }
   }
 
+  /**
+   * @description 绛涢�夊彲鐢ㄥ瓧娈甸泦
+   */
   queryField = (type) => {
     const {selectedTables, tableColumns, config} = this.state
     // 鍒ゆ柇鏄惁宸查�夋嫨琛ㄥ悕
@@ -1659,7 +1671,12 @@
     })
   }
 
+  /**
+   * @description 娣诲姞瀛楁闆�
+   */
   addFieldSubmit = () => {
+    const {addType, config} = this.state
+
     // 瀛楁闆嗕负绌猴紝鍏抽棴寮圭獥
     if (!this.state.fields || this.state.fields.length === 0) {
       this.setState({
@@ -1668,7 +1685,6 @@
       })
     }
 
-    const {addType, config} = this.state
     const textmatch = { // 閫夋嫨text鏃跺尮閰嶈鍒�
       text: 'like',
       number: 'like',
@@ -1690,23 +1706,31 @@
 
     // 鑾峰彇宸查�夊瓧娈甸泦鍚�
     let cards = this.refs.searchcard.state.selectCards
+
+    if (cards.length === 0) {
+      notification.warning({
+        top: 92,
+        message: '璇烽�夋嫨娣诲姞瀛楁',
+        duration: 10
+      })
+      return
+    }
+
     let columnsMap = new Map()
     cards.forEach(card => {
       columnsMap.set(card.field, card)
     })
 
-    let items = []
     if (addType === 'search') {
-      config.search.forEach(item => {
+      let _search = config.search.filter(item => !item.origin)
+
+      // 閲嶇疆鍘熸湁鎼滅礌鏉′欢
+      _search = _search.map(item => {
         if (columnsMap.has(item.field)) {
           let cell = columnsMap.get(item.field)
 
-          if (cell.selected && cell.type === item.type) { // 鏁版嵁鏈慨鏀�
-            items.push(item)
-          } else if (cell.selected) { // 鏁版嵁绫诲瀷淇敼
-            if (cell.type === 'text') {
-              item.match = textmatch[cell.datatype]
-            } else if (cell.type === 'select') {
+          if (cell.type !== item.type) { // 鏁版嵁绫诲瀷淇敼
+            if (cell.type === 'select') {
               item.match = selectmatch[cell.datatype]
             } else if (cell.type === 'daterange') {
               item.match = datematch[cell.datatype]
@@ -1717,101 +1741,95 @@
             
             item.type = cell.type
             item.initval = ''
-            items.push(item)
           }
           columnsMap.delete(item.field)
-        } else if (!item.origin) {
-          items.push(item)
         }
+        return item
       })
-
+      
       let _columns = [...columnsMap.values()]
 
+      // 椤哄簭娣诲姞鏂板鎼滅储
       _columns.forEach(item => {
-        if (item.selected) {
-          let _match = ''
-          if (item.type === 'text') {
-            _match = textmatch[item.datatype]
-          } else if (item.type === 'select') {
-            _match = selectmatch[item.datatype]
-          } else if (item.type === 'daterange') {
-            _match = datematch[item.datatype]
-          } else {
-            item.type = 'text'
-            _match = textmatch[item.datatype]
-          }
-
-          let newcard = {
-            uuid: Utils.getuuid(),
-            label: item.label,
-            field: item.field,
-            initval: '',
-            type: item.type,
-            resourceType: '0',
-            setAll: 'false',
-            options: [],
-            dataSource: '',
-            linkField: '',
-            valueField: '',
-            valueText: '',
-            orderBy: '',
-            orderType: 'asc',
-            match: _match,
-            display: 'dropdown'
-          }
-
-          items.push(newcard)
+        let _match = ''
+        if (item.type === 'select') {
+          _match = selectmatch[item.datatype]
+        } else if (item.type === 'daterange') {
+          _match = datematch[item.datatype]
+        } else {
+          _match = textmatch[item.datatype]
         }
+
+        let newcard = {
+          uuid: Utils.getuuid(),
+          label: item.label,
+          field: item.field,
+          initval: '',
+          type: item.type || 'text',
+          resourceType: '0',
+          setAll: 'false',
+          options: [],
+          orderType: 'asc',
+          match: _match,
+          display: 'dropdown'
+        }
+
+        _search.push(newcard)
+      })
+
+      this.setState({
+        config: {...config, search: _search}
       })
     } else {
-      config.columns.forEach(item => {
+      let _columns = config.columns.filter(item => !item.origin)
+
+      // 閲嶇疆鍘熸湁鏄剧ず鍒楃被鍨�
+      _columns = _columns.map(item => {
         if (columnsMap.has(item.field)) {
           let cell = columnsMap.get(item.field)
 
-          if (cell.selected) {
-            items.push(item)
+          if (cell.type) {
+            item.type = cell.type
           }
+
           columnsMap.delete(item.field)
-        } else if (!item.origin) {
-          items.push(item)
         }
+        return item
       })
 
-      let _columns = [...columnsMap.values()]
+      let _cols = [...columnsMap.values()]
 
-      _columns.forEach(item => {
-        if (item.selected) {
-          let newcard = {
-            uuid: Utils.getuuid(),
-            Align: 'left',
-            label: item.label,
-            field: item.field,
-            Hide: 'false',
-            IsSort: item.type === 'picture' ? 'false' : 'true',
-            type: item.type,
-            Width: 120
-          }
-
-          items.push(newcard)
+      // 娣诲姞鏄剧ず鍒�
+      _cols.forEach(item => {
+        let newcard = {
+          uuid: Utils.getuuid(),
+          Align: 'left',
+          label: item.label,
+          field: item.field,
+          Hide: 'false',
+          IsSort: item.type === 'picture' ? 'false' : 'true',
+          type: item.type,
+          Width: 120
         }
+
+        _columns.push(newcard)
+      })
+
+      this.setState({
+        config: {...config, columns: _columns}
       })
     }
 
-    this.setState({
-      [addType + 'loading']: true,
-      config: {...config, [addType]: items}
-    }, () => {
-      notification.success({
-        top: 92,
-        message: '鎿嶄綔鎴愬姛',
-        duration: 2
-      })
-      this.setState({
-        [addType + 'loading']: false
-      })
+    notification.success({
+      top: 92,
+      message: '鎿嶄綔鎴愬姛',
+      duration: 2
     })
   }
 
+  /**
+   * @description 琛ㄥ悕鍒囨崲鏃讹紝娣诲姞琛ㄥ悕锛屾柊澧炴椂鏌ヨ琛ㄧ浉鍏冲瓧娈�
+   */
   onTableChange = (value) => {
     const {tables, selectedTables, tableColumns} = this.state
 
@@ -1867,6 +1885,9 @@
     }
   }
 
+  /**
+   * @description 鍒犻櫎琛ㄥ悕浠ュ強琛ㄧ浉鍏冲瓧娈�
+   */
   deleteTable = (table) => {
     const {selectedTables, tableColumns} = this.state
 
@@ -1876,12 +1897,18 @@
     })
   }
 
+  /**
+   * @description 椤甸潰閰嶇疆淇℃伅妯℃�佹鏄剧ず
+   */
   changeSetting = () => {
     this.setState({
       settingVisible: true
     })
   }
 
+  /**
+   * @description 淇濆瓨椤甸潰閰嶇疆淇℃伅
+   */
   settingSave = () => {
     const { menu } = this.props
     const {config} = this.state
@@ -2024,7 +2051,10 @@
     }
   }
 
-  onEnabledChange = (val, e) => {
+  /**
+   * @description 椤甸潰鍚敤鍋滄鍒囨崲
+   */
+  onEnabledChange = () => {
     const { config } = this.state
 
     let tabinvalid = true
@@ -2055,6 +2085,9 @@
     }
   }
 
+  /**
+   * @description 鏄剧ず闅愯棌鏄剧ず鍒楀瓧娈靛悕
+   */
   onColumnNameChange = () => {
     const { showColumnName } = this.state
 
@@ -2063,6 +2096,9 @@
     })
   }
 
+  /**
+   * @description 澧炲姞鏍囩椤靛垎缁�
+   */
   addTabGroup = () => {
     let _this = this
     let _config = JSON.parse(JSON.stringify(this.state.config))
@@ -2085,6 +2121,9 @@
     })
   }
 
+  /**
+   * @description 鍒犻櫎鏍囩椤靛垎缁�
+   */
   delTabGroup = (groupId) => {
     let _this = this
     let _config = JSON.parse(JSON.stringify(this.state.config))
@@ -2106,6 +2145,9 @@
     })
   }
 
+  /**
+   * @description 閫夋嫨涓嶄繚瀛樻椂锛屽鏈夊鍒舵寜閽紝鍒欏垹闄�
+   */
   notsave = () => {
     this.state.copyActions.forEach(item => {
       let _param = {
@@ -2120,7 +2162,8 @@
   render () {
     const { modaltype } = this.state
     const configAction = this.state.config.action.filter(_action =>
-      !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview' || _action.OpenType === 'blank' || _action.OpenType === 'tab')
+      !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview')
+      // !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview' || _action.OpenType === 'blank' || _action.OpenType === 'tab')
     )
 
     let configTabs = []
@@ -2405,7 +2448,7 @@
             wrappedComponentRef={(inst) => this.columnFormRef = inst}
           />
         </Modal>
-        {/* 鍚堝苟鍒楃紪杈� */}
+        {/* 鎿嶄綔鍒楃紪杈� */}
         <Modal
           title={this.state.dict['header.modal.gridbtn.edit']}
           visible={modaltype === 'gridbtn'}
diff --git a/src/templates/comtableconfig/settingform/index.jsx b/src/templates/comtableconfig/settingform/index.jsx
index 14b8934..6a41881 100644
--- a/src/templates/comtableconfig/settingform/index.jsx
+++ b/src/templates/comtableconfig/settingform/index.jsx
@@ -81,7 +81,6 @@
   }
 
   selectChange = (val) => {
-    // let _order = this.props.form.getFieldValue('order')
     this.props.form.setFieldsValue({
       order: `${val} desc`
     })
diff --git a/src/templates/comtableconfig/source.jsx b/src/templates/comtableconfig/source.jsx
index c0240de..4e35dcc 100644
--- a/src/templates/comtableconfig/source.jsx
+++ b/src/templates/comtableconfig/source.jsx
@@ -35,11 +35,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         match: 'like',
         display: 'dropdown'
@@ -53,11 +48,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         match: 'equal',
         display: 'dropdown'
@@ -71,11 +61,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         match: 'greater',
         display: 'dropdown'
@@ -87,21 +72,13 @@
         uuid: Utils.getuuid(),
         label: 'add',
         intertype: 'inner',
-        innerFunc: '',
-        interface: '',
         method: 'POST',
-        outerFunc: '',
-        sql: '',
-        sqlType: '',
-        callbackFunc: '',
         Ot: 'notRequired',
         position: 'toolbar',
         execSuccess: 'grid',
         execError: 'never',
         errorTime: 15,
         OpenType: 'pop',
-        pageTemplate: '',
-        url: '',
         icon: 'plus',
         class: 'green',
         verify: null
@@ -110,21 +87,13 @@
         uuid: Utils.getuuid(),
         label: 'update',
         intertype: 'inner',
-        innerFunc: '',
-        interface: '',
         method: 'POST',
-        outerFunc: '',
-        sql: '',
-        sqlType: '',
-        callbackFunc: '',
         Ot: 'requiredSgl',
         position: 'grid',
         execSuccess: 'grid',
         execError: 'never',
         errorTime: 15,
         OpenType: 'pop',
-        pageTemplate: '',
-        url: '',
         icon: 'form',
         class: 'purple',
         verify: null
@@ -133,21 +102,13 @@
         uuid: Utils.getuuid(),
         label: 'delete',
         intertype: 'inner',
-        innerFunc: '',
-        interface: '',
         method: 'POST',
-        outerFunc: '',
-        sql: '',
-        sqlType: '',
-        callbackFunc: '',
         Ot: 'required',
         position: 'toolbar',
         execSuccess: 'grid',
         execError: 'never',
         errorTime: 15,
         OpenType: 'prompt',
-        pageTemplate: '',
-        url: '',
         icon: 'delete',
         class: 'red',
         verify: null
diff --git a/src/templates/comtableconfig/tabdragelement/index.jsx b/src/templates/comtableconfig/tabdragelement/index.jsx
index 0c9d518..b5156e3 100644
--- a/src/templates/comtableconfig/tabdragelement/index.jsx
+++ b/src/templates/comtableconfig/tabdragelement/index.jsx
@@ -52,6 +52,7 @@
       newcard.subtabs = []
       newcard.supMenu = ''
       newcard.groupId = groupId
+      newcard.focus = true
       
       let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
       if (target) {
diff --git a/src/templates/comtableconfig/tabform/index.jsx b/src/templates/comtableconfig/tabform/index.jsx
index c585f69..bc53aa2 100644
--- a/src/templates/comtableconfig/tabform/index.jsx
+++ b/src/templates/comtableconfig/tabform/index.jsx
@@ -51,6 +51,19 @@
     })
   }
 
+  componentDidMount () {
+    const { card } = this.props
+
+    if (card.focus) {
+      try {
+        let _form = document.getElementById('label')
+        _form.select()
+      } catch {
+        console.warn('琛ㄥ崟focus澶辫触锛�')
+      }
+    }
+  }
+
   /**
    * @description 鏍囩椤电被鍨嬪垏鎹�
    */
diff --git a/src/templates/subtableconfig/actionform/index.jsx b/src/templates/subtableconfig/actionform/index.jsx
index 61aa516..71162c6 100644
--- a/src/templates/subtableconfig/actionform/index.jsx
+++ b/src/templates/subtableconfig/actionform/index.jsx
@@ -458,7 +458,6 @@
     return new Promise((resolve, reject) => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
-          values.id = this.props.card.id
           values.uuid = this.props.card.uuid
           values.verify = this.props.card.verify || null
 
@@ -480,10 +479,7 @@
               duration: 10
             })
           } else {
-            resolve({
-              type: 'action',
-              values
-            })
+            resolve(values)
           }
         } else {
           reject(err)
diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index 1735682..e2196ff 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -6,7 +6,13 @@
 import HTML5Backend from 'react-dnd-html5-backend'
 import { Button, Card, Modal, Collapse, notification, Spin, Select, List, Icon, Empty, Switch, Tooltip } from 'antd'
 import moment from 'moment'
+
 import Api from '@/api'
+import zhCN from '@/locales/zh-CN/comtable.js'
+import enUS from '@/locales/en-US/comtable.js'
+import Utils from '@/utils/utils.js'
+import { getSearchForm, getActionForm, getColumnForm } from '@/templates/tableshare/formconfig'
+
 import ActionForm from './actionform'
 import SettingForm from './settingform'
 import SearchForm from '@/templates/tableshare/searchform'
@@ -18,9 +24,6 @@
 import VerifyCard from '@/templates/tableshare/verifycard'
 import MenuForm from '@/templates/tableshare/menuform'
 import SourceElement from '@/templates/tableshare/dragelement/source'
-import zhCN from '@/locales/zh-CN/comtable.js'
-import enUS from '@/locales/en-US/comtable.js'
-import Utils from '@/utils/utils.js'
 import Source from './source'
 import './index.scss'
 
@@ -50,10 +53,8 @@
     menuformlist: null,      // 鍩烘湰淇℃伅琛ㄥ崟瀛楁
     formlist: null,          // 鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪琛ㄥ崟瀛楁
     formtemp: '',            // 琛ㄥ崟绫诲瀷锛屾樉绀哄垪銆佹寜閽�佹悳绱㈡潯浠�
+    modaltype: '',           // 妯℃�佹绫诲瀷锛屾帶鍒舵ā鎬佹鏄剧ず
     card: null,              // 缂栬緫鍏冪礌
-    searchloading: false,    // 鎼滅储鏉′欢鍔犺浇涓�
-    actionloading: false,    // 鎸夐挳鍔犺浇涓�
-    columnsloading: false,   // 鏄剧ず鍒楀姞杞戒腑
     menuloading: false,      // 鑿滃崟淇濆瓨涓�
     menucloseloading: false, // 鑿滃崟鍏抽棴鏃讹紝閫夋嫨淇濆瓨
     loading: false,          // 鍔犺浇涓紝椤甸潰spin
@@ -64,6 +65,7 @@
     originConfig: null,      // 鍘熼厤缃�
     originActions: null,     // 鍘熷鎸夐挳淇℃伅锛屼娇鐢ㄥ凡鏈夌敤鎴锋ā鏉�
     delActions: [],          // 鍒犻櫎鎸夐挳鍒楄〃
+    copyActions: [],         // 澶嶅埗鎸夐挳缁�
     funcLoading: false,      // 瀛樺偍杩囩▼鍒涘缓涓�
     showColumnName: false,   // 鏄剧ず鍒楀瓧娈靛悕鎺у埗
     tabviews: [],            // 鎵�鏈夋爣绛鹃〉
@@ -267,682 +269,79 @@
     }
   }
 
+  /**
+   * @description 鍏冪礌娣诲姞鎴栨嫋鍔ㄦ椂椤哄簭鍙樺寲
+   */
   handleList = (type, list, card) => {
     const { config } = this.state
 
     if (list.length > config[type].length) {
       list = list.filter(item => !item.origin)
 
-      this.setState({
-        [type + 'loading']: true,
-        config: {...config, [type]: list }
-      }, () => {
-        // 鍒锋柊瀵瑰簲鐨勯厤缃俊鎭�
-        this.setState({
-          [type + 'loading']: false
-        })
-
-        if (type === 'search') {
-          this.handleSearch(card)
-        } else if (type === 'action') {
-          this.handleAction(card)
-        } else if (type === 'columns') {
-          this.handleColumn(card)
-        }
-      })
-    } else {
-      this.setState({config: {...config, [type]: list}})
+      if (type === 'search') {
+        this.handleSearch(card)
+      } else if (type === 'action') {
+        this.handleAction(card)
+      } else if (type === 'columns') {
+        this.handleColumn(card)
+      }
     }
+
+    this.setState({config: {...config, [type]: list}})
   }
 
+  /**
+   * @description 鎼滅储鏉′欢缂栬緫锛岃幏鍙栨悳绱㈡潯浠惰〃鍗曚俊鎭�
+   */
   handleSearch = (card) => {
     this.setState({
-      visible: true,
-      formtemp: 'search',
-      modalTitle: '缂栬緫-鎼滅储鏉′欢',
+      modaltype: 'search',
       card: card,
-      formlist: [
-        {
-          type: 'text',
-          key: 'label',
-          label: this.state.dict['header.form.name'],
-          initVal: card.label,
-          required: true,
-          readonly: false
-        },
-        {
-          type: 'text',
-          key: 'field',
-          label: this.state.dict['header.form.field'],
-          initVal: card.field,
-          tooltip: '瀛楁鍚嶅彲浠ヤ娇鐢ㄩ�楀彿鍒嗛殧锛岃繘琛屽瀛楁缁煎悎鎼滅储锛屾敞锛氱患鍚堟悳绱粎鍦ㄦ枃鏈被鍨嬫椂鏈夋晥',
-          tooltipClass: 'middle',
-          required: true,
-          readonly: false
-        },
-        {
-          type: 'select',
-          key: 'type',
-          label: this.state.dict['header.form.type'],
-          initVal: card.type,
-          required: true,
-          options: [{
-            value: 'text',
-            text: this.state.dict['header.form.text']
-          }, {
-            value: 'select',
-            text: this.state.dict['header.form.select']
-          }, {
-            value: 'multiselect',
-            text: this.state.dict['header.form.multiselect']
-          }, {
-            value: 'link',
-            text: this.state.dict['header.form.link']
-          }, {
-            value: 'date',
-            text: this.state.dict['header.form.dateday']
-          }, {
-            value: 'dateweek',
-            text: this.state.dict['header.form.dateweek']
-          }, {
-            value: 'datemonth',
-            text: this.state.dict['header.form.datemonth']
-          }, {
-            value: 'daterange',
-            text: this.state.dict['header.form.daterange']
-          }]
-        },
-        {
-          type: 'text',
-          key: 'initval',
-          label: this.state.dict['header.form.initval'],
-          initVal: card.initval,
-          required: false
-        },
-        {
-          type: 'radio',
-          key: 'resourceType',
-          label: this.state.dict['header.form.resourceType'],
-          initVal: card.resourceType || '0',
-          required: true,
-          options: [{
-            value: '0',
-            text: this.state.dict['header.form.custom']
-          }, {
-            value: '1',
-            text: this.state.dict['header.form.datasource']
-          }]
-        },
-        {
-          type: 'radio',
-          key: 'setAll',
-          label: this.state.dict['header.form.setAll'],
-          initVal: card.setAll || 'false',
-          options: [{
-            value: 'true',
-            text: this.state.dict['header.form.true']
-          }, {
-            value: 'false',
-            text: this.state.dict['header.form.false']
-          }]
-        },
-        {
-          type: 'textarea',
-          key: 'dataSource',
-          label: this.state.dict['header.form.datasource'],
-          initVal: card.dataSource || '',
-          required: true,
-          readonly: false
-        },
-        {
-          type: 'options',
-          key: 'options',
-          label: '',
-          initVal: card.options || [],
-          required: true,
-          readonly: false
-        },
-        {
-          type: 'text',
-          key: 'linkField',
-          label: this.state.dict['header.form.linkField'],
-          initVal: card.linkField || '',
-          required: true,
-          readonly: false
-        },
-        {
-          type: 'text',
-          key: 'valueField',
-          label: this.state.dict['header.form.valueField'],
-          initVal: card.valueField || '',
-          required: true,
-          readonly: false
-        },
-        {
-          type: 'text',
-          key: 'valueText',
-          label: this.state.dict['header.form.valueText'],
-          initVal: card.valueText || '',
-          required: true,
-          readonly: false
-        },
-        {
-          type: 'text',
-          key: 'orderBy',
-          label: this.state.dict['header.form.orderBy'],
-          initVal: card.orderBy || '',
-          required: false,
-          readonly: false
-        },
-        {
-          type: 'select',
-          key: 'orderType',
-          label: this.state.dict['header.form.orderType'],
-          initVal: card.orderType || 'asc',
-          options: [{
-            value: 'asc',
-            text: this.state.dict['header.form.asc']
-          }, {
-            value: 'desc',
-            text: this.state.dict['header.form.desc']
-          }]
-        },
-        {
-          type: 'select',
-          key: 'match',
-          label: this.state.dict['header.form.match'],
-          initVal: card.match || 'like',
-          required: true,
-          options: [{
-            value: 'like',
-            text: 'like'
-          }, {
-            value: 'equal',
-            text: 'equal'
-          }, {
-            value: 'greater',
-            text: '>'
-          }, {
-            value: 'less',
-            text: '<'
-          }, {
-            value: 'greaterequal',
-            text: '>='
-          }]
-        },
-        {
-          type: 'select',
-          key: 'display',
-          label: this.state.dict['header.form.display'],
-          initVal: card.display || 'dropdown',
-          required: true,
-          options: [{
-            value: 'dropdown',
-            text: this.state.dict['header.form.dropdown']
-          }, {
-            value: 'button',
-            text: this.state.dict['header.form.button']
-          }]
-        }
-      ]
+      formlist: getSearchForm(card)
     })
   }
 
+  /**
+   * @description 鎸夐挳缂栬緫锛岃幏鍙栨寜閽〃鍗曚俊鎭�
+   */
   handleAction = (card, type) => {
     let ableField = this.props.permFuncField.join(', ')
+    let functip = <div>
+      <p style={{marginBottom: '5px'}}>{this.state.dict['header.modal.func.innerface'].replace('@ableField', ableField)}</p>
+      <p>{this.state.dict['header.modal.func.outface']}</p>
+    </div>
+
     this.setState({
-      visible: true,
-      formtemp: 'action',
-      modalTitle: type === 'copy' ? '澶嶅埗-鎸夐挳' : '缂栬緫-鎸夐挳',
+      modaltype: type === 'copy' ? 'actionCopy' : 'actionEdit',
       card: card,
-      formlist: [
-        {
-          type: 'text',
-          key: 'label',
-          label: this.state.dict['header.form.name'],
-          initVal: card.label,
-          required: true,
-          readonly: false
-        },
-        {
-          type: 'select',
-          key: 'OpenType',
-          label: this.state.dict['header.form.openType'],
-          initVal: card.OpenType,
-          required: true,
-          options: [{
-            value: 'pop',
-            text: this.state.dict['header.form.popform']
-          }, {
-            value: 'prompt',
-            text: this.state.dict['header.form.prompt']
-          }, {
-            value: 'exec',
-            text: this.state.dict['header.form.exec']
-          }, {
-            value: 'excelIn',
-            text: this.state.dict['header.form.excelIn']
-          }, {
-            value: 'excelOut',
-            text: this.state.dict['header.form.excelOut']
-          }, {
-            value: 'popview',
-            text: this.state.dict['header.form.popview']
-          }]
-        }, {
-          type: 'select',
-          key: 'tabType',
-          label: this.state.dict['header.form.tabType'],
-          initVal: card.tabType || 'SubTable',
-          required: true,
-          options: [{
-            value: 'SubTable',
-            text: this.state.dict['header.menu.tab.subtable']
-          }]
-        },
-        {
-          type: 'select',
-          key: 'linkTab',
-          label: '鍏宠仈鏍囩',
-          initVal: card.linkTab || '',
-          required: false,
-          options: []
-        },
-        {
-          type: 'radio',
-          key: 'intertype',
-          label: this.state.dict['header.form.intertype'],
-          initVal: card.intertype,
-          required: true,
-          options: [{
-            value: 'inner',
-            text: this.state.dict['header.form.interface.inner']
-          }, {
-            value: 'outer',
-            text: this.state.dict['header.form.interface.outer']
-          }]
-        },
-        {
-          type: 'text',
-          key: 'innerFunc',
-          label: this.state.dict['header.form.innerFunc'],
-          initVal: card.innerFunc,
-          tooltip: <div>
-            <p>鍐呴儴鎺ュ彛: 鍙嚜瀹氫箟鏁版嵁澶勭悊鍑芥暟锛屽嚱鏁板悕绉伴渶浠ableField}绛夊瓧绗﹀紑濮嬶紱鏈缃椂浼氳皟鐢ㄧ郴缁熷嚱鏁帮紝浣跨敤绯荤粺鍑芥暟闇�瀹屽杽鏁版嵁婧愬強鎿嶄綔绫诲瀷;</p>
-            <p>澶栭儴鎺ュ彛: 鍙嚜瀹氫箟鏁版嵁澶勭悊鍑芥暟锛屾彁浜ゆ暟鎹粡杩囧唴閮ㄥ嚱鏁板鐞嗗悗锛屼紶鍏ュ閮ㄦ帴鍙o紝鏈缃椂锛屾暟鎹細鐩存帴浼犲叆澶栭儴鎺ュ彛銆�</p>
-          </div>,
-          fields: this.props.permFuncField,
-          tooltipClass: 'middle',
-          required: false,
-          readonly: false
-        },
-        {
-          type: 'radio',
-          key: 'sysInterface',
-          label: this.state.dict['header.form.sysInterface'],
-          initVal: card.sysInterface || 'false',
-          required: true,
-          options: [{
-            value: 'true',
-            text: this.state.dict['header.form.true']
-          }, {
-            value: 'false',
-            text: this.state.dict['header.form.false']
-          }]
-        },
-        {
-          type: 'text',
-          key: 'outerFunc',
-          label: this.state.dict['header.form.outerFunc'],
-          initVal: card.outerFunc,
-          required: false,
-          readonly: false
-        },
-        {
-          type: 'text',
-          key: 'interface',
-          label: this.state.dict['header.form.interface'],
-          initVal: card.sysInterface === 'true' ? (window.GLOB.mainSystemApi || window.GLOB.subSystemApi) : card.interface,
-          required: true,
-          readonly: card.sysInterface === 'true'
-        },
-        {
-          type: 'text',
-          key: 'callbackFunc',
-          label: this.state.dict['header.form.callbackFunc'],
-          initVal: card.callbackFunc,
-          required: false,
-          readonly: false
-        },
-        {
-          type: 'select',
-          key: 'position',
-          label: this.state.dict['header.form.position'],
-          initVal: card.position || 'toolbar',
-          required: true,
-          options: [{
-            value: 'toolbar',
-            text: this.state.dict['header.form.toolbar']
-          }, {
-            value: 'grid',
-            text: this.state.dict['header.form.grid']
-          }]
-        },
-        {
-          type: 'select',
-          key: 'Ot',
-          label: this.state.dict['header.form.isRequired'],
-          initVal: card.Ot || 'requiredSgl',
-          required: true,
-          options: []
-        },
-        {
-          type: 'select',
-          key: 'execSuccess',
-          label: this.state.dict['header.form.execSuccess'],
-          initVal: card.execSuccess || 'never',
-          required: true,
-          options: [{
-            value: 'never',
-            text: this.state.dict['header.form.refresh.never']
-          }, {
-            value: 'grid',
-            text: this.state.dict['header.form.refresh.grid']
-          }, {
-            value: 'view',
-            text: this.state.dict['header.form.refresh.view']
-          }]
-        },
-        {
-          type: 'select',
-          key: 'execError',
-          label: this.state.dict['header.form.execError'],
-          initVal: card.execError || 'never',
-          required: true,
-          options: [{
-            value: 'never',
-            text: this.state.dict['header.form.refresh.never']
-          }, {
-            value: 'grid',
-            text: this.state.dict['header.form.refresh.grid']
-          }, {
-            value: 'view',
-            text: this.state.dict['header.form.refresh.view']
-          }]
-        },
-        {
-          type: 'select',
-          key: 'popClose',
-          label: this.state.dict['header.form.popClose'],
-          initVal: card.popClose || 'never',
-          required: true,
-          options: [{
-            value: 'never',
-            text: this.state.dict['header.form.refresh.never']
-          }, {
-            value: 'maingrid',
-            text: this.state.dict['header.form.refresh.maingrid']
-          }, {
-            value: 'subgrid',
-            text: this.state.dict['header.form.refresh.subgrid']
-          }]
-        },
-        {
-          type: 'select',
-          key: 'icon',
-          label: this.state.dict['header.form.icon'],
-          initVal: card.icon,
-          required: false,
-          options: []
-        },
-        {
-          type: 'select',
-          key: 'class',
-          label: this.state.dict['header.form.class'],
-          initVal: card.class,
-          required: false,
-          options: []
-        },
-        {
-          type: 'text',
-          key: 'sql',
-          label: this.state.dict['header.form.datasource'],
-          initVal: card.sql || this.state.config.setting.tableName || '',
-          tooltip: this.state.dict['header.form.actionhelp.datasource'],
-          required: false
-        },
-        {
-          type: 'select',
-          key: 'sqlType',
-          label: this.state.dict['header.form.action.type'],
-          initVal: card.sqlType || '',
-          tooltip: this.state.dict['header.form.actionhelp.sqlType'],
-          required: false,
-          options: []
-        }
-      ]
+      formlist: getActionForm(card, functip, this.state.config, this.props.permFuncField, 'subtable')
     })
   }
 
+  /**
+   * @description 鏄剧ず鍒椾笌鍚堝苟鍒楃紪杈戯紝鑾峰彇琛ㄥ崟淇℃伅
+   */
   handleColumn = (card) => {
     if (card.type !== 'colspan') {
       this.setState({
-        visible: true,
-        formtemp: 'columns',
-        modalTitle: '缂栬緫-鏄剧ず鍒�',
+        modaltype: 'columns',
         card: card,
-        formlist: [
-          {
-            type: 'text',
-            key: 'label',
-            label: this.state.dict['header.form.name'],
-            initVal: card.label,
-            required: true
-          },
-          {
-            type: 'text',
-            key: 'field',
-            label: this.state.dict['header.form.field'],
-            initVal: card.field,
-            required: true,
-            readonly: false
-          },
-          {
-            type: 'select',
-            key: 'type',
-            label: this.state.dict['header.form.type'],
-            initVal: card.type,
-            required: true,
-            options: [{
-              value: 'text',
-              text: this.state.dict['header.form.text']
-            }, {
-              value: 'picture',
-              text: this.state.dict['header.form.picture']
-            }, {
-              value: 'number',
-              text: this.state.dict['header.form.number']
-            }, {
-              value: 'textarea',
-              text: this.state.dict['header.form.textarea']
-            }]
-          },
-          {
-            type: 'select',
-            key: 'Align',
-            label: this.state.dict['header.form.align'],
-            initVal: card.Align,
-            required: true,
-            options: [{
-              value: 'left',
-              text: this.state.dict['header.form.alignLeft']
-            }, {
-              value: 'right',
-              text: this.state.dict['header.form.alignRight']
-            }, {
-              value: 'center',
-              text: this.state.dict['header.form.alignCenter']
-            }]
-          },
-          {
-            type: 'radio',
-            key: 'Hide',
-            label: this.state.dict['header.form.Hide'],
-            initVal: card.Hide,
-            required: true,
-            options: [{
-              value: 'true',
-              text: this.state.dict['header.form.true']
-            }, {
-              value: 'false',
-              text: this.state.dict['header.form.false']
-            }]
-          },
-          {
-            type: 'radio',
-            key: 'IsSort',
-            label: this.state.dict['header.form.IsSort'],
-            initVal: card.IsSort,
-            required: true,
-            options: [{
-              value: 'true',
-              text: this.state.dict['header.form.true']
-            }, {
-              value: 'false',
-              text: this.state.dict['header.form.false']
-            }]
-          },
-          {
-            type: 'number',
-            key: 'Width',
-            min: 1,
-            max: 1000,
-            decimal: 0,
-            label: this.state.dict['header.form.columnWidth'],
-            initVal: card.Width,
-            required: true
-          },
-          {
-            type: 'number',
-            key: 'decimal',
-            min: 0,
-            max: 18,
-            decimal: 0,
-            label: this.state.dict['header.form.decimal'],
-            initVal: card.decimal,
-            required: false
-          },
-          {
-            type: 'select',
-            key: 'format',
-            label: this.state.dict['header.form.format'],
-            initVal: card.format || '',
-            options: [{
-              value: '',
-              text: this.state.dict['header.form.empty']
-            }, {
-              value: 'thdSeparator',
-              text: this.state.dict['header.form.thdSeparator']
-            }],
-            required: false
-          },
-          {
-            type: 'text',
-            key: 'prefix',
-            label: this.state.dict['header.form.prefix'],
-            initVal: card.prefix || '',
-            required: false,
-            readonly: false
-          },
-          {
-            type: 'text',
-            key: 'postfix',
-            label: this.state.dict['header.form.postfix'],
-            initVal: card.postfix || '',
-            // tooltip: '鍚庣紑鍊艰缃负"\\n",琛ㄧず鎹㈣',
-            tooltipClass: 'middle',
-            required: false,
-            readonly: false
-          },
-          {
-            type: 'select',
-            key: 'match',
-            label: this.state.dict['header.form.match'],
-            initVal: card.match || '',
-            options: [{
-              value: '',
-              text: this.state.dict['header.form.empty']
-            }, {
-              value: '>',
-              text: '>'
-            }, {
-              value: '<',
-              text: '<'
-            }, {
-              value: '>=',
-              text: '>='
-            }, {
-              value: '<=',
-              text: '<='
-            }],
-            required: false
-          },
-          {
-            type: 'text',
-            key: 'matchVal',
-            min: -Infinity,
-            max: Infinity,
-            decimal: 0,
-            label: this.state.dict['header.form.matchVal'],
-            initVal: card.matchVal || '',
-            required: false,
-            readonly: false
-          },
-          {
-            type: 'select',
-            key: 'color',
-            label: this.state.dict['header.form.color'],
-            initVal: card.color || '',
-            options: [{
-              value: '',
-              text: this.state.dict['header.form.empty']
-            }, {
-              value: 'red',
-              text: '绾㈣壊锛堝唴瀹癸級'
-            }, {
-              value: 'redbg',
-              text: '绾㈣壊锛堣儗鏅級'
-            }, {
-              value: 'orange',
-              text: '姗欒壊锛堝唴瀹癸級'
-            }, {
-              value: 'orangebg',
-              text: '姗欒壊锛堣儗鏅級'
-            }, {
-              value: 'green',
-              text: '缁胯壊锛堝唴瀹癸級'
-            }, {
-              value: 'greenbg',
-              text: '缁胯壊锛堣儗鏅級'
-            }],
-            required: false
-          }
-        ]
+        formlist: getColumnForm(card)
       })
     } else {
       this.setState({
-        visible: true,
-        formtemp: 'columns',
+        modaltype: 'colspan',
         card: card
       })
     }
   }
 
+  /**
+   * @description 鎿嶄綔鍒楃紪杈�
+   */
   handleGridBtn = () => {
     this.setState({
-      visible: true,
-      formtemp: 'gridbtn',
-      modalTitle: '缂栬緫-鎿嶄綔鍒�',
+      modaltype: 'gridbtn'
     })
   }
 
@@ -953,14 +352,41 @@
    * 3銆佹坊鍔犳垨缂栬緫鍒楋紝淇濆瓨鏃讹紝濡傛寜閽綅缃缃负琛ㄦ牸锛屽垯淇敼鎿嶄綔鍒楁樉绀虹姸鎬�
    */
   handleSubmit = () => {
-    const { card } = this.state
-    let _config = JSON.parse(JSON.stringify(this.state.config))
+    const { card, config, modaltype } = this.state
 
-    if (this.state.formtemp !== 'gridbtn') {
-      this.formRef.handleConfirm().then(res => {
-        let isupdate = false
+    if (modaltype === 'search') {
+      this.searchFormRef.handleConfirm().then(res => {
+        let _search = config.search.map(item => {
+          if (item.uuid === res.uuid) {
+            return res
+          } else {
+            return item
+          }
+        })
+        _search = _search.filter(item => !item.origin)
 
-        if (res.type === 'action' && card.originCard && res.values.OpenType === 'pop') {
+        this.setState({
+          config: {...config, search: _search},
+          modaltype: ''
+        })
+      })
+    } else if (modaltype === 'actionEdit' || modaltype === 'actionCopy') {
+      this.actionFormRef.handleConfirm().then(res => {
+        let _action = config.action.map(item => {
+          if (item.uuid === res.uuid) {
+            return res
+          } else {
+            return item
+          }
+        })
+        _action = _action.filter(item => !item.origin)
+
+        if (modaltype === 'actionCopy') {
+          _action.push(res)
+        }
+
+        // 澶嶅埗鎸夐挳鍓嶅悗鐨嗕负琛ㄥ崟鏃讹紝澶嶅埗琛ㄥ崟閰嶇疆淇℃伅锛宨d瀛樹簬澶嶅埗鍒楄〃
+        if (res.OpenType === 'pop' && card.originCard && card.originCard.OpenType === 'pop') {
           Api.getSystemConfig({
             func: 'sPC_Get_LongParam',
             MenuID: card.originCard.uuid
@@ -968,11 +394,11 @@
             if (result.status && result.LongParam) {
               let param = {
                 func: 'sPC_ButtonParam_AddUpt',
-                ParentID: _config.uuid,
-                MenuID: res.values.uuid,
-                MenuNo: _config.tabNo,
+                ParentID: config.uuid,
+                MenuID: res.uuid,
+                MenuNo: config.tabNo,
                 Template: 'Modal',
-                MenuName: res.values.label,
+                MenuName: res.label,
                 PageParam: JSON.stringify({Template: 'Modal'}),
                 LongParam: result.LongParam
               }
@@ -983,73 +409,97 @@
                     message: response.message,
                     duration: 10
                   })
+                } else {
+                  this.setState({
+                    copyActions: [...this.state.copyActions, res.uuid]
+                  })
                 }
               })
             }
           })
         }
-  
-        _config[res.type] = _config[res.type].map(item => {
-          if (item.uuid === res.values.uuid) {
-            isupdate = true
-            return res.values
+
+        // 鍒ゆ柇鏄惁瀛樺湪鎿嶄綔鍒�
+        let _hasGridbtn = _action.filter(act => act.position === 'grid').length > 0
+        let _gridBtn = config.gridBtn
+
+        if (_gridBtn) {
+          _gridBtn.display = _hasGridbtn
+        } else {
+          _gridBtn = {
+            display: _hasGridbtn,
+            Align: 'center',
+            IsSort: 'false',
+            uuid: Utils.getuuid(),
+            label: this.state.dict['header.form.column.action'],
+            type: 'action',
+            style: 'button',
+            show: 'horizontal',
+            Width: 120
+          }
+        }
+
+        this.setState({
+          config: {...config, action: _action, gridBtn: _gridBtn},
+          modaltype: ''
+        })
+      })
+    } else if (modaltype === 'columns' || modaltype === 'colspan') {
+      this.columnFormRef.handleConfirm().then(res => {
+        let _columns = config.columns.map(item => {
+          if (item.uuid === res.uuid) {
+            return res
           } else {
             return item
           }
         })
-        _config[res.type] = _config[res.type].filter(item => !item.origin)
-  
-        if (!isupdate) { // 鎿嶄綔涓嶆槸淇敼锛屾坊鍔犲厓绱犺嚦鍒楄〃
-          _config[res.type].push(res.values)
-        }
-  
-        if (res.type === 'action') {
-          let gridbtn = _config.action.filter(act => act.position === 'grid')
-          let _display = false
-  
-          if (gridbtn.length > 0) {
-            _display = true
-          }
-  
-          if (_config.gridBtn) {
-            _config.gridBtn.display = _display
-          } else {
-            _config.gridBtn = {
-              display: _display,
-              Align: 'center',
-              IsSort: 'false',
-              uuid: Utils.getuuid(),
-              label: this.state.dict['header.form.column.action'],
-              type: 'action',
-              style: 'button',
-              show: 'horizontal',
-              Width: 120
-            }
-          }
-        }
-  
-        this.setState({
-          config: _config,
-          searchloading: true,
-          actionloading: true,
-          columnsloading: true,
-          visible: false
-        }, () => {
-          this.setState({
-            searchloading: false,
-            actionloading: false,
-            columnsloading: false,
-          })
-        })
-      })
-    } else {
-      this.formRef.handleConfirm().then(res => {
-        _config.gridBtn = res
+        _columns = _columns.filter(item => !item.origin)
 
         this.setState({
-          config: _config,
-          visible: false
+          config: {...config, columns: _columns},
+          modaltype: ''
         })
+      })
+    } else if (modaltype === 'gridbtn') {
+      this.gridBtnFormRef.handleConfirm().then(res => {
+        this.setState({
+          config: {...config, gridBtn: res},
+          modaltype: ''
+        })
+      })
+    }
+  }
+
+  /**
+   * @description 鍙栨秷淇濆瓨锛屽鏋滃厓绱犱负鏂版坊鍏冪礌锛屽垯浠庡簭鍒椾腑鍒犻櫎
+   */
+  editModalCancel = () => {
+    const { config, card, modaltype } = this.state
+
+    if (card.focus) {
+      let _config = null
+      if (modaltype === 'search') {
+        let _search = config.search.filter(item => item.uuid !== card.uuid)
+        _config = {...config, search: _search}
+      } else if (modaltype === 'actionEdit') {
+        let _action = config.action.filter(item => item.uuid !== card.uuid)
+        _config = {...config, action: _action}
+      } else if (modaltype === 'columns' || modaltype === 'colspan') {
+        let _columns = config.columns.filter(item => item.uuid !== card.uuid)
+        _config = {...config, columns: _columns}
+      } else {
+        _config = config
+      }
+
+      this.setState({
+        card: null,
+        config: _config,
+        modaltype: ''
+      })
+    } else {
+      this.setState({
+        card: null,
+        modaltype: ''
       })
     }
   }
@@ -1061,7 +511,7 @@
     let _config = JSON.parse(JSON.stringify(this.state.config))
 
     this.formRef.handleConfirm().then(res => {
-      let btn = res.values  // 鎸夐挳淇℃伅
+      let btn = res  // 鎸夐挳淇℃伅
       let newLText = ''     // 鍒涘缓瀛樺偍杩囩▼sql
       let DelText = ''      // 鍒犻櫎瀛樺偍杩囩▼sql
       let isExit = false    // 瀛樺偍杩囩▼鏄惁瀛樺湪
@@ -1311,10 +761,8 @@
           return
         }
 
-        let isupdate = false
         _config.action = _config.action.map(item => {
           if (item.uuid === btn.uuid) {
-            isupdate = true
             return btn
           } else {
             return item
@@ -1322,23 +770,14 @@
         })
         _config.action = _config.action.filter(item => !item.origin)
 
-
-        if (!isupdate) { // 鎿嶄綔涓嶆槸淇敼锛屾坊鍔犲厓绱犺嚦鍒楄〃
-          _config.action.push(btn)
-        }
-
-        let gridbtn = _config.action.filter(act => act.position === 'grid')
-        let _display = false
-
-        if (gridbtn.length > 0) {
-          _display = true
-        }
+        // 鍒ゆ柇鏄惁瀛樺湪鎿嶄綔鍒�
+        let _hasGridbtn = _config.action.filter(act => act.position === 'grid').length > 0
 
         if (_config.gridBtn) {
-          _config.gridBtn.display = _display
+          _config.gridBtn.display = _hasGridbtn
         } else {
           _config.gridBtn = {
-            display: _display,
+            display: _hasGridbtn,
             Align: 'center',
             IsSort: 'false',
             uuid: Utils.getuuid(),
@@ -1352,12 +791,7 @@
 
         this.setState({
           config: _config,
-          actionloading: true,
           funcLoading: false
-        }, () => {
-          this.setState({
-            actionloading: false
-          })
         })
       })
     })
@@ -1644,12 +1078,7 @@
     this.setState({
       profileVisible: false,
       config: config,
-      card: '',
-      actionloading: true
-    }, () => {
-      this.setState({
-        actionloading: false
-      })
+      card: ''
     })
   }
 
@@ -1735,21 +1164,11 @@
         if (response.status) {
           this.setState({
             config: _config,
-            originConfig: _config,
-            searchloading: true,
-            actionloading: true,
-            columnsloading: true
+            originConfig: _config
           }, () => {
             this.setState({
-              searchloading: false,
-              actionloading: false,
-              columnsloading: false
-            }, () => {
-
-              this.setState({
-                menuloading: false,
-                menucloseloading: false
-              })
+              menuloading: false,
+              menucloseloading: false
             })
             this.submitAction(btnParam)
           })
@@ -2255,11 +1674,6 @@
       this.setState({
         config: {...config, setting: res},
         settingVisible: false,
-        columnsloading: true
-      }, () => {
-        this.setState({
-          columnsloading: false
-        })
       })
     })
   }
@@ -2370,6 +1784,7 @@
   }
 
   render () {
+    const { modaltype } = this.state
     const configAction = this.state.config.action.filter(_action =>
       !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview' || _action.OpenType === 'blank' || _action.OpenType === 'tab')
     )
@@ -2478,7 +1893,6 @@
             <Card title={'鏍囩锛堝瓙琛級椤甸潰閰嶇疆'} bordered={false} extra={
               <div>
                 <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
-                {/* <Button type="primary" onClick={this.changeTemplate}>{this.state.dict['header.menu.template.change']}</Button> */}
                 <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['header.save']}</Button>
                 <Button onClick={this.cancelConfig}>{this.state.dict['header.return']}</Button>
               </div>
@@ -2488,111 +1902,134 @@
                 <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃悳绱€�嬩腑锛岄�夋嫨瀵瑰簲鎼滅储妗嗘嫋鑷虫澶勬坊鍔狅紱鎴栫偣鍑绘寜閽�婃坊鍔犳悳绱㈡潯浠躲�嬫壒閲忔坊鍔狅紝閫夋嫨鎵归噺娣诲姞鏃讹紝闇�鎻愬墠閫夋嫨浣跨敤琛ㄣ��">
                   <Icon type="question-circle" />
                 </Tooltip>
-                {!this.state.searchloading ?
-                  <DragElement
-                    type="search"
-                    list={this.state.config.search}
-                    handleList={this.handleList}
-                    handleMenu={this.handleSearch}
-                    deleteMenu={this.deleteElement}
-                    placeholder={this.state.dict['header.form.search.placeholder']}
-                  /> : null
-                }
+                <DragElement
+                  type="search"
+                  list={this.state.config.search}
+                  handleList={this.handleList}
+                  handleMenu={this.handleSearch}
+                  deleteMenu={this.deleteElement}
+                  placeholder={this.state.dict['header.form.search.placeholder']}
+                />
               </div>
               <div className="action-list">
                 <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃寜閽�嬩腑锛岄�夋嫨瀵瑰簲绫诲瀷鐨勬寜閽嫋鑷虫澶勬坊鍔狅紝濡傞�夋嫨鎸夐挳绫诲瀷涓鸿〃鍗曘�佹柊鏍囩椤电瓑鍚湁閰嶇疆椤甸潰鐨勬寜閽紝鍙湪宸︿晶宸ュ叿鏍�-鎸夐挳-鍙厤缃寜閽锛岀偣鍑绘寜閽畬鎴愮浉鍏抽厤缃�傛敞锛氬綋璁剧疆鎸夐挳鏄剧ず浣嶇疆涓鸿〃鏍兼椂锛屾樉绀哄垪浼氬鍔犳搷浣滃垪銆�">
                   <Icon type="question-circle" />
                 </Tooltip>
-                {!this.state.actionloading ?
-                  <DragElement
-                    type="action"
-                    list={this.state.config.action}
-                    handleList={this.handleList}
-                    handleMenu={this.handleAction}
-                    copyElement={(val) => this.handleAction(val, 'copy')}
-                    deleteMenu={this.deleteElement}
-                    profileMenu={this.profileAction}
-                    placeholder={this.state.dict['header.form.action.placeholder']}
-                  /> : null
-                }
+                <DragElement
+                  type="action"
+                  list={this.state.config.action}
+                  handleList={this.handleList}
+                  handleMenu={this.handleAction}
+                  copyElement={(val) => this.handleAction(val, 'copy')}
+                  deleteMenu={this.deleteElement}
+                  profileMenu={this.profileAction}
+                  placeholder={this.state.dict['header.form.action.placeholder']}
+                />
               </div>
               <div className="column-list">
                 <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃樉绀哄垪銆嬩腑锛岄�夋嫨瀵瑰簲绫诲瀷鐨勬樉绀哄垪鎷栬嚦姝ゅ娣诲姞锛涙垨鐐瑰嚮銆婃坊鍔犳樉绀哄垪銆嬫寜閽壒閲忔坊鍔狅紝閫夋嫨鎵归噺娣诲姞鏃讹紝闇�鎻愬墠閫夋嫨浣跨敤琛ㄣ�傛敞锛氭坊鍔犲悎骞跺垪鏃讹紝闇�璁剧疆鍙�夊垪銆�">
                   <Icon type="question-circle" />
                 </Tooltip>
                 <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showColumnName} onChange={this.onColumnNameChange} />
-                {!this.state.columnsloading ?
-                  <DragElement
-                    type="columns"
-                    list={this.state.config.columns}
-                    setting={this.state.config.setting}
-                    gridBtn={this.state.config.gridBtn}
-                    handleList={this.handleList}
-                    handleMenu={this.handleColumn}
-                    deleteMenu={this.deleteElement}
-                    handleGridBtn={this.handleGridBtn}
-                    showfield={this.state.showColumnName}
-                    placeholder={this.state.dict['header.form.column.placeholder']}
-                  /> : null
-                }
+                <DragElement
+                  type="columns"
+                  list={this.state.config.columns}
+                  setting={this.state.config.setting}
+                  gridBtn={this.state.config.gridBtn}
+                  handleList={this.handleList}
+                  handleMenu={this.handleColumn}
+                  deleteMenu={this.deleteElement}
+                  handleGridBtn={this.handleGridBtn}
+                  showfield={this.state.showColumnName}
+                  placeholder={this.state.dict['header.form.column.placeholder']}
+                />
               </div>
             </Card>
           </div>
         </DndProvider>
-        {/* 缂栬緫鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪 */}
+        {/* 缂栬緫鎼滅储鏉′欢 */}
         <Modal
-          title={this.state.modalTitle}
-          visible={this.state.visible}
+          title={this.state.dict['header.modal.search.edit']}
+          visible={modaltype === 'search'}
           width={700}
-          onCancel={() => { this.setState({ visible: false }) }}
+          onOk={this.handleSubmit}
+          onCancel={this.editModalCancel}
+          destroyOnClose
+        >
+          <SearchForm
+            dict={this.state.dict}
+            card={this.state.card}
+            formlist={this.state.formlist}
+            wrappedComponentRef={(inst) => this.searchFormRef = inst}
+          />
+        </Modal>
+        {/* 缂栬緫鎸夐挳锛氬鍒躲�佺紪杈� */}
+        <Modal
+          title={modaltype === 'actionEdit' ? this.state.dict['header.modal.action.edit'] : this.state.dict['header.modal.action.copy']}
+          visible={modaltype === 'actionEdit' || modaltype === 'actionCopy'}
+          width={700}
+          onCancel={this.editModalCancel}
           footer={[
-            this.state.formtemp === 'action' ?
-            <Button key="delete" className="mk-btn mk-purple" onClick={this.creatFunc} loading={this.state.funcLoading}>{this.state.dict['header.menu.func.create']}</Button> : null,
-            <Button key="cancel" onClick={() => { this.setState({ visible: false }) }}>{this.state.dict['header.cancel']}</Button>,
+            modaltype === 'actionEdit' ? <Button key="delete" className="mk-btn mk-purple" onClick={this.creatFunc} loading={this.state.funcLoading}>{this.state.dict['header.menu.func.create']}</Button> : null,
+            <Button key="cancel" onClick={this.editModalCancel}>{this.state.dict['header.cancel']}</Button>,
             <Button key="confirm" type="primary" onClick={this.handleSubmit}>{this.state.dict['header.confirm']}</Button>
           ]}
           destroyOnClose
         >
-          {this.state.formtemp === 'search' ?
-            <SearchForm
-              dict={this.state.dict}
-              formlist={this.state.formlist}
-              card={this.state.card}
-              wrappedComponentRef={(inst) => this.formRef = inst}
-            /> : null
-          }
-          {this.state.formtemp === 'action' ?
-            <ActionForm
-              dict={this.state.dict}
-              card={this.state.card}
-              tabs={this.state.tabviews}
-              formlist={this.state.formlist}
-              wrappedComponentRef={(inst) => this.formRef = inst}
-            /> : null
-          }
-          {this.state.formtemp === 'columns' && this.state.card.type !== 'colspan' ?
-            <ColumnForm
-              dict={this.state.dict}
-              card={this.state.card}
-              formlist={this.state.formlist}
-              wrappedComponentRef={(inst) => this.formRef = inst}
-            /> : null
-          }
-          {this.state.formtemp === 'columns' && this.state.card.type === 'colspan' ?
-            <ColspanForm
-              dict={this.state.dict}
-              card={this.state.card}
-              columns={this.state.config.columns}
-              wrappedComponentRef={(inst) => this.formRef = inst}
-            /> : null
-          }
-          {this.state.formtemp === 'gridbtn' ?
-            <GridBtnForm
-              dict={this.state.dict}
-              card={this.state.config.gridBtn}
-              wrappedComponentRef={(inst) => this.formRef = inst}
-            /> : null
-          }
+          <ActionForm
+            dict={this.state.dict}
+            card={this.state.card}
+            tabs={this.state.tabviews}
+            formlist={this.state.formlist}
+            wrappedComponentRef={(inst) => this.actionFormRef = inst}
+          />
+        </Modal>
+        {/* 鏄剧ず鍒楃紪杈� */}
+        <Modal
+          title={this.state.dict['header.modal.column.edit']}
+          visible={modaltype === 'columns'}
+          width={700}
+          onOk={this.handleSubmit}
+          onCancel={this.editModalCancel}
+          destroyOnClose
+        >
+          <ColumnForm
+            dict={this.state.dict}
+            card={this.state.card}
+            formlist={this.state.formlist}
+            wrappedComponentRef={(inst) => this.columnFormRef = inst}
+          />
+        </Modal>
+        {/* 鍚堝苟鍒楃紪杈� */}
+        <Modal
+          title={this.state.dict['header.modal.colspan.edit']}
+          visible={modaltype === 'colspan'}
+          width={700}
+          onOk={this.handleSubmit}
+          onCancel={this.editModalCancel}
+          destroyOnClose
+        >
+          <ColspanForm
+            dict={this.state.dict}
+            card={this.state.card}
+            columns={this.state.config.columns}
+            wrappedComponentRef={(inst) => this.columnFormRef = inst}
+          />
+        </Modal>
+        {/* 鎿嶄綔鍒楃紪杈� */}
+        <Modal
+          title={this.state.dict['header.modal.gridbtn.edit']}
+          visible={modaltype === 'gridbtn'}
+          width={700}
+          onOk={this.handleSubmit}
+          onCancel={this.editModalCancel}
+          destroyOnClose
+        >
+          <GridBtnForm
+            dict={this.state.dict}
+            card={this.state.config.gridBtn}
+            wrappedComponentRef={(inst) => this.gridBtnFormRef = inst}
+          />
         </Modal>
         {/* 鏍规嵁瀛楁鍚嶆坊鍔犳樉绀哄垪鍙婃悳绱㈡潯浠� */}
         <Modal
diff --git a/src/templates/subtableconfig/source.jsx b/src/templates/subtableconfig/source.jsx
index 42b9c81..57e811f 100644
--- a/src/templates/subtableconfig/source.jsx
+++ b/src/templates/subtableconfig/source.jsx
@@ -36,11 +36,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         match: 'like',
         display: 'dropdown'
@@ -54,11 +49,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         match: 'equal',
         display: 'dropdown'
@@ -72,11 +62,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         match: 'greater',
         display: 'dropdown'
@@ -88,13 +73,7 @@
         uuid: Utils.getuuid(),
         label: 'add',
         intertype: 'inner',
-        innerFunc: '',
-        interface: '',
         method: 'POST',
-        outerFunc: '',
-        sql: '',
-        sqlType: '',
-        callbackFunc: '',
         Ot: 'notRequired',
         position: 'toolbar',
         execSuccess: 'grid',
@@ -109,13 +88,7 @@
         uuid: Utils.getuuid(),
         label: 'update',
         intertype: 'inner',
-        innerFunc: '',
-        interface: '',
         method: 'POST',
-        outerFunc: '',
-        sql: '',
-        sqlType: '',
-        callbackFunc: '',
         Ot: 'requiredSgl',
         position: 'grid',
         execSuccess: 'grid',
@@ -130,13 +103,7 @@
         uuid: Utils.getuuid(),
         label: 'delete',
         intertype: 'inner',
-        innerFunc: '',
-        interface: '',
         method: 'POST',
-        outerFunc: '',
-        sql: '',
-        sqlType: '',
-        callbackFunc: '',
         Ot: 'required',
         position: 'toolbar',
         execSuccess: 'grid',
diff --git a/src/templates/tableshare/editcard/index.jsx b/src/templates/tableshare/editcard/index.jsx
index 53f3492..c0c579d 100644
--- a/src/templates/tableshare/editcard/index.jsx
+++ b/src/templates/tableshare/editcard/index.jsx
@@ -98,18 +98,13 @@
 
   changeCard = (item) => {
     let cards = JSON.parse(JSON.stringify(this.state.selectCards))
-    let isAdd = true
-    cards = cards.map(card => {
-      if (card.field === item.field) {
-        isAdd = false
-        return item
-      } else {
-        return card
-      }
-    })
-    if (isAdd) {
+
+    if (!item.selected) {
+      cards = cards.filter(card => card.field !== item.field)
+    } else {
       cards.push(item)
     }
+
     this.setState({
       selectCards: cards
     })
diff --git a/src/templates/tableshare/formconfig.js b/src/templates/tableshare/formconfig.js
index 08380d8..e3df2fb 100644
--- a/src/templates/tableshare/formconfig.js
+++ b/src/templates/tableshare/formconfig.js
@@ -201,7 +201,45 @@
  * @param {*} config         椤甸潰閰嶇疆
  * @param {*} permFuncField  瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈�
  */
-export function getActionForm (card, functip, config, permFuncField) {
+export function getActionForm (card, functip, config, permFuncField, type) {
+  let openTypeOptions = [{
+    value: 'pop',
+    text: Formdict['header.form.popform']
+  }, {
+    value: 'prompt',
+    text: Formdict['header.form.prompt']
+  }, {
+    value: 'exec',
+    text: Formdict['header.form.exec']
+  }, {
+    value: 'excelIn',
+    text: Formdict['header.form.excelIn']
+  }, {
+    value: 'excelOut',
+    text: Formdict['header.form.excelOut']
+  }, {
+    value: 'popview',
+    text: Formdict['header.form.popview']
+  }]
+
+  if (type === 'main') {
+    openTypeOptions = [
+      ...openTypeOptions,
+      {
+        value: 'tab',
+        text: Formdict['header.form.tab']
+      }, {
+        value: 'blank',
+        text: Formdict['header.form.blank']
+      }, {
+        value: 'innerpage',
+        text: Formdict['header.form.newpage.inner']
+      }, {
+        value: 'outerpage',
+        text: Formdict['header.form.newpage.outer']
+      }
+    ]
+  }
   return [
     {
       type: 'text',
@@ -217,37 +255,7 @@
       label: Formdict['header.form.openType'],
       initVal: card.OpenType,
       required: true,
-      options: [{
-        value: 'pop',
-        text: Formdict['header.form.popform']
-      }, {
-        value: 'prompt',
-        text: Formdict['header.form.prompt']
-      }, {
-        value: 'exec',
-        text: Formdict['header.form.exec']
-      }, {
-        value: 'excelIn',
-        text: Formdict['header.form.excelIn']
-      }, {
-        value: 'excelOut',
-        text: Formdict['header.form.excelOut']
-      }, {
-        value: 'popview',
-        text: Formdict['header.form.popview']
-      }, {
-        value: 'tab',
-        text: Formdict['header.form.tab']
-      }, {
-        value: 'blank',
-        text: Formdict['header.form.blank']
-      }, {
-        value: 'innerpage',
-        text: Formdict['header.form.newpage.inner']
-      }, {
-        value: 'outerpage',
-        text: Formdict['header.form.newpage.outer']
-      }]
+      options: openTypeOptions
     }, {
       type: 'select',
       key: 'tabType',

--
Gitblit v1.8.0