From 35b44bed4aa7b3f645c20fca025813cf4f3786ea Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 02 二月 2020 10:22:25 +0800 Subject: [PATCH] 2020-02-02 --- src/templates/subtableconfig/index.jsx | 44 +++++++++++++++++++++++++++++++------------- 1 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index b41de8f..e0a3e2a 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -36,6 +36,7 @@ static propTpyes = { menu: PropTypes.any, editTab: PropTypes.any, + tabConfig: PropTypes.any, editSubTab: PropTypes.any, config: PropTypes.any, handleView: PropTypes.func @@ -78,14 +79,14 @@ * 2銆佽缃搷浣滅被鍨嬨�佸師濮嬭彍鍗曚俊鎭紙姣忔淇濆瓨鍚庨噸缃級銆佸凡浣跨敤琛ㄥ強鍩烘湰淇℃伅琛ㄥ崟 */ UNSAFE_componentWillMount () { - const { config, editTab } = this.props + const { config, editTab, editSubTab } = this.props let _config = null if (!config) { _config = JSON.parse(JSON.stringify(Source.baseConfig)) - _config.uuid = editTab.linkTab - _config.tabName = editTab.label + _config.uuid = editSubTab ? editSubTab.linkTab : editTab.linkTab + _config.tabName = editSubTab ? editSubTab.label : editTab.label _config.isAdd = true } else { _config = JSON.parse(JSON.stringify(config)) @@ -262,20 +263,33 @@ * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 */ componentWillUnmount () { - this.setState = (state, callback) => { + this.setState = () => { return } } // 椤甸潰杩斿洖 handleViewBack = () => { - const {menu} = this.props + const {menu, editTab, tabConfig, editSubTab} = this.props + let _tabview = menu ? menu.LongParam.Template : '' + + if (editSubTab) { + if (editTab.hasOwnProperty('OpenType')) { + _tabview = editTab.tabType + } else { + _tabview = editTab.type + } + } + let param = { editMenu: menu, - editTab: '', - editAction: '', - subConfig: '', - tabview: menu ? menu.LongParam.Template : '' + editTab: editSubTab ? editTab : null, + tabConfig: null, + editSubTab: null, + subTabConfig: null, + editAction: null, + subConfig: tabConfig, + tabview: _tabview } this.props.handleView(param) @@ -1684,7 +1698,7 @@ * @description 璁剧疆鍙厤缃寜閽� */ setSubConfig = (btn) => { - const { menu } = this.props + const {menu, editTab, tabConfig, editSubTab} = this.props const { config, originConfig } = this.state if (originConfig.isAdd) { @@ -1710,17 +1724,21 @@ // 瀛愯彍鍗曚俊鎭獙璇侀�氳繃鍚庯紝璺宠浆瀛愭寜閽厤缃〉闈� let _view = '' + let _subtab = editSubTab if (btn.OpenType === 'pop') { _view = 'Modal' // 琛ㄥ崟椤甸潰 } else if (btn.OpenType === 'popview') { _view = btn.tabType // 鏂板脊绐楁爣绛炬ā鏉� + _subtab = btn } let param = { editMenu: menu, - editTab: originConfig, - editSubTab: '', + editTab: editTab, + tabConfig: editSubTab ? tabConfig : originConfig, + editSubTab: _subtab, + subTabConfig: editSubTab ? originConfig : null, editAction: btn, subConfig: '', tabview: _view @@ -2080,7 +2098,7 @@ onCancel={() => { this.setState({ profileVisible: false }) }} destroyOnClose > - <VerifyCard card={this.state.card} columns={this.state.config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} dict={this.state.dict} /> + <VerifyCard floor="subtable" card={this.state.card} columns={this.state.config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} dict={this.state.dict} /> </Modal> {/* 璁剧疆鍏ㄥ眬閰嶇疆鍙婂垪琛ㄦ暟鎹簮 */} <Modal -- Gitblit v1.8.0