From c51f5e007a3e03c9d6731ab7f28f0080de009990 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 17 十一月 2021 18:38:32 +0800 Subject: [PATCH] 2021-11-17 --- src/templates/sharecomponent/actioncomponent/actionform/index.jsx | 62 ++++++++++++++++--------------- 1 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx index 8f1d740..efdf7db 100644 --- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx @@ -16,7 +16,7 @@ excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'icon', 'class', 'sheet', 'execSuccess', 'execError'], excelOut: ['label', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'pagination', 'search'], popview: ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose', 'display', 'ratio', 'placement'], - tab: ['label', 'Ot', 'OpenType', 'tabTemplate', 'icon', 'class', 'position'], + tab: ['label', 'Ot', 'OpenType', 'icon', 'class', 'position'], innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position'], funcbutton: ['label', 'OpenType', 'funcType', 'icon', 'class'] } @@ -38,6 +38,7 @@ funcType: null, // 鍔熻兘绫诲瀷 position: null, // 鎸夐挳浣嶇疆 procMode: null, // 澶栭儴鎺ュ彛鍙傛暟澶勭悊鏂瑰紡 + control: '', pageTemplate: null, Ot: null, requireOptions: [{ @@ -97,9 +98,9 @@ let _intertype = card.intertype || 'system' // 鎺ュ彛绫诲瀷 let _procMode = card.procMode || 'system' // 鍙傛暟澶勭悊鏂瑰紡 let _funcType = card.funcType || '' // 鍔熻兘鎸夐挳榛樿绫诲瀷 - let _tabTemplate = card.tabTemplate // 鎸夐挳涓烘爣绛鹃〉鏃讹紝鏍囩绫诲瀷锛氫笁绾ц彍鍗曟垨琛ㄥ崟鏍囩椤� let _pageTemplate = card.pageTemplate // 鏂伴〉闈㈢被鍨� let _Ot = card.Ot || 'requiredSgl' + let control = card.control || '' if (_opentype === 'outerpage') { card.pageTemplate = 'custom' @@ -107,9 +108,10 @@ } let _tabs = this.props.tabs.filter(tab => tab.type === 'SubTable') - let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode, _Ot) + let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, control) this.setState({ + control: control, Ot: _Ot, openType: _opentype, pageTemplate: _pageTemplate, @@ -176,7 +178,7 @@ } } - getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode, _Ot) => { + getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, _control) => { let _options = fromJS(actionTypeOptions[_opentype]).toJS() // 閫夐」鍒楄〃 if (_opentype === 'innerpage') { // 鏂伴〉闈紝鍙�夋ā鏉�(鑷畾涔夋椂锛屽彲濉叆澶栭儴閾炬帴) @@ -186,7 +188,7 @@ _options.push('printTemp') } } else if (_opentype === 'tab') { // 鏍囩椤� - if (_tabTemplate === 'ThdMenu') { + if (this.props.card.tabTemplate !== 'FormTab') { _options.push('linkmenu') } } else if (_opentype === 'excelOut') { // 瀵煎叆瀵煎嚭 @@ -203,7 +205,7 @@ } } else if (_opentype === 'funcbutton') { if (_funcType === 'print') { - _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'controlField', 'controlVal') + _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError') if (_intertype === 'outer') { _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') } else if (_intertype === 'inner') { @@ -233,8 +235,11 @@ _options.push('resetPageIndex') } - if (_Ot !== 'notRequired' && _opentype !== 'excelOut' && _opentype !== 'funcbutton') { - _options.push('controlField', 'controlVal') + if (_Ot !== 'notRequired' && _opentype !== 'excelOut') { + _options.push('control') + if (_control) { + _options.push('controlField', 'controlVal') + } } return _options @@ -244,11 +249,11 @@ * @description 鍒囨崲 */ optionChange = (key, value) => { - const { openType, funcType, procMode, Ot } = this.state + const { openType, funcType, procMode, Ot, control } = this.state const { card } = this.props if (key === 'OpenType') { - let _options = this.getOptions(value, 'system', '', this.state.pageTemplate, card.tabTemplate, 'system', Ot) + let _options = this.getOptions(value, 'system', '', this.state.pageTemplate, 'system', Ot, control) let _fieldval = {} let _formlist = this.state.formlist.map(item => { item.hidden = !_options.includes(item.key) @@ -256,6 +261,8 @@ if (item.key === 'intertype') { let iscustom = ['pop', 'prompt', 'exec'].includes(value) item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom')) + } else if (item.key === 'control') { + item.initVal = control } if (item.hidden) return item @@ -333,7 +340,7 @@ this.props.form.setFieldsValue(_fieldval) }) } else if (key === 'funcType') { - let _options = this.getOptions('funcbutton', this.state.interType, value, card.pageTemplate, card.tabTemplate, procMode, Ot) + let _options = this.getOptions('funcbutton', this.state.interType, value, card.pageTemplate, procMode, Ot, control) let _fieldval = {} if (value === 'print') { @@ -393,7 +400,7 @@ this.props.form.setFieldsValue(_fieldval) }) } else if (key === 'pageTemplate') { - let _options = this.getOptions('innerpage', this.state.interType, this.state.funcType, value, card.tabTemplate, procMode, Ot) + let _options = this.getOptions('innerpage', this.state.interType, this.state.funcType, value, procMode, Ot, control) let _fieldval = {} this.setState({ @@ -418,23 +425,8 @@ }, () => { this.props.form.setFieldsValue(_fieldval) }) - } else if (key === 'tabTemplate') { - let _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabTemplate'] - - if (value === 'ThdMenu') { - _options.push('linkmenu') - } - - this.setState({ - openType: value, - formlist: this.state.formlist.map(item => { - item.hidden = !_options.includes(item.key) - - return item - }) - }) } else if (key === 'intertype') { - let _options = this.getOptions(openType, value, funcType, '', '', procMode, Ot) + let _options = this.getOptions(openType, value, funcType, '', procMode, Ot, control) this.setState({ interType: value, @@ -454,7 +446,7 @@ }) }) } else if (key === 'procMode') { - let _options = this.getOptions(openType, this.state.interType, funcType, '', '', value, Ot) + let _options = this.getOptions(openType, this.state.interType, funcType, '', value, Ot, control) this.setState({ procMode: value, @@ -468,7 +460,7 @@ }) }) } else if (key === 'Ot') { - let _options = this.getOptions(openType, this.state.interType, funcType, this.state.pageTemplate, card.tabTemplate, procMode, value) + let _options = this.getOptions(openType, this.state.interType, funcType, this.state.pageTemplate, procMode, value, control) this.setState({ Ot: value, @@ -477,6 +469,16 @@ return item }) }) + } else if (key === 'control') { + let _options = this.getOptions(openType, this.state.interType, funcType, this.state.pageTemplate, procMode, Ot, value) + + this.setState({ + control: value, + formlist: this.state.formlist.map(item => { + item.hidden = !_options.includes(item.key) + return item + }) + }) } else if (key === 'sysInterface') { if (value === 'true') { this.props.form.setFieldsValue({ -- Gitblit v1.8.0