From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 07 四月 2021 23:25:29 +0800 Subject: [PATCH] 2021-04-07 --- src/templates/subtableconfig/index.jsx | 46 ++++++++++++++-------------------------------- 1 files changed, 14 insertions(+), 32 deletions(-) diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index 7676116..d3bda26 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -47,10 +47,9 @@ } state = { - dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 瀛楀吀 + dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 瀛楀吀 config: null, // 椤甸潰閰嶇疆 visible: false, // 鎼滅储鏉′欢銆佹寜閽�佹樉绀哄垪锛屾ā鎬佹鏄剧ず鎺у埗 - tableFields: [], // 宸查�夎〃瀛楁闆� menuloading: false, // 鑿滃崟淇濆瓨涓� menucloseloading: false, // 鑿滃崟鍏抽棴鏃讹紝閫夋嫨淇濆瓨 loading: false, // 鍔犺浇涓紝椤甸潰spin @@ -90,6 +89,11 @@ if (_config.type === 'user') { _config.action = _config.action.map(item => { let uuid = Utils.getuuid() + + if (item.linkTab) { + item.linkTab = '' + } + if (item.OpenType === 'pop') { // 鍚湁瀛愰厤缃」鐨勬寜閽� _oriActions.push({ prebtn: fromJS(item).toJS(), @@ -550,6 +554,7 @@ let curBtn = config.action.filter(cell => item.curuuid === cell.uuid)[0] // 鏌ョ湅鍒濆鍖栨寜閽槸鍚﹀瓨鍦� if (!curBtn) return if (curBtn.OpenType !== item.prebtn.OpenType) return + if (curBtn.OpenType === 'funcbutton' && curBtn.execMode !== 'pop') return oriActions.push({ prebtn: item.prebtn, @@ -666,10 +671,10 @@ let _view = '' let _subtab = editSubTab - if (btn.OpenType === 'pop') { - _view = 'Modal' // 琛ㄥ崟椤甸潰 + if (btn.OpenType === 'pop' || btn.execMode === 'pop') { + _view = 'Modal' // 琛ㄥ崟椤甸潰 } else if (btn.OpenType === 'popview') { - _view = btn.tabType || 'SubTable' // 鏂板脊绐楁爣绛炬ā鏉� tabType 灞炴�у凡鍘婚櫎 + _view = 'SubTable' // 鏂板脊绐楁爣绛炬ā鏉� tabType 灞炴�у凡鍘婚櫎 _subtab = btn if (editSubTab) { @@ -910,32 +915,11 @@ chartview: _chartview }) } - - /** - * @description 鏇存柊甯哥敤琛ㄤ俊鎭紝蹇嵎娣诲姞鍚庢洿鏂伴厤缃俊鎭� - */ - updatetable = (config, fields) => { - const { tableFields } = this.state - - this.setState({ - config: config, - tableFields: fields ? fields : tableFields - }) - } - - /** - * @description 鎵归噺娣诲姞锛屾洿鏂伴厤缃俊鎭� - */ - updatefield = (config) => { - this.setState({ - config: config - }) - } render () { const { activeKey, config, chartview } = this.state - const confActions = config.action.filter(_action => !_action.origin && ['pop', 'popview', 'blank'].includes(_action.OpenType)) + const confActions = config.action.filter(_action => !_action.origin && (['pop', 'popview'].includes(_action.OpenType) || (_action.OpenType === 'funcbutton' && _action.execMode === 'pop'))) return ( <div className="model-subtable-board"> @@ -955,7 +939,7 @@ <TableComponent config={config} containerId="subtable-basedata" - updatetable={this.updatetable} + updatetable={this.updateconfig} /> </Panel> {/* 鎼滅储鏉′欢娣诲姞 */} @@ -968,8 +952,7 @@ <FieldsComponent config={config} type="search" - tableFields={this.state.tableFields} - updatefield={this.updatefield} + updatefield={this.updateconfig} /> </Panel> {/* 鎸夐挳娣诲姞 */} @@ -1012,8 +995,7 @@ <FieldsComponent config={config} type="columns" - tableFields={this.state.tableFields} - updatefield={this.updatefield} + updatefield={this.updateconfig} /> </Panel> </Collapse> -- Gitblit v1.8.0