| | |
| | | import Utils from '@/utils/utils.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import KeyInterface from '@/components/keyInterface' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | updateStatus: PropTypes.func, |
| | | config: PropTypes.object, // 组件配置 |
| | | setting: PropTypes.object, // 数据源配置 |
| | | columns: PropTypes.array, // 列设置 |
| | |
| | | if (key === 'sysInterface' && value === 'true') { |
| | | this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi}) |
| | | } |
| | | this.props.updateStatus(setting) |
| | | } |
| | | |
| | | render() { |
| | |
| | | message: '表名最长为50个字符!' |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z@_]+$/, |
| | | message: '表名只可使用字母以及_' |
| | | pattern: /^[a-zA-Z0-9@_]+$/, |
| | | message: '表名只可使用字母、数字以及_' |
| | | } |
| | | ] |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | |
| | | </Col> |
| | | {setting.interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="单点登录系统"> |
| | | <Tooltip placement="topLeft" title="业务系统指同一sso下的其他业务系统,外部系统指不同sso下的其他业务系统。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 系统接口 |
| | | 系统类型 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sysInterface', { |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择是否使用系统接口!' |
| | | message: '请选择系统类型!' |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'sysInterface')}}> |
| | | <Radio value="true">是</Radio> |
| | | <Radio value="false">否</Radio> |
| | | <Radio value="false">业务</Radio> |
| | | <Radio value="true">单点</Radio> |
| | | <Radio value="external">外部</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' ? <Col className="outer-interface" span={24}> |
| | | {setting.interType === 'outer' && setting.sysInterface !== 'external' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: setting.interface || (setting.sysInterface === 'true' ? window.GLOB.mainSystemApi : ''), |
| | |
| | | })(<TextArea rows={2} readOnly={setting.sysInterface === 'true'}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' && setting.sysInterface !== 'true' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址,为空时使用接口地址"> |
| | | {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('exInterface', { |
| | | initialValue: setting.exInterface, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请编辑接口地址!' |
| | | } |
| | | ] |
| | | })(<KeyInterface type="develop"/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' && setting.sysInterface === 'false' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址,为空时使用接口地址。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 正式地址 |
| | | </Tooltip> |
| | |
| | | {getFieldDecorator('proInterface', { |
| | | initialValue: setting.proInterface || '' |
| | | })(<TextArea rows={2}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' && setting.sysInterface === 'external' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 正式地址 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('exProInterface', { |
| | | initialValue: setting.exProInterface || '' |
| | | })(<KeyInterface type="product"/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {setting.interType === 'outer' ? <Col span={8}> |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {/* 1、不分页且不存在上级模块 */} |
| | | {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') ? <Col span={8}> |
| | | {!['navbar', 'interface'].includes(config.type) && !['editable', 'basetable'].includes(config.subtype) && (!config.pageable || (config.pageable && setting.laypage === 'false')) && (setting.supModule.length === 0 || setting.supModule[0] === 'empty') && setting.interType === 'system' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title={'初始化加载时,是否与其他组件一同加载数据,注:仅在使用系统函数,且初始化加载数据时有效,分页请求时无效。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |