| | |
| | | exec: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width', 'openmenu', 'open', 'output', 'refreshTab', 'reload'], |
| | | excelIn: ['label', 'Ot', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'sheet', 'execSuccess', 'execError', 'resetPageIndex', 'syncComponent', 'switchTab', 'width'], |
| | | excelOut: ['label', 'OpenType', 'intertype', 'show', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'resetPageIndex', 'pagination', 'search', 'width'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'placement', 'syncComponent', 'clickouter'], |
| | | popview: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'popClose', 'resetPageIndex', 'width', 'display', 'ratio', 'syncComponent', 'clickouter'], |
| | | tab: ['label', 'Ot', 'OpenType', 'show', 'icon', 'class', 'color', 'linkmenu', 'width'], |
| | | innerpage: ['label', 'Ot', 'OpenType', 'pageTemplate', 'show', 'swipe', 'icon', 'class', 'color', 'width', 'open'], |
| | | funcbutton: ['label', 'OpenType', 'funcType', 'show', 'swipe', 'icon', 'class', 'color', 'width'] |
| | |
| | | funcType: null, // 功能类型 |
| | | procMode: null, // 参数方式 |
| | | control: '', |
| | | display: '', |
| | | pageTemplate: null, |
| | | appType: sessionStorage.getItem('appType'), |
| | | Ot: null, |
| | |
| | | let _intertype = card.intertype || 'system' // 接口类型 |
| | | let _funcType = card.funcType || '' // 功能按钮默认类型 |
| | | let _procMode = card.procMode || 'system' |
| | | let _display = card.display || 'modal' |
| | | let _Ot = card.Ot |
| | | let _pageTemplate = card.pageTemplate || '' |
| | | let control = card.control || '' |
| | | |
| | | let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, control) |
| | | let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, control, _display) |
| | | |
| | | this.setState({ |
| | | Ot: _Ot, |
| | | display: _display, |
| | | control: control, |
| | | openType: _opentype, |
| | | interType: _intertype, |
| | |
| | | }) |
| | | } |
| | | |
| | | getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, _control) => { |
| | | getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot, _control, _display) => { |
| | | let _options = actionTypeOptions[_opentype] ? fromJS(actionTypeOptions[_opentype]).toJS() : [] // 选项列表 |
| | | |
| | | if (_opentype === 'innerpage') { // 新页面,可选模板(自定义时,可填入外部链接) |
| | |
| | | } else if (_funcType === 'goBack') { |
| | | _options.push('reload') |
| | | } |
| | | } else if (_opentype !== 'popview' && _opentype !== 'tab') { |
| | | } else if (_opentype === 'popview') { |
| | | if (_display === 'drawer') { |
| | | _options.push('placement') |
| | | } |
| | | } else if (_opentype !== 'tab') { |
| | | if (_intertype === 'custom') { |
| | | _options = _options.filter(m => m !== 'output') |
| | | _options.push('procMode', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method', 'cross') |
| | |
| | | */ |
| | | optionChange = (key, value) => { |
| | | const { type } = this.props |
| | | const { openType, procMode, Ot, pageTemplate, control } = this.state |
| | | const { openType, procMode, Ot, pageTemplate, control, display } = this.state |
| | | |
| | | if (key === 'OpenType') { |
| | | let _options = this.getOptions(value, 'system', this.state.funcType, '', 'system', Ot, control) |
| | | let _options = this.getOptions(value, 'system', this.state.funcType, '', 'system', Ot, control, 'modal') |
| | | |
| | | let _fieldval = {} |
| | | let _formlist = this.state.formlist.map(item => { |
| | |
| | | item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom')) |
| | | } else if (item.key === 'control') { |
| | | item.initVal = control |
| | | } else if (item.key === 'display') { |
| | | item.initVal = 'modal' |
| | | } |
| | | |
| | | if (item.hidden) return item |
| | |
| | | openType: value, |
| | | intertype: 'system', |
| | | procMode: 'system', |
| | | display: 'modal', |
| | | pageTemplate: '', |
| | | formlist: _formlist |
| | | }, () => { |
| | |
| | | this.props.form.setFieldsValue(_fieldval) |
| | | }) |
| | | } else if (key === 'funcType') { |
| | | let _options = this.getOptions(openType, this.state.interType, value, pageTemplate, procMode, Ot, control) |
| | | let _options = this.getOptions(openType, this.state.interType, value, pageTemplate, procMode, Ot, control, display) |
| | | let _fieldval = {} |
| | | |
| | | if (value === 'print') { |
| | |
| | | }) |
| | | } else if (key === 'pageTemplate') { |
| | | let _fieldval = {} |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode, Ot, control) |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode, Ot, control, display) |
| | | |
| | | this.setState({ |
| | | pageTemplate: value, |
| | |
| | | this.props.form.setFieldsValue(_fieldval) |
| | | }) |
| | | } else if (key === 'intertype') { |
| | | let _options = this.getOptions(openType, value, this.state.funcType, pageTemplate, procMode, Ot, control) |
| | | let _options = this.getOptions(openType, value, this.state.funcType, pageTemplate, procMode, Ot, control, display) |
| | | |
| | | this.setState({ |
| | | interType: value, |
| | |
| | | }) |
| | | }) |
| | | } else if (key === 'procMode') { |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, value, Ot, control) |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, value, Ot, control, display) |
| | | |
| | | this.setState({ |
| | | procMode: value, |
| | |
| | | }) |
| | | }) |
| | | } else if (key === 'Ot') { |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, value, control) |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, value, control, display) |
| | | |
| | | this.setState({ |
| | | Ot: value, |
| | |
| | | }) |
| | | }) |
| | | } else if (key === 'control') { |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, Ot, value) |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, Ot, value, display) |
| | | |
| | | this.setState({ |
| | | control: value, |
| | |
| | | return item |
| | | }) |
| | | }) |
| | | } else if (key === 'display') { |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, Ot, control, value) |
| | | |
| | | this.setState({ |
| | | display: value, |
| | | formlist: this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | return item |
| | | }) |
| | | }) |
| | | } else if (key === 'sysInterface') { |
| | | if (value === 'true') { |
| | | this.props.form.setFieldsValue({ |