From a8736e84e62cae98c05b1cc6ac6992e4b31e7cf2 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 13 一月 2020 00:48:31 +0800 Subject: [PATCH] 2020-01-13 --- src/templates/formtabconfig/actionform/index.jsx | 213 ++--------------------------------------------------- 1 files changed, 8 insertions(+), 205 deletions(-) diff --git a/src/templates/formtabconfig/actionform/index.jsx b/src/templates/formtabconfig/actionform/index.jsx index 94154e2..f768035 100644 --- a/src/templates/formtabconfig/actionform/index.jsx +++ b/src/templates/formtabconfig/actionform/index.jsx @@ -53,100 +53,34 @@ }, { value: 'update', text: this.props.dict['header.form.action.update'] - }], - deleteOptions: [{ - value: '', - text: this.props.dict['header.form.empty'] - }, { - value: 'LogicDelete', - text: this.props.dict['header.form.action.LogicDelete'] - }, { - value: 'delete', - text: this.props.dict['header.form.action.delete'] }] } UNSAFE_componentWillMount () { - let _opentype = '' let _intertype = '' - let _position = '' - let _tabType = '' - let _linkTab = '' let _options = null this.props.formlist.forEach(form => { - if (form.key === 'OpenType') { - _opentype = form.initVal - } else if (form.key === 'intertype') { + if (form.key === 'intertype') { _intertype = form.initVal - } else if (form.key === 'position') { - _position = form.initVal - } else if (form.key === 'tabType') { - _tabType = form.initVal - } else if (form.key === 'linkTab') { - _linkTab = form.initVal } }) - let _tabs = this.props.tabs.filter(tab => tab.type === _tabType) - let initTab = _tabs.filter(tab => tab.uuid === _linkTab)[0] - - if (_opentype === 'innerpage') { // 鏂伴〉闈紙鍐呴儴锛夛紝鍙�夋ā鏉� - _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position'] - } else if (_opentype === 'outerpage') { // 鏂伴〉闈紙澶栭儴锛夛紝闇�瑕侀〉闈㈠湴鍧� - _options = ['label', 'Ot', 'OpenType', 'url', 'icon', 'class', 'position'] - } else if (_opentype === 'blank' || _opentype === 'tab') { // 鏂版爣绛炬垨褰撳墠椤甸潰鏇挎崲 - _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position'] - } else if (_opentype === 'popview') { // 妯℃�佹鏍囩椤� - _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] - } else if (_opentype === 'excelIn' || _opentype === 'excelOut') { // 瀵煎叆瀵煎嚭 - if (_intertype === 'outer') { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] - } else { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] - } + if (_intertype === 'outer') { + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { - if (_intertype === 'outer') { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method'] - } else { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] - } + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] } + this.setState({ - openType: _opentype, - interType: _intertype, - position: _position, formlist: this.props.formlist.map(item => { if (item.key === 'class') { item.options = btnClasses } else if (item.key === 'icon') { item.options = btnIcons - } else if (item.key === 'Ot') { - if (_opentype === 'innerpage' || _position === 'grid') { - item.options = this.state.reqOptionSgl - } else if (['outerpage', 'blank', 'tab', 'popview'].includes(_opentype)) { - item.options = this.state.reqOptions - } else { - item.options = this.state.reqOptionsMutil - } } else if (item.key === 'sqlType') { - if (['prompt', 'exec'].includes(_opentype)) { - item.options = this.state.deleteOptions - } else { - item.options = this.state.insertUpdateOptions - } - } else if (item.key === 'linkTab') { - item.options = [ - { - value: '', - text: '鏂板缓' - }, - ..._tabs - ] - if (!initTab) { - item.initVal = '' - } + item.options = this.state.insertUpdateOptions } item.hidden = !_options.includes(item.key) return item @@ -167,144 +101,14 @@ } } - // 鎵撳紑鏂瑰紡鎴栨樉绀轰綅缃彉鍖� - openTypeChange = (key, value) => { - if (key === 'OpenType') { - let _options = null - if (value === 'innerpage') { - _options = ['label', 'Ot', 'OpenType', 'pageTemplate', 'icon', 'class', 'position'] - } else if (value === 'outerpage') { - _options = ['label', 'Ot', 'OpenType', 'url', 'icon', 'class', 'position'] - } else if (value === 'blank' || value === 'tab') { - _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position'] - } else if (value === 'popview') { - _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] - } else if (value === 'excelIn' || value === 'excelOut') { - if (this.state.interType === 'outer') { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] - } else { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] - } - } else { - if (this.state.interType === 'inner') { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] - } else { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method'] - } - } - 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 - }) - }, () => { - 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 - }) - }) - }) - } else if (key === 'position') { - 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 - } else if (['outerpage', 'blank', 'tab', 'popview'].includes(this.state.openType)) { - item.options = this.state.reqOptions - item.initVal = 'requiredSgl' - item.hidden = true - } else { - item.options = this.state.reqOptionsMutil - } - } - return item - }) - }, () => { - this.setState({ - formlist: this.state.formlist.map(item => { - if (item.key === 'Ot') { - item.hidden = false - } - return item - }) - }) - }) - } else if (key === 'tabType') { - let _tabs = this.props.tabs.filter(tab => tab.type === value) - - this.setState({ - formlist: this.state.formlist.map(item => { - if (item.key === 'linkTab') { - item.options = [ - { - value: '', - text: '鏂板缓' - }, - ..._tabs - ] - item.initVal = '' - item.hidden = true - } - return item - }) - }, () => { - this.setState({ - formlist: this.state.formlist.map(item => { - if (item.key === 'linkTab') { - item.hidden = false - } - return item - }) - }) - }) - } - } - onChange = (e, key) => { let value = e.target.value if (key === 'intertype') { let _options = null if (value === 'inner') { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] } else { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method'] } this.setState({ interType: value, @@ -406,7 +210,6 @@ <Select showSearch filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} - onChange={(value) => {this.openTypeChange(item.key, value)}} getPopupContainer={() => document.getElementById('winter')} > {item.options.map((option, index) => -- Gitblit v1.8.0