| | |
| | | interType: 'system', |
| | | procMode: 'script', |
| | | requestMode: 'system', |
| | | sysInterface: 'false', |
| | | controlField: '', |
| | | tableType: '', |
| | | funcTooltip: '', |
| | |
| | | procMode: setting.procMode || 'script', |
| | | requestMode: setting.requestMode || 'system', |
| | | controlField: setting.controlField || '', |
| | | sysInterface: setting.sysInterface || 'false', |
| | | tableType: setting.tableType, |
| | | funcTooltip: tooltip, |
| | | funcRules: rules |
| | |
| | | this.setState({ |
| | | requestMode: value |
| | | }) |
| | | } else if (key === 'sysInterface' && value === 'true') { |
| | | this.props.form.setFieldsValue({ |
| | | interface: window.GLOB.mainSystemApi || '' |
| | | } else if (key === 'sysInterface') { |
| | | this.setState({ |
| | | sysInterface: value |
| | | }) |
| | | if (value === 'true') { |
| | | this.props.form.setFieldsValue({ |
| | | interface: window.GLOB.mainSystemApi || '' |
| | | }) |
| | | } |
| | | } |
| | | this.props.updateStatus({[key]: value}) |
| | | } |
| | |
| | | render() { |
| | | const { setting, dict, menu, config, columns } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { interType, funcRules, funcTooltip, procMode, requestMode, tableType, controlField } = this.state |
| | | const { interType, funcRules, funcTooltip, procMode, requestMode, tableType, controlField, sysInterface } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.sysInterface']}> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: setting.sysInterface || 'false', |
| | | initialValue: sysInterface, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' || interType === 'custom' ? <Col className="data-source" span={24}> |
| | | <Form.Item label="测试地址"> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: setting.interface || '', |
| | | initialValue: setting.interface || (interType === 'outer' && sysInterface === 'true' ? window.GLOB.mainSystemApi : ''), |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: dict['form.required.input'] + '测试地址!' |
| | | required: interType === 'outer' && sysInterface === 'true' ? false : true, |
| | | message: dict['form.required.input'] + '接口地址!' |
| | | }, |
| | | ] |
| | | })(<TextArea rows={2} />)} |
| | | })(<TextArea rows={2} readOnly={interType === 'outer' && sysInterface === 'true'}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' || interType === 'custom' ? <Col className="data-source" span={24}> |
| | | {(interType === 'outer' && sysInterface !== 'true') || interType === 'custom' ? <Col className="data-source" span={24}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="正式系统所使用的的接口地址。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |