From 5223edbcccfed84a33a706e5637ee65a61f377aa Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 22 十二月 2021 18:00:39 +0800 Subject: [PATCH] 2021-12-22 --- src/menu/components/share/actioncomponent/actionform/index.jsx | 44 ++++++++++++++++++++++++++++++++------------ 1 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 029a6df..d328729 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -16,7 +16,7 @@ exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'], excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'], - popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement', 'syncComponent', 'clickouter'], + popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'syncComponent', 'clickouter'], tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width'], innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'open'], funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width'] @@ -39,6 +39,7 @@ funcType: null, // 鍔熻兘绫诲瀷 procMode: null, // 鍙傛暟鏂瑰紡 control: '', + display: '', pageTemplate: null, appType: sessionStorage.getItem('appType'), Ot: null, @@ -98,14 +99,16 @@ let _intertype = card.intertype || 'system' // 鎺ュ彛绫诲瀷 let _funcType = card.funcType || '' // 鍔熻兘鎸夐挳榛樿绫诲瀷 let _procMode = card.procMode || 'system' + let _display = card.display || 'modal' let _Ot = card.Ot let _pageTemplate = card.pageTemplate || '' let control = card.control || '' - let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, control) + let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, control, _display) this.setState({ Ot: _Ot, + display: _display, control: control, openType: _opentype, interType: _intertype, @@ -156,7 +159,7 @@ }) } - getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, _control) => { + getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, _control, _display) => { let _options = actionTypeOptions[_opentype] ? fromJS(actionTypeOptions[_opentype]).toJS() : [] // 閫夐」鍒楄〃 if (_opentype === 'innerpage') { // 鏂伴〉闈紝鍙�夋ā鏉�(鑷畾涔夋椂锛屽彲濉叆澶栭儴閾炬帴) @@ -196,7 +199,11 @@ } else if (_funcType === 'goBack') { _options.push('reload') } - } else if (_opentype !== 'popview' && _opentype !== 'tab') { + } else if (_opentype === 'popview') { + if (_display === 'drawer') { + _options.push('placement') + } + } else if (_opentype !== 'tab') { if (_intertype === 'custom') { _options = _options.filter(m => m !== 'output') _options.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method', 'cross') @@ -245,10 +252,10 @@ */ optionChange = (key, value) => { const { type } = this.props - const { openType, procMode, Ot, pageTemplate, control } = this.state + const { openType, procMode, Ot, pageTemplate, control, display } = this.state if (key === 'OpenType') { - let _options = this.getOptions(value, 'system', this.state.funcType, '', 'system', Ot, control) + let _options = this.getOptions(value, 'system', this.state.funcType, '', 'system', Ot, control, 'modal') let _fieldval = {} let _formlist = this.state.formlist.map(item => { @@ -259,6 +266,8 @@ item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom')) } else if (item.key === 'control') { item.initVal = control + } else if (item.key === 'display') { + item.initVal = 'modal' } if (item.hidden) return item @@ -305,6 +314,7 @@ openType: value, intertype: 'system', procMode: 'system', + display: 'modal', pageTemplate: '', formlist: _formlist }, () => { @@ -319,7 +329,7 @@ this.props.form.setFieldsValue(_fieldval) }) } else if (key === 'funcType') { - let _options = this.getOptions(openType, this.state.interType, value, pageTemplate, procMode, Ot, control) + let _options = this.getOptions(openType, this.state.interType, value, pageTemplate, procMode, Ot, control, display) let _fieldval = {} if (value === 'print') { @@ -416,7 +426,7 @@ }) } else if (key === 'pageTemplate') { let _fieldval = {} - let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode, Ot, control) + let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode, Ot, control, display) this.setState({ pageTemplate: value, @@ -440,7 +450,7 @@ this.props.form.setFieldsValue(_fieldval) }) } else if (key === 'intertype') { - let _options = this.getOptions(openType, value, this.state.funcType, pageTemplate, procMode, Ot, control) + let _options = this.getOptions(openType, value, this.state.funcType, pageTemplate, procMode, Ot, control, display) this.setState({ interType: value, @@ -462,7 +472,7 @@ }) }) } else if (key === 'procMode') { - let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, value, Ot, control) + let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, value, Ot, control, display) this.setState({ procMode: value, @@ -476,7 +486,7 @@ }) }) } else if (key === 'Ot') { - let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, value, control) + let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, value, control, display) this.setState({ Ot: value, @@ -486,7 +496,7 @@ }) }) } else if (key === 'control') { - let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, Ot, value) + let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, Ot, value, display) this.setState({ control: value, @@ -495,6 +505,16 @@ return item }) }) + } else if (key === 'display') { + let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, Ot, control, value) + + this.setState({ + display: 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