From 3ca91a731665962918a026f521c556f4745ebf35 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 16 十一月 2020 19:20:19 +0800 Subject: [PATCH] 2020-11-16 --- src/templates/formtabconfig/actionform/index.jsx | 86 +++++++++---------------------------------- 1 files changed, 18 insertions(+), 68 deletions(-) diff --git a/src/templates/formtabconfig/actionform/index.jsx b/src/templates/formtabconfig/actionform/index.jsx index c6adf76..798f054 100644 --- a/src/templates/formtabconfig/actionform/index.jsx +++ b/src/templates/formtabconfig/actionform/index.jsx @@ -38,10 +38,7 @@ text: this.props.dict['header.form.refresh.never'] }, { value: 'grid', - text: this.props.dict['header.form.refresh.grid'] - }, { - value: 'view', - text: this.props.dict['header.form.refresh.view'] + text: this.props.dict['header.form.refresh'] }], currentoptions: [{ // 涓嶈繑鍥炴椂-涓嶅埛鏂般�佸埛鏂� value: 'never', @@ -56,8 +53,6 @@ UNSAFE_componentWillMount () { const { card } = this.props let _intertype = '' - let _success = 'close' - let _error = 'notclose' this.props.formlist.forEach(form => { if (form.key === 'intertype') { @@ -65,10 +60,6 @@ if (card.btnType !== 'confirm') { form.options = form.options.filter(op => op.value !== 'system') } - } else if (form.key === 'afterExecSuccess') { - _success = form.initVal - } else if (form.key === 'afterExecError') { - _error = form.initVal } }) @@ -80,6 +71,8 @@ item.options = btnClasses } else if (item.key === 'icon') { item.options = btnIcons + } else if (item.key === 'resetPageIndex') { + item.tooltip = '椤甸潰鍏抽棴锛屼笖鎵ц鍒锋柊鏃剁敓鏁�' } else if (item.key === 'sqlType') { item.options = this.state.insertUpdateOptions } else if (item.key === 'OpenType') { @@ -97,18 +90,9 @@ } } else if (item.key === 'execSuccess' && card.btnType === 'cancel') { item.label = '鍏抽棴鍚�' - } else if (item.key === 'execSuccess' && card.btnType !== 'cancel') { - if (_success === 'close') { - item.options = this.state.returnoptions - } else { - item.options = this.state.currentoptions - } - } else if (item.key === 'execError') { - if (_error === 'close') { - item.options = this.state.returnoptions - } else { - item.options = this.state.currentoptions - } + item.options[1].text = '鍒锋柊' + } else if (item.key === 'execSuccess' || item.key === 'execError') { + item.options[1].text = '鍒锋柊' } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && _intertype === 'inner') { item.required = true } @@ -136,62 +120,24 @@ let _options = [] if (btnType === 'cancel') { - _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess'] + _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess', 'resetPageIndex'] } else if (btnType === 'confirm') { if (intertype === 'outer') { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError', 'resetPageIndex'] } else if (intertype === 'system') { - _options = ['label', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError'] + _options = ['label', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError', 'resetPageIndex'] } else { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError', 'resetPageIndex'] } } else { if (intertype === 'outer') { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError', 'resetPageIndex'] } else { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError', 'resetPageIndex'] } } return _options - } - - selectChange = (key, value) => { - if (key === 'afterExecSuccess') { - this.setState({ - formlist: this.state.formlist.map(item => { - if (item.key === 'execSuccess') { - if (value === 'close') { - item.options = this.state.returnoptions - } else { - item.options = this.state.currentoptions - } - } - - return item - }) - }) - this.props.form.setFieldsValue({ - execSuccess: 'never' - }) - } else if (key === 'afterExecError') { - this.setState({ - formlist: this.state.formlist.map(item => { - if (item.key === 'execError') { - if (value === 'close') { - item.options = this.state.returnoptions - } else { - item.options = this.state.currentoptions - } - } - - return item - }) - }) - this.props.form.setFieldsValue({ - execError: 'never' - }) - } } onChange = (e, key) => { @@ -339,7 +285,6 @@ showSearch filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} getPopupContainer={() => document.getElementById('winter')} - onChange={(val) => this.selectChange(item.key, val)} disabled={!!item.readonly} > {item.options.map((option, index) => @@ -355,7 +300,12 @@ } else if (item.type === 'radio') { fields.push( <Col span={12} key={index}> - <Form.Item label={item.label}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" title={item.tooltip}> + <Icon type="question-circle" /> + {item.label} + </Tooltip> : item.label + }> {getFieldDecorator(item.key, { initialValue: item.initVal, rules: [ -- Gitblit v1.8.0