From 8904592cf12f091aece5d6fc564fd8478fc8988b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 13 二月 2020 20:04:56 +0800 Subject: [PATCH] 2020-02-13 --- src/templates/comtableconfig/actionform/index.jsx | 57 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 46 insertions(+), 11 deletions(-) diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx index a20436a..d65053e 100644 --- a/src/templates/comtableconfig/actionform/index.jsx +++ b/src/templates/comtableconfig/actionform/index.jsx @@ -100,12 +100,14 @@ _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabTemplate'] } else if (_opentype === 'popview') { // 妯℃�佹鏍囩椤� _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] - } else if (_opentype === 'excelIn' || _opentype === 'excelOut') { // 瀵煎叆瀵煎嚭 + } else if (_opentype === 'excelOut') { // 瀵煎叆瀵煎嚭 if (_intertype === 'outer') { _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] } + } else if (_opentype === 'excelIn') { // 瀵煎叆瀵煎嚭 + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] } else { if (_intertype === 'outer') { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method'] @@ -147,6 +149,9 @@ if (!initTab) { item.initVal = '' } + } else if (item.key === 'intertype' && _opentype === 'excelIn') { + item.initVal = 'inner' + item.readonly = true } item.hidden = !_options.includes(item.key) return item @@ -184,12 +189,14 @@ _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabTemplate'] } else if (value === 'popview') { _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] - } else if (value === 'excelIn' || value === 'excelOut') { + } else if (value === 'excelOut') { if (this.state.interType === 'outer') { _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] } + } else if (value === 'excelIn') { + _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'] @@ -205,8 +212,12 @@ if (item.hidden) return item - if (item.key === 'intertype') { + if (item.key === 'intertype' && value === 'excelIn') { + _fieldval.intertype = 'inner' + item.readonly = true + } else if (item.key === 'intertype' && value !== 'excelIn') { _fieldval.intertype = this.state.interType + item.readonly = false } else if (item.key === 'Ot') { if (value === 'innerpage' || this.state.position === 'grid') { item.options = this.state.reqOptionSgl @@ -282,13 +293,28 @@ } onChange = (e, key) => { + const { openType } = this.state 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'] + if (openType === 'excelOut') { + if (value === 'outer') { + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] + } else { + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] + } + } else if (openType === 'excelIn') { + if (value === 'outer') { + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] + } else { + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] + } } else { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method'] + if (value === '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', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method'] + } } this.setState({ @@ -379,7 +405,7 @@ </Form.Item> </Col> ) - } else if (item.type === 'number') { // 鏂囨湰鎼滅储 + } else if (item.type === 'number') { fields.push( <Col span={12} key={index}> <Form.Item label={item.tooltip ? @@ -389,8 +415,14 @@ </Tooltip> : item.label }> {getFieldDecorator(item.key, { - initialValue: item.initVal - })(<InputNumber min={1} max={10000} precision={0} />)} + initialValue: item.initVal, + rules: [ + { + required: item.readonly ? false : !!item.required, + message: this.props.dict['form.required.input'] + item.label + '!' + } + ] + })(<InputNumber min={0} max={10000} precision={0} />)} </Form.Item> </Col> ) @@ -441,7 +473,7 @@ } ] })( - <Radio.Group onChange={(e) => {this.onChange(e, item.key)}}> + <Radio.Group onChange={(e) => {this.onChange(e, item.key)}} disabled={item.readonly}> { item.options.map(option => { return ( @@ -477,7 +509,10 @@ values.uuid = this.props.card.uuid values.verify = this.props.card.verify || null - if (values.OpenType === 'excelIn' || values.OpenType === 'excelOut') { + if (values.OpenType === 'excelIn') { + values.position = 'toolbar' + values.Ot = 'notRequired' + } else if (values.OpenType === 'excelOut') { values.position = 'toolbar' values.Ot = 'notRequired' } else if (values.OpenType === 'popview' && !values.linkTab) { // 娌℃湁鍏宠仈鏍囩锛堟柊寤烘椂锛夛紝鍒涘缓鏂版爣绛綢d -- Gitblit v1.8.0