From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 21 十月 2021 23:17:08 +0800 Subject: [PATCH] 2021-10-21 --- src/templates/sharecomponent/actioncomponent/actionform/index.jsx | 97 ++++++++++++++++++++++++++++++++---------------- 1 files changed, 65 insertions(+), 32 deletions(-) diff --git a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx index 587d091..460a648 100644 --- a/src/templates/sharecomponent/actioncomponent/actionform/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/actionform/index.jsx @@ -9,9 +9,9 @@ const { TextArea } = Input const actionTypeOptions = { - pop: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError'], - prompt: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError'], - exec: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError'], + pop: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output'], + prompt: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output'], + exec: ['label', 'position', 'OpenType', 'intertype', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'openmenu', 'output'], 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'], @@ -134,7 +134,7 @@ } else if (['innerpage', 'tab', 'popview', 'excelIn'].includes(_opentype)) { item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) } else if (card.sqlType === 'insert') { - item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl', 'required'].includes(op.value)) + item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value)) } else { item.options = this.state.requireOptions } @@ -169,7 +169,7 @@ try { let _form = document.getElementById('label') _form.select() - } catch { + } catch (e) { console.warn('琛ㄥ崟focus澶辫触锛�') } } @@ -202,12 +202,14 @@ } } else if (_opentype === 'funcbutton') { if (_funcType === 'print') { - _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError') + _options.push('execMode', 'intertype', 'Ot', 'execSuccess', 'execError', 'controlField', 'controlVal') if (_intertype === 'outer') { _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') } else if (_intertype === 'inner') { _options.push('innerFunc') } + } else if (_funcType === 'closetab') { + _options.push('refreshTab') } } else if (_opentype !== 'popview') { // 鎵撳紑鏂瑰紡涓嶆槸寮圭獥椤甸潰鏃� if (_intertype === 'custom') { @@ -220,7 +222,7 @@ } else if (_intertype === 'outer') { _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') } else if (_intertype === 'inner') { - _options.push('innerFunc') + _options.push('innerFunc', 'preFunc') } else { _options.push('sql', 'sqlType') } @@ -230,7 +232,7 @@ _options.push('resetPageIndex') } - if (_Ot !== 'notRequired' && _opentype !== 'excelOut') { + if (_Ot !== 'notRequired' && _opentype !== 'excelOut' && _opentype !== 'funcbutton') { _options.push('controlField', 'controlVal') } @@ -329,29 +331,15 @@ }, () => { this.props.form.setFieldsValue(_fieldval) }) - // } else if (key === 'tabType') { - // let _tabs = this.props.tabs.filter(tab => tab.type === value) - // let _fieldval = {} - - // this.setState({ - // formlist: this.state.formlist.map(item => { - // if (item.key === 'linkTab') { - // item.options = [ - // { - // value: '', - // text: '鏂板缓' - // }, - // ..._tabs - // ] - // } - // return item - // }) - // }, () => { - // 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 _fieldval = {} + + if (value === 'print') { + _fieldval.label = '鎵撳嵃' + } else if (value === 'closetab') { + _fieldval.label = '鍏抽棴' + } this.setState({ funcType: value, @@ -376,7 +364,7 @@ this.setState({ formlist: this.state.formlist.map(item => { if (item.key === 'Ot' && value === 'insert') { - item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl', 'required'].includes(op.value)) + item.options = this.state.requireOptions.filter(op => ['notRequired'].includes(op.value)) } else if (item.key === 'Ot') { item.options = this.state.requireOptions } @@ -525,7 +513,7 @@ if (item.type === 'text') { // 鏂囨湰鎼滅储 let _rules = [] - if (item.key === 'innerFunc') { + if (item.key === 'innerFunc' || item.key === 'preFunc') { let str = '^(' + item.fields.join('|') + ')' let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') _rules = [{ @@ -587,7 +575,7 @@ message: this.props.dict['form.required.input'] + item.label + '!' } ] - })(<InputNumber min={0} max={10000} precision={0} />)} + })(<InputNumber min={0} max={10000} precision={0} onPressEnter={this.handleSubmit}/>)} </Form.Item> </Col> ) @@ -613,6 +601,7 @@ showSearch filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} onChange={(value) => {this.optionChange(item.key, value)}} + allowClear={item.key === 'icon'} getPopupContainer={() => document.getElementById('winter')} > {item.options.map((option, index) => @@ -675,7 +664,12 @@ } else if (item.type === 'cascader') { // 澶氶�� fields.push( <Col span={12} key={index}> - <Form.Item label={item.label}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" overlayClassName={item.tooltipClass} title={item.tooltip}> + <Icon type="question-circle" /> + {item.label} + </Tooltip> : item.label + }> {getFieldDecorator(item.key, { initialValue: item.initVal || [], rules: [ @@ -733,6 +727,45 @@ values.verify.invalid = 'true' } } + } else if (values.OpenType === 'tab' && values.linkmenu) { + if (sessionStorage.getItem('thdMenuList')) { + let list = null + try { + list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] + } catch (e) { + list = [] + } + + let id = values.linkmenu[values.linkmenu.length - 1] + + list.forEach(item => { + if (item.MenuID === id) { + values.MenuID = id + values.MenuName = item.MenuName + values.MenuNo = item.MenuNo + values.tabType = item.type + } + }) + } + } + if (values.openmenu && Array.isArray(values.openmenu) && values.openmenu.length > 0) { + let list = null + try { + list = JSON.parse(sessionStorage.getItem('thdMenuList')) || [] + } catch (e) { + list = [] + } + + let id = values.openmenu[values.openmenu.length - 1] + + list.forEach(item => { + if (item.MenuID === id) { + values.MenuID = id + values.MenuName = item.MenuName + values.MenuNo = item.MenuNo + values.tabType = item.type + } + }) } resolve(values) -- Gitblit v1.8.0