From 523cec6c87d88b43954a4409a8dfde6aade095a1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 22 五月 2020 11:02:10 +0800 Subject: [PATCH] 2020-05-22 --- src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx index 2924724..cab711c 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx @@ -11,6 +11,7 @@ class CustomForm extends Component { static propTpyes = { + type: PropTypes.string, // 鑿滃崟绫诲瀷 dict: PropTypes.object, // 瀛楀吀椤� setting: PropTypes.object, // 璁剧疆 searches: PropTypes.array, // 鎼滅储鏉′欢 @@ -59,6 +60,15 @@ this.props.form.setFieldsValue({ sql: record.sql, initsql: record.initsql || 'false' + }) + } + + handleCancel = () => { + this.setState({ + editItem: null + }) + this.props.form.setFieldsValue({ + sql: '' }) } @@ -209,7 +219,7 @@ } render() { - const { systemScripts, setting } = this.props + const { systemScripts, setting, type } = this.props const { getFieldDecorator } = this.props.form const { usefulFields } = this.state const formItemLayout = { @@ -233,12 +243,12 @@ </Col> : null} <Col span={16}> <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0}}> - errorCode, errmsg + ErrorCode, retmsg </Form.Item> </Col> <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> - id, bid, loginuid, sessionuid, userid, appkey, orderBy{setting.laypage !== 'false' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''} + id, bid, loginuid, sessionuid, userid, appkey, {type === 'main' ? 'out_id, ' : '' }time_id, orderBy{setting.laypage !== 'false' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''} </Form.Item> </Col> <Col span={8} style={{whiteSpace: 'nowrap'}}> @@ -266,10 +276,13 @@ </Select> </Form.Item> </Col> - <Col span={4} className="add"> - <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> + <Col span={6} className="add"> + <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginTop: 5, marginBottom: 15, marginLeft: 30}}> 淇濆瓨 </Button> + <Button onClick={this.handleCancel} style={{marginTop: 5, marginBottom: 15, marginLeft: 10}}> + 鍙栨秷 + </Button> </Col> <Col span={24} className="sql"> <Form.Item label={'sql'}> -- Gitblit v1.8.0