| | |
| | | modules: [], |
| | | usefulFields: [], |
| | | useMSearch: this.props.setting.useMSearch || 'false', |
| | | sysInterface: this.props.setting.sysInterface || 'false', |
| | | supModule: this.props.setting.supModule || [], |
| | | appType: sessionStorage.getItem('appType') |
| | | } |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | onSysInter = (e) => { |
| | | let value = e.target.value |
| | | |
| | | |
| | | this.setState({ |
| | | sysInterface: value |
| | | }) |
| | | if (value === 'true') { |
| | | this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi}) |
| | | } |
| | |
| | | render() { |
| | | const { setting, columns, config } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { interType, modules, useMSearch, laypage, supModule, usefulFields, appType } = this.state |
| | | const { interType, modules, useMSearch, laypage, supModule, usefulFields, appType, sysInterface } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | {interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="系统接口"> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: setting.sysInterface || 'false' |
| | | initialValue: sysInterface, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择是否使用系统接口!' |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={this.onSysInter}> |
| | | <Radio value="true">是</Radio> |
| | |
| | | {interType === 'outer' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: setting.interface || '', |
| | | initialValue: setting.interface || (sysInterface === 'true' ? window.GLOB.mainSystemApi : ''), |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | required: sysInterface !== 'true' ? true : false, |
| | | message: this.props.dict['form.required.input'] + '接口地址!' |
| | | } |
| | | ] |
| | | })(<TextArea rows={2}/>)} |
| | | })(<TextArea rows={2} readOnly={sysInterface === 'true'}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col className="outer-interface" span={24}> |
| | | {interType === 'outer' && sysInterface !== 'true' ? <Col className="outer-interface" span={24}> |
| | | <Form.Item label={<Tooltip placement="topLeft" title="正式系统接口地址,为空时使用接口地址"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 正式地址 |
| | |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="外部函数"> |
| | | {getFieldDecorator('outerFunc', { |
| | | initialValue: setting.outerFunc || '', |
| | | rules: [ |
| | | |
| | | ] |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={24} className="data-source"> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: setting.interface || '', |
| | |
| | | message: this.props.dict['form.required.input'] + '接口地址!' |
| | | }, |
| | | ] |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={8}> |
| | | <Form.Item label="外部函数"> |
| | | {getFieldDecorator('outerFunc', { |
| | | initialValue: setting.outerFunc || '', |
| | | rules: [ |
| | | |
| | | ] |
| | | })(<Input placeholder={''} autoComplete="off" />)} |
| | | })(<TextArea rows={2}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'system' ? <Col span={24} className="data-source" style={{paddingLeft: '7px'}}> |
| | |
| | | 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" /> |
| | |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | |
| | | })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={12}> |
| | | {interType === 'outer' ? <Col span={24} className="data-source"> |
| | | <Form.Item label="接口地址"> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: setting.interface || '', |
| | |
| | | message: dict['form.required.input'] + '接口地址!' |
| | | } |
| | | ] |
| | | })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | })(<TextArea rows={2}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={12}> |
| | |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | // MenuID: editMenu.MenuID |
| | | MenuID: '1587005717541lov40vg61q7l1rbveon' |
| | | MenuID: editMenu.MenuID |
| | | } |
| | | |
| | | this.setState({ |