| | |
| | | }, { |
| | | value: 'update', |
| | | text: this.props.dict['header.form.action.update'] |
| | | }], |
| | | returnoptions: [{ // 返回后-不刷新、刷新页面、刷新表格 |
| | | value: 'never', |
| | | 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'] |
| | | }], |
| | | currentoptions: [{ // 不返回时-不刷新、刷新 |
| | | value: 'never', |
| | | text: this.props.dict['header.form.refresh.never'] |
| | | }, { |
| | | value: 'refresh', |
| | | text: this.props.dict['header.form.refresh'] |
| | | }] |
| | | } |
| | | |
| | |
| | | const { card } = this.props |
| | | let _intertype = '' |
| | | let _options = null |
| | | console.log(this.props.card.btnType) |
| | | let _success = 'close' |
| | | let _error = 'notclose' |
| | | |
| | | this.props.formlist.forEach(form => { |
| | | if (form.key === 'intertype') { |
| | | _intertype = form.initVal |
| | | } else if (form.key === 'afterExecSuccess') { |
| | | _success = form.initVal |
| | | } else if (form.key === 'afterExecError') { |
| | | _error = form.initVal |
| | | } |
| | | }) |
| | | |
| | | if (card.btnType === 'cancel') { |
| | | _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess'] |
| | | } else { |
| | | this.props.formlist.forEach(form => { |
| | | if (form.key === 'intertype') { |
| | | _intertype = form.initVal |
| | | } |
| | | }) |
| | | |
| | | } else if (card.btnType === 'confirm') { |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError'] |
| | | } |
| | | } else { |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } 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 |
| | | } |
| | | } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && _intertype === 'inner') { |
| | | item.required = true |
| | | } |
| | | |
| | | item.hidden = !_options.includes(item.key) |
| | | return item |
| | | }) |
| | |
| | | } |
| | | } |
| | | |
| | | 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) => { |
| | | const { card } = this.props |
| | | |
| | | let value = e.target.value |
| | | |
| | | if (key === 'intertype') { |
| | | let _options = null |
| | | if (value === 'inner') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError'] |
| | | |
| | | if (card.btnType === 'confirm') { |
| | | if (value === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError'] |
| | | } |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'afterExecSuccess', 'afterExecError'] |
| | | if (value === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | interType: value, |
| | | formlist: this.state.formlist.map(item => { |
| | |
| | | item.readonly = false |
| | | } else if (item.key === 'sysInterface') { |
| | | item.initVal = 'false' |
| | | } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && value === 'inner') { |
| | | item.required = true |
| | | } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && value === 'outer') { |
| | | item.required = false |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | this.setState({ |
| | | // interType: value, |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'interface' && value === 'true') { |
| | | item.readonly = true |
| | |
| | | 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) => |