| | |
| | | }, { |
| | | value: 'custom', |
| | | text: this.props.dict['header.form.custom'] |
| | | }], |
| | | interTypeOptions: [{ |
| | | value: 'system', |
| | | text: this.props.dict['model.interface.system'] |
| | | }, { |
| | | value: 'inner', |
| | | text: this.props.dict['model.interface.inner'] |
| | | }, { |
| | | value: 'outer', |
| | | text: this.props.dict['model.interface.outer'] |
| | | }, { |
| | | value: 'custom', |
| | | text: '自定义' |
| | | }] |
| | | } |
| | | |
| | |
| | | const { card } = this.props |
| | | |
| | | let _opentype = card.OpenType // 打开方式 |
| | | let _tabType = card.tabType || 'SubTable' // 按钮为弹窗(标签)时,标签的类型 |
| | | // let _tabType = card.tabType || 'SubTable' // 按钮为弹窗(标签)时,标签的类型 |
| | | let _intertype = card.intertype || 'system' // 接口类型 |
| | | let _funcType = card.funcType || '' // 功能按钮默认类型 |
| | | let _tabTemplate = card.tabTemplate // 按钮为标签页时,标签类型:三级菜单或表单标签页 |
| | |
| | | _opentype = 'tab' |
| | | } |
| | | |
| | | let _tabs = this.props.tabs.filter(tab => tab.type === _tabType) |
| | | let _tabs = this.props.tabs.filter(tab => tab.type === 'SubTable') |
| | | let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _tabTemplate) |
| | | |
| | | this.setState({ |
| | |
| | | item.options = btnClasses |
| | | } else if (item.key === 'icon') { |
| | | item.options = btnIcons |
| | | } else if (item.key === 'intertype') { |
| | | let iscustom = ['pop', 'prompt', 'exec'].includes(_opentype) |
| | | item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom')) |
| | | } else if (item.key === 'Ot') { |
| | | if (card.position === 'grid' || _pageTemplate === 'pay') { // 行级按钮、支付按钮,只能选单行 |
| | | item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | |
| | | } |
| | | } |
| | | } else if (_opentype !== 'popview') { // 打开方式不是弹窗页面时 |
| | | if (_intertype === 'outer') { |
| | | if (_intertype === 'custom') { |
| | | _options.push('sql', 'sqlType', 'innerFunc', 'interface', 'callbackType', 'cbTable', 'proInterface', 'method') |
| | | } else if (_intertype === 'outer') { |
| | | _options.push('innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc') |
| | | } else if (_intertype === 'inner') { |
| | | _options.push('innerFunc') |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 下拉切换 |
| | | * 1、打开方式切换,重置可见表单和表单值 |
| | | * 2、显示位置切换,重置选择行 |
| | | * 3、切换标签类型,重置可选标签 |
| | | * @description 切换 |
| | | */ |
| | | openTypeChange = (key, value) => { |
| | | optionChange = (key, value) => { |
| | | const { openType, funcType } = this.state |
| | | const { card } = this.props |
| | | |
| | | if (key === 'OpenType') { |
| | | let _options = this.getOptions(value, this.state.interType, this.state.funcType, this.state.pageTemplate, card.tabTemplate) |
| | | let _options = this.getOptions(value, 'system', '', this.state.pageTemplate, card.tabTemplate) |
| | | let _fieldval = {} |
| | | let _formlist = this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | |
| | | if (item.key === 'intertype') { |
| | | let iscustom = ['pop', 'prompt', 'exec'].includes(value) |
| | | item.options = this.state.interTypeOptions.filter(op => (iscustom || op.value !== 'custom')) |
| | | } |
| | | |
| | | if (item.hidden) return item |
| | | |
| | | if (item.key === 'intertype') { |
| | | _fieldval.intertype = this.state.interType |
| | | _fieldval.intertype = 'system' |
| | | } else if (item.key === 'Ot') { |
| | | if (this.state.position === 'grid' || this.state.pageTemplate === 'pay') { |
| | | item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | |
| | | |
| | | this.setState({ |
| | | openType: value, |
| | | funcType: '', |
| | | intertype: 'system', |
| | | formlist: _formlist |
| | | }, () => { |
| | | if (value === 'excelIn') { |
| | |
| | | if (value === 'grid' || this.state.pageTemplate === 'pay') { |
| | | item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | _fieldval.Ot = 'requiredSgl' |
| | | } else if (this.state.openType === 'innerpage' && this.state.pageTemplate === 'billprint') { |
| | | } else if (openType === 'innerpage' && this.state.pageTemplate === 'billprint') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl', 'required'].includes(op.value)) |
| | | _fieldval.Ot = 'requiredSgl' |
| | | } else if (['innerpage', 'blank', 'tab', 'popview'].includes(this.state.openType)) { |
| | | } else if (['innerpage', 'blank', 'tab', 'popview'].includes(openType)) { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | _fieldval.Ot = 'requiredSgl' |
| | | } else { |
| | |
| | | }, () => { |
| | | this.props.form.setFieldsValue(_fieldval) |
| | | }) |
| | | } else if (key === 'tabType') { |
| | | let _tabs = this.props.tabs.filter(tab => tab.type === value) |
| | | let _fieldval = {} |
| | | // } else if (key === 'tabType') { |
| | | // let _tabs = this.props.tabs.filter(tab => tab.type === value) |
| | | // let _fieldval = {} |
| | | |
| | | this.setState({ |
| | | formlist: this.state.formlist.map(item => { |
| | | if (item.key === 'linkTab') { |
| | | item.options = [ |
| | | { |
| | | value: '', |
| | | text: '新建' |
| | | }, |
| | | ..._tabs |
| | | ] |
| | | } |
| | | return item |
| | | }) |
| | | }, () => { |
| | | this.props.form.setFieldsValue(_fieldval) |
| | | }) |
| | | // this.setState({ |
| | | // formlist: this.state.formlist.map(item => { |
| | | // if (item.key === 'linkTab') { |
| | | // item.options = [ |
| | | // { |
| | | // value: '', |
| | | // text: '新建' |
| | | // }, |
| | | // ..._tabs |
| | | // ] |
| | | // } |
| | | // return item |
| | | // }) |
| | | // }, () => { |
| | | // this.props.form.setFieldsValue(_fieldval) |
| | | // }) |
| | | } else if (key === 'funcType') { |
| | | let _options = this.getOptions('funcbutton', this.state.interType, value, card.pageTemplate, card.tabTemplate) |
| | | let _fieldval = {} |
| | |
| | | return item |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | onChange = (e, key) => { |
| | | const { openType, funcType } = this.state |
| | | let value = e.target.value |
| | | |
| | | if (key === 'intertype') { |
| | | } else if (key === 'intertype') { |
| | | let _options = this.getOptions(openType, value, funcType, '', '') |
| | | |
| | | this.setState({ |
| | |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.openTypeChange(item.key, value)}} |
| | | onChange={(value) => {this.optionChange(item.key, value)}} |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onChange(e, item.key)}} disabled={item.readonly}> |
| | | <Radio.Group onChange={(e) => {this.optionChange(item.key, e.target.value)}} disabled={item.readonly}> |
| | | { |
| | | item.options.map(option => { |
| | | return ( |