| | |
| | | interType: null, // 接口类型:内部、外部 |
| | | funcType: null, // 功能类型 |
| | | procMode: null, // 参数方式 |
| | | pageTemplate: null, |
| | | Ot: null, |
| | | requireOptions: [{ |
| | | value: 'notRequired', |
| | |
| | | let _opentype = card.OpenType // 打开方式 |
| | | let _intertype = card.intertype || 'system' // 接口类型 |
| | | let _funcType = card.funcType || '' // 功能按钮默认类型 |
| | | let _procMode = card.procMode || 'system' // 参数请求方式 |
| | | let _Ot = card.Ot || 'requiredSgl' // 参数请求方式 |
| | | let _procMode = card.procMode || 'system' |
| | | let _Ot = card.Ot || 'requiredSgl' |
| | | let _pageTemplate = card.pageTemplate || '' |
| | | |
| | | let _options = this.getOptions(_opentype, _intertype, _funcType, card.pageTemplate, _procMode, _Ot) |
| | | let _options = this.getOptions(_opentype, _intertype, _funcType, _pageTemplate, _procMode, _Ot) |
| | | |
| | | this.setState({ |
| | | Ot: _Ot, |
| | |
| | | interType: _intertype, |
| | | procMode: _procMode, |
| | | funcType: _funcType, |
| | | pageTemplate: _pageTemplate, |
| | | formlist: this.props.formlist.map(item => { |
| | | if (item.key === 'class') { |
| | | item.options = btnCustomClasses |
| | |
| | | } else if (item.key === 'Ot') { |
| | | if (type === 'card') { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | | } else if (card.pageTemplate === 'pay') { // 行级按钮、支付按钮,只能选单行 |
| | | } else if (_pageTemplate === 'pay') { // 行级按钮、支付按钮,只能选单行 |
| | | item.options = this.state.requireOptions.filter(op => ['requiredSgl'].includes(op.value)) |
| | | } else if (['innerpage', 'tab', 'popview', 'excelIn'].includes(_opentype)) { |
| | | item.options = this.state.requireOptions.filter(op => ['notRequired', 'requiredSgl'].includes(op.value)) |
| | |
| | | */ |
| | | optionChange = (key, value) => { |
| | | const { card, type } = this.props |
| | | const { openType, procMode, Ot } = this.state |
| | | const { openType, procMode, Ot, pageTemplate } = this.state |
| | | |
| | | if (key === 'OpenType') { |
| | | let _options = this.getOptions(value, 'system', this.state.funcType, card.pageTemplate, 'system', Ot) |
| | | let _options = this.getOptions(value, 'system', this.state.funcType, '', 'system', Ot) |
| | | |
| | | let _fieldval = {} |
| | | |
| | | let _formlist = this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | |
| | |
| | | item.options = this.state.insertUpdateOptions |
| | | } |
| | | _fieldval.sqlType = '' |
| | | } else if (item.key === 'pageTemplate') { |
| | | item.initVal = '' |
| | | } |
| | | |
| | | return item |
| | |
| | | openType: value, |
| | | intertype: 'system', |
| | | procMode: 'system', |
| | | pageTemplate: '', |
| | | formlist: _formlist |
| | | }, () => { |
| | | if (value === 'excelIn') { |
| | |
| | | this.props.form.setFieldsValue(_fieldval) |
| | | }) |
| | | } else if (key === 'funcType') { |
| | | let _options = this.getOptions(openType, this.state.interType, value, card.pageTemplate, procMode, Ot) |
| | | let _options = this.getOptions(openType, this.state.interType, value, pageTemplate, procMode, Ot) |
| | | let _fieldval = {} |
| | | |
| | | this.setState({ |
| | |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, value, procMode, Ot) |
| | | |
| | | this.setState({ |
| | | pageTemplate: value, |
| | | formlist: this.state.formlist.map(item => { |
| | | item.hidden = !_options.includes(item.key) |
| | | |
| | |
| | | this.props.form.setFieldsValue(_fieldval) |
| | | }) |
| | | } else if (key === 'intertype') { |
| | | let _options = this.getOptions(openType, value, this.state.funcType, '', procMode, Ot) |
| | | let _options = this.getOptions(openType, value, this.state.funcType, pageTemplate, procMode, Ot) |
| | | |
| | | this.setState({ |
| | | interType: value, |
| | |
| | | }) |
| | | }) |
| | | } else if (key === 'procMode') { |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', value, Ot) |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, value, Ot) |
| | | |
| | | this.setState({ |
| | | procMode: value, |
| | |
| | | }) |
| | | }) |
| | | } else if (key === 'Ot') { |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, '', procMode, value) |
| | | let _options = this.getOptions(openType, this.state.interType, this.state.funcType, pageTemplate, procMode, value) |
| | | |
| | | this.setState({ |
| | | Ot: value, |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'select') { // 下拉搜索 |
| | | } else if (item.type === 'select') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | |
| | | })( |
| | | <Select |
| | | showSearch |
| | | filterOption={(input, option) => option.props.children[2].toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | allowClear={item.allowClear === true} |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.optionChange(item.key, value)}} |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option id={index} key={option.value || option.field} value={option.value || option.field}> |
| | | {option.text || option.label} |
| | | <Select.Option key={index} value={(option.value || option.field)}> |
| | | {(option.text || option.label)} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |