From ff4295358a99b2d35265a5fed445e4407cf6ed9a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 18 五月 2020 14:48:10 +0800 Subject: [PATCH] 2020-05-18 --- src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx | 37 +++++++++++++++++++++++++++++-------- 1 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx index cffe183..60519c5 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx @@ -27,15 +27,22 @@ UNSAFE_componentWillMount() { const { searches } = this.props - let _usefulFields = searches.map(item => { + + let _usefulFields = [] + searches.forEach(item => { if (item.type === 'group') { if (item.transfer === 'true') { - return item.field + ', ' + item.datefield - } else { - return item.datefield + _usefulFields.push(item.field) } + _usefulFields.push(item.datefield) + _usefulFields.push(item.datefield + '1') + } else if (['dateweek', 'datemonth', 'daterange'].includes(item.type)) { + _usefulFields.push(item.field) + _usefulFields.push(item.field + '1') + } else if (_usefulFields.includes(item.field)) { + _usefulFields.push(item.field + '1') } else { - return item.field + _usefulFields.push(item.field) } }) @@ -52,6 +59,15 @@ this.props.form.setFieldsValue({ sql: record.sql, initsql: record.initsql || 'false' + }) + } + + handleCancel = () => { + this.setState({ + editItem: null + }) + this.props.form.setFieldsValue({ + sql: '' }) } @@ -123,6 +139,8 @@ func: 's_debug_sql', LText: _initsql + values.sql + tail } + + param.LText = param.LText.replace(/@\$|\$@/ig, '') let allSearch = Utils.initMainSearch(searches) allSearch = Utils.getAllSearchOptions(allSearch) @@ -224,7 +242,7 @@ </Col> : null} <Col span={16}> <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0}}> - errorCode, errmsg + ErrorCode, retmsg </Form.Item> </Col> <Col span={24} className="sqlfield"> @@ -257,10 +275,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