| | |
| | | position: null, // 按钮位置 |
| | | procMode: null, // 外部接口参数处理方式 |
| | | pageTemplate: null, |
| | | Ot: null, |
| | | requireOptions: [{ |
| | | value: 'notRequired', |
| | | text: this.props.dict['header.form.notRequired'] |
| | |
| | | let _funcType = card.funcType || '' // 功能按钮默认类型 |
| | | let _tabTemplate = card.tabTemplate // 按钮为标签页时,标签类型:三级菜单或表单标签页 |
| | | let _pageTemplate = card.pageTemplate // 新页面类型 |
| | | let _Ot = card.Ot || 'requiredSgl' |
| | | |
| | | if (_opentype === 'outerpage') { |
| | | card.pageTemplate = 'custom' |
| | |
| | | } |
| | | |
| | | let _tabs = this.props.tabs.filter(tab => tab.type === 'SubTable') |
| | | let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode) |
| | | let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode, _Ot) |
| | | |
| | | this.setState({ |
| | | Ot: _Ot, |
| | | openType: _opentype, |
| | | pageTemplate: _pageTemplate, |
| | | interType: _intertype, |
| | |
| | | } |
| | | } |
| | | |
| | | getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode) => { |
| | | getOptions = (_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate, _procMode, _Ot) => { |
| | | let _options = fromJS(actionTypeOptions[_opentype]).toJS() // 选项列表 |
| | | |
| | | if (_opentype === 'innerpage') { // 新页面,可选模板(自定义时,可填入外部链接) |
| | |
| | | _options.push('resetPageIndex') |
| | | } |
| | | |
| | | if (_Ot !== 'notRequired' && _opentype !== 'excelOut') { |
| | | _options.push('controlField', 'controlVal') |
| | | } |
| | | |
| | | return _options |
| | | } |
| | | |
| | |
| | | * @description 切换 |
| | | */ |
| | | optionChange = (key, value) => { |
| | | const { openType, funcType, procMode } = this.state |
| | | const { openType, funcType, procMode, Ot } = this.state |
| | | const { card } = this.props |
| | | |
| | | if (key === 'OpenType') { |
| | | let _options = this.getOptions(value, 'system', '', this.state.pageTemplate, card.tabTemplate, 'system') |
| | | let _options = this.getOptions(value, 'system', '', this.state.pageTemplate, card.tabTemplate, 'system', Ot) |
| | | let _fieldval = {} |
| | | let _formlist = this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | |
| | | // this.props.form.setFieldsValue(_fieldval) |
| | | // }) |
| | | } else if (key === 'funcType') { |
| | | let _options = this.getOptions('funcbutton', this.state.interType, value, card.pageTemplate, card.tabTemplate, procMode) |
| | | let _options = this.getOptions('funcbutton', this.state.interType, value, card.pageTemplate, card.tabTemplate, procMode, Ot) |
| | | let _fieldval = {} |
| | | |
| | | this.setState({ |
| | |
| | | this.props.form.setFieldsValue(_fieldval) |
| | | }) |
| | | } else if (key === 'pageTemplate') { |
| | | let _options = this.getOptions('innerpage', this.state.interType, this.state.funcType, value, card.tabTemplate, procMode) |
| | | let _options = this.getOptions('innerpage', this.state.interType, this.state.funcType, value, card.tabTemplate, procMode, Ot) |
| | | let _fieldval = {} |
| | | |
| | | this.setState({ |
| | |
| | | }) |
| | | }) |
| | | } else if (key === 'intertype') { |
| | | let _options = this.getOptions(openType, value, funcType, '', '', procMode) |
| | | let _options = this.getOptions(openType, value, funcType, '', '', procMode, Ot) |
| | | |
| | | this.setState({ |
| | | interType: value, |
| | |
| | | }) |
| | | }) |
| | | } else if (key === 'procMode') { |
| | | let _options = this.getOptions(openType, this.state.interType, funcType, '', '', value) |
| | | let _options = this.getOptions(openType, this.state.interType, funcType, '', '', value, Ot) |
| | | |
| | | this.setState({ |
| | | procMode: value, |
| | |
| | | if (item.key === 'innerFunc') { |
| | | item.required = true |
| | | } |
| | | return item |
| | | }) |
| | | }) |
| | | } else if (key === 'Ot') { |
| | | let _options = this.getOptions(openType, this.state.interType, funcType, this.state.pageTemplate, card.tabTemplate, procMode, value) |
| | | |
| | | this.setState({ |
| | | Ot: value, |
| | | formlist: this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | return item |
| | | }) |
| | | }) |
| | |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value}> |
| | | {item.key === 'icon' && option.value && <Icon type={option.value} />} {option.text} |
| | | <Select.Option id={`${index}`} title={option.text} key={`${index}`} value={option.value || option.field}> |
| | | {item.key === 'icon' && option.value ? <Icon type={option.value} /> : null} {option.text || option.label} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |