| | |
| | | pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/ig, |
| | | message: '请正确输入手机号' |
| | | }) |
| | | } else if (item.regular === 'email') { |
| | | _rules.push({ |
| | | pattern: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/, |
| | | message: '请正确输入邮箱地址' |
| | | }) |
| | | } else if (item.regular === 'funcname') { |
| | | _rules.push({ |
| | | pattern: /^[\u4E00-\u9FA50-9a-zA-Z_]*$/ig, |
| | |
| | | <PasteForm |
| | | dict={this.state.dict} |
| | | wrappedComponentRef={(inst) => this.pasteFormRef = inst} |
| | | inputSubmit={this.pasteSubmit} |
| | | /> |
| | | </Modal> |
| | | {this.state.loading && <Spin size="large" />} |
| | |
| | | onCancel={() => {this.setState({visible: false})}} |
| | | destroyOnClose |
| | | > |
| | | <PasteForm dict={eTDict} wrappedComponentRef={(inst) => this.pasteFormRef = inst}/> |
| | | <PasteForm dict={eTDict} wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/> |
| | | </Modal> |
| | | </div> |
| | | </EditableContext.Provider> |
| | |
| | | onCancel={() => {this.setState({pasteVisible: false})}} |
| | | destroyOnClose |
| | | > |
| | | <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst}/> |
| | | <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | |
| | | }, { |
| | | value: 'phone', |
| | | text: '手机号' |
| | | }, { |
| | | value: 'email', |
| | | text: '邮箱' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | let _config = values.config |
| | | let _config = values.config.replace(/(\n|\s)+/g, '') |
| | | |
| | | if (!_config) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入配置信息', |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | | return |
| | | } |
| | | try { |
| | | _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | enterPress = (e) => { |
| | | e.stopPropagation() |
| | | |
| | | setTimeout(() => { |
| | | this.props.inputSubmit && this.props.inputSubmit() |
| | | }, 200) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | |
| | | message: '请输入配置信息!' |
| | | } |
| | | ] |
| | | })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }}/>)} |
| | | })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }} onPressEnter={this.enterPress}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |