From 59db6fab9c1ed1fa5559d423d439e14ea33b1598 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 27 四月 2023 11:18:24 +0800 Subject: [PATCH] Merge branch 'develop' --- src/templates/zshare/codemirror/replaceform/index.jsx | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/templates/zshare/codemirror/replaceform/index.jsx b/src/templates/zshare/codemirror/replaceform/index.jsx index 41a9906..2cf2646 100644 --- a/src/templates/zshare/codemirror/replaceform/index.jsx +++ b/src/templates/zshare/codemirror/replaceform/index.jsx @@ -8,6 +8,25 @@ inputSubmit: PropTypes.func // 鍥炶溅浜嬩欢 } + state = { + orivalue: '', + value: '' + } + + UNSAFE_componentWillMount() { + let _href = window.location.href.split('#')[0] + let res = localStorage.getItem(_href + 'sql_char') + + if (res) { + res = JSON.parse(res) + + this.setState({ + orivalue: res[0] || '', + value: res[1] || '' + }) + } + } + componentDidMount () { try { let _form = document.getElementById('origin') @@ -40,6 +59,7 @@ render() { const { getFieldDecorator } = this.props.form + const { orivalue, value } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -56,7 +76,7 @@ <Col span={24}> <Form.Item label="鍘熷瓧绗�"> {getFieldDecorator('origin', { - initialValue: '', + initialValue: orivalue, rules: [ { required: true, @@ -69,7 +89,7 @@ <Col span={24}> <Form.Item label="鏇挎崲涓�"> {getFieldDecorator('value', { - initialValue: '' + initialValue: value })(<Input autoComplete="off" onPressEnter={this.enterPress}/>)} </Form.Item> </Col> -- Gitblit v1.8.0