From bf772e586c29b4858366dbad143b1eaeca3c46ed Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 17 四月 2020 10:18:09 +0800 Subject: [PATCH] 2020-04-17 --- src/templates/zshare/verifycardexcelin/customscript/index.jsx | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/templates/zshare/verifycardexcelin/customscript/index.jsx b/src/templates/zshare/verifycardexcelin/customscript/index.jsx index d436de3..18e0aaa 100644 --- a/src/templates/zshare/verifycardexcelin/customscript/index.jsx +++ b/src/templates/zshare/verifycardexcelin/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 } from 'antd' +import { Form, Row, Col, Input, Button, notification, Modal, Select, Icon, Tooltip, Radio } from 'antd' import moment from 'moment' import Utils from '@/utils/utils.js' @@ -16,6 +16,7 @@ scripts: PropTypes.array, // 鑷畾涔夎剼鏈垪琛� isdefault: PropTypes.any, // 鏄惁浣跨敤榛樿sql usefulfields: PropTypes.any, // 鍙敤瀛楁 + systemScripts: PropTypes.array, // 绯荤粺鑴氭湰 scriptsChange: PropTypes.func // 琛ㄥ崟 } @@ -67,7 +68,8 @@ }) this.props.form.setFieldsValue({ - sql: record.sql + sql: record.sql, + position: record.position || 'back' }) } @@ -158,7 +160,14 @@ }) } + selectScript = (val) => { + this.props.form.setFieldsValue({ + sql: val + }) + } + render() { + const { systemScripts } = this.props const { usefulfields } = this.state const { getFieldDecorator } = this.props.form const formItemLayout = { @@ -180,7 +189,7 @@ {usefulfields} </Form.Item> </Col> : null} - <Col span={21} className="sql"> + <Col span={20} className="sql"> <Form.Item label={'sql'}> {getFieldDecorator('sql', { initialValue: '', @@ -193,10 +202,39 @@ })(<TextArea rows={15} />)} </Form.Item> </Col> - <Col span={3} className="add"> - <Button onClick={this.handleConfirm} loading={this.state.loading} type="primary" className="add-row"> + <Col span={4} className="add"> + <Button onClick={this.handleConfirm} loading={this.state.loading} type="primary" style={{marginBottom: 20}}> 纭畾 </Button> + <Form.Item labelAlign="left" label={ + <Tooltip placement="bottomLeft" title={'鑷畾涔夎剼鏈笌榛樿sql浣嶇疆鍏崇郴銆�'}> + <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> + 鎵ц浣嶇疆 + </Tooltip> + } labelCol={{xs: { span: 24 }, sm: { span: 24 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} }> + {getFieldDecorator('position', { + initialValue: 'back' + })( + <Radio.Group> + <Radio value="front">sql鍓�</Radio> + <Radio value="back">sql鍚�</Radio> + </Radio.Group> + )} + </Form.Item> + <Form.Item labelAlign="left" label={ + <Tooltip placement="bottomLeft" title={'浠庣郴缁熷嚱鏁伴泦涓�夋嫨闇�瑕佺殑鍑芥暟锛屽彲蹇�熸坊鍔犺嚦sql涓��'}> + <Icon type="question-circle" style={{color: '#c49f47', marginRight: '5px'}} /> + 蹇嵎娣诲姞 + </Tooltip> + } labelCol={{xs: { span: 24 }, sm: { span: 24 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} }> + <Select onChange={this.selectScript}> + {systemScripts.map((option, i) => + <Select.Option title={option.name} key={i} value={option.value}> + {option.name} + </Select.Option> + )} + </Select> + </Form.Item> </Col> </Row> </Form> -- Gitblit v1.8.0