From f1bac4fe4feacc8110ce98b0f54e675cd07713cd Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 18 五月 2022 23:44:32 +0800 Subject: [PATCH] 2022-05-18 --- src/templates/zshare/editcomponent/index.jsx | 2 +- src/tabviews/zshare/mutilform/index.jsx | 5 +++++ src/templates/zshare/editTable/index.jsx | 2 +- src/templates/zshare/formconfig.jsx | 3 +++ src/templates/formtabconfig/index.jsx | 1 + src/templates/zshare/pasteform/index.jsx | 22 ++++++++++++++++++++-- 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 1db51b6..b5a2231 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -261,6 +261,11 @@ 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, diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index a13d249..f9d7b32 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -2098,6 +2098,7 @@ <PasteForm dict={this.state.dict} wrappedComponentRef={(inst) => this.pasteFormRef = inst} + inputSubmit={this.pasteSubmit} /> </Modal> {this.state.loading && <Spin size="large" />} diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index ef0ff17..a1091fc 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -632,7 +632,7 @@ 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> diff --git a/src/templates/zshare/editcomponent/index.jsx b/src/templates/zshare/editcomponent/index.jsx index f26d9e3..3029835 100644 --- a/src/templates/zshare/editcomponent/index.jsx +++ b/src/templates/zshare/editcomponent/index.jsx @@ -227,7 +227,7 @@ onCancel={() => {this.setState({pasteVisible: false})}} destroyOnClose > - <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst}/> + <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/> </Modal> </div> ) diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index f81c734..e67cd6e 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2898,6 +2898,9 @@ }, { value: 'phone', text: '鎵嬫満鍙�' + }, { + value: 'email', + text: '閭' }] }, { diff --git a/src/templates/zshare/pasteform/index.jsx b/src/templates/zshare/pasteform/index.jsx index 6b5cd34..2facaa2 100644 --- a/src/templates/zshare/pasteform/index.jsx +++ b/src/templates/zshare/pasteform/index.jsx @@ -26,7 +26,17 @@ 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))) @@ -63,6 +73,14 @@ }) } + enterPress = (e) => { + e.stopPropagation() + + setTimeout(() => { + this.props.inputSubmit && this.props.inputSubmit() + }, 200) + } + render() { const { getFieldDecorator } = this.props.form const formItemLayout = { @@ -88,7 +106,7 @@ message: '璇疯緭鍏ラ厤缃俊鎭�!' } ] - })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }}/>)} + })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }} onPressEnter={this.enterPress}/>)} </Form.Item> </Col> </Row> -- Gitblit v1.8.0