| | |
| | | formlist: null, |
| | | openType: null, |
| | | interType: null, |
| | | funcType: null, // 功能类型 |
| | | position: null, |
| | | reqOptionSgl: [{ |
| | | value: 'requiredSgl', |
| | |
| | | let _intertype = '' |
| | | let _position = '' |
| | | let _tabType = '' |
| | | let _funcType = '' // 功能按钮类型 |
| | | let _options = null |
| | | |
| | | this.props.formlist.forEach(form => { |
| | | if (form.key === 'OpenType') { |
| | | _opentype = form.initVal |
| | | if (this.props.card.execMode) { // 转换打印时打开方式 |
| | | _opentype = 'funcbutton' |
| | | } else { |
| | | _opentype = form.initVal |
| | | } |
| | | } else if (form.key === 'intertype') { |
| | | _intertype = form.initVal |
| | | } else if (form.key === 'position') { |
| | | _position = form.initVal |
| | | } else if (form.key === 'tabType') { |
| | | _tabType = form.initVal |
| | | } else if (form.key === 'funcType') { |
| | | _funcType = form.initVal |
| | | } |
| | | }) |
| | | |
| | |
| | | } else { |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } |
| | | } else if (_opentype === 'funcbutton') { |
| | | if (!_funcType) { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (_funcType === 'changeuser') { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (_funcType === 'print') { |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } |
| | | } |
| | | } else { |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | |
| | | openType: _opentype, |
| | | interType: _intertype, |
| | | position: _position, |
| | | funcType: _funcType, |
| | | formlist: this.props.formlist.map(item => { |
| | | if (item.key === 'class') { |
| | | item.options = btnClasses |
| | |
| | | }, { |
| | | value: 'popview', |
| | | text: this.props.dict['header.form.popview'] |
| | | }, { |
| | | value: 'funcbutton', |
| | | text: this.props.dict['header.form.funcbutton'] |
| | | } |
| | | ] |
| | | item.initVal = _opentype |
| | | } else if (item.key === 'execSuccess') { |
| | | item.options = this.state.closeOptions |
| | | } else if (item.key === 'execError') { |
| | |
| | | } else { |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } |
| | | } else if (value === 'funcbutton') { |
| | | if (!this.state.funcType) { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (this.state.funcType === 'changeuser') { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (this.state.funcType === 'print') { |
| | | if (this.state.interType === 'outer') { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } |
| | | } |
| | | } else { |
| | | if (this.state.interType === 'inner') { |
| | | _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] |
| | |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'Ot') { |
| | | if (item.key === 'Ot' && !(value === 'funcbutton' && (!this.state.funcType || this.state.funcType === 'changeuser'))) { |
| | | item.hidden = false |
| | | } else if (item.key === 'sqlType' && ['prompt', 'exec', 'pop'].includes(value) && this.state.interType === 'inner') { |
| | | item.hidden = false |
| | |
| | | }) |
| | | }) |
| | | }) |
| | | } else if (key === 'funcType') { |
| | | let _options = null |
| | | if (!value) { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (value === 'changeuser') { |
| | | _options = ['label', 'OpenType', 'funcType', 'icon', 'class'] |
| | | } else if (value === 'print') { |
| | | if (this.state.interType === 'outer') { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | |
| | | if (item.hidden) return item |
| | | |
| | | if (item.key === 'Ot' && value === 'print') { |
| | | item.options = this.state.reqOptionsMutil |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'Ot', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'sheet', 'execSuccess', 'execError'] |
| | | } |
| | | } else if (openType === 'funcbutton') { |
| | | if (value === 'outer') { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'funcType', 'execMode', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } |
| | | } else { |
| | | if (value === 'inner') { |
| | |
| | | values.Ot = 'notRequired' |
| | | } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id |
| | | values.linkTab = Utils.getuuid() |
| | | } else if (values.OpenType === 'funcbutton') { // 转换打印时打开方式 |
| | | values.position = 'toolbar' |
| | | if (values.funcType === 'print') { |
| | | values.OpenType = values.execMode |
| | | } |
| | | } |
| | | |
| | | if (values.innerFunc === '' && values.sql === '') { |