| | |
| | | UNSAFE_componentWillMount () { |
| | | const { card } = this.props |
| | | let _intertype = '' |
| | | let _options = null |
| | | let _success = 'close' |
| | | let _error = 'notclose' |
| | | |
| | | this.props.formlist.forEach(form => { |
| | | if (form.key === 'intertype') { |
| | | _intertype = form.initVal |
| | | 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') { |
| | |
| | | } |
| | | }) |
| | | |
| | | if (card.btnType === 'cancel') { |
| | | _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess'] |
| | | } 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'] |
| | | } |
| | | } |
| | | let _options = this.getOptions(card.btnType, _intertype) |
| | | |
| | | this.setState({ |
| | | formlist: this.props.formlist.map(item => { |
| | |
| | | } |
| | | } |
| | | |
| | | getOptions = (btnType, intertype) => { |
| | | let _options = [] |
| | | |
| | | if (btnType === 'cancel') { |
| | | _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess'] |
| | | } else if (btnType === 'confirm') { |
| | | if (intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'afterExecSuccess', 'afterExecError'] |
| | | } else if (intertype === 'system') { |
| | | _options = ['label', 'OpenType', 'intertype', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType', 'afterExecSuccess', 'afterExecError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', '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'] |
| | | } |
| | | } |
| | | |
| | | return _options |
| | | } |
| | | |
| | | selectChange = (key, value) => { |
| | | if (key === 'afterExecSuccess') { |
| | | this.setState({ |
| | |
| | | let value = e.target.value |
| | | |
| | | if (key === 'intertype') { |
| | | let _options = null |
| | | |
| | | 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 { |
| | | 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'] |
| | | } |
| | | } |
| | | let _options = this.getOptions(card.btnType, value) |
| | | |
| | | this.setState({ |
| | | interType: value, |
| | |
| | | item.readonly = false |
| | | } else if (item.key === 'sysInterface') { |
| | | item.initVal = 'false' |
| | | } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && value === 'inner') { |
| | | } else if (item.key === 'innerFunc' && value === 'inner') { |
| | | item.required = true |
| | | } else if (item.key === 'innerFunc' && card.btnType !== 'confirm' && value === 'outer') { |
| | | } else if (item.key === 'innerFunc' && value === 'outer') { |
| | | item.required = false |
| | | } |
| | | |