From 2031a460f6c0827fe80f8c625dd98333d1631d2f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 08 五月 2020 22:10:48 +0800 Subject: [PATCH] 2020-05-08 --- src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx | 47 ++++++++++++++++++++++++----------------------- 1 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx index ad8097e..b606b5a 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/customscript/index.jsx @@ -1,6 +1,6 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' -import { Form, Row, Col, Input, Button, notification, Modal, Menu, Icon, Radio, Dropdown } from 'antd' +import { Form, Row, Col, Input, Button, notification, Modal, Select, Radio } from 'antd' import moment from 'moment' import Utils from '@/utils/utils.js' @@ -129,11 +129,7 @@ }) } - selectScript = (e) => { - const { systemScripts } = this.props - - let option = systemScripts[+e.key] - + selectScript = (value, option) => { let _sql = this.props.form.getFieldValue('sql') if (_sql) { _sql = _sql + ` @@ -142,10 +138,10 @@ } _sql = _sql.replace(/\s{6}$/, '') - _sql = _sql + `/*${option.name}*/ + _sql = _sql + `/*${option.props.children}*/ ` _sql = _sql.replace(/\s{4}$/, '') - _sql = _sql + option.value + _sql = _sql + value this.props.form.setFieldsValue({ sql: _sql @@ -169,6 +165,16 @@ return ( <Form {...formItemLayout} className="modal-menu-setting-script"> <Row gutter={24}> + {tableName ? <Col span={8}> + <Form.Item label={'琛ㄥ悕'} style={{whiteSpace: 'nowrap', margin: 0}}> + {tableName} + </Form.Item> + </Col> : null} + <Col span={16}> + <Form.Item label={'鎶ラ敊瀛楁'} style={{margin: 0}}> + errorCode, errmsg + </Form.Item> + </Col> <Col span={24} className="sqlfield"> <Form.Item label={'鍙敤瀛楁'}> id, bid, loginuid, sessionuid, userid, appkey @@ -186,28 +192,23 @@ )} </Form.Item> </Col> - <Col span={4} style={{lineHeight: '40px', textAlign: 'center'}}> - <Dropdown trigger={['click']} overlayClassName="mk-normal-dropdown" overlay={ - <Menu onClick={this.selectScript}> + <Col span={10}> + <Form.Item label={'蹇嵎娣诲姞'} style={{marginBottom: 0}}> + <Select + showSearch + filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + onChange={this.selectScript} + > {systemScripts.map((option, i) => - <Menu.Item key={i}>{option.name}</Menu.Item> + <Select.Option style={{whiteSpace: 'normal'}} key={i} value={option.value}>{option.name}</Select.Option> )} - </Menu> - }> - <span style={{color: '#1890ff', display: 'inline-block', cursor: 'pointer'}}> - 蹇嵎娣诲姞 <Icon type="down" style={{marginRight: '5px'}} /> - </span> - </Dropdown> + </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}}> 淇濆瓨 </Button> - </Col> - <Col span={8} style={{textAlign: 'right'}}> - {tableName ? <span style={{maxWidth: '100%', display: 'inline-block', position: 'relative', top: '20px', whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden'}}> - 琛ㄥ悕: {tableName} - </span> : null} </Col> <Col span={24} className="sql"> <Form.Item label={'sql'}> -- Gitblit v1.8.0