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/verifycard/customscript/index.jsx |   51 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/src/templates/zshare/verifycard/customscript/index.jsx b/src/templates/zshare/verifycard/customscript/index.jsx
index b56f0b6..cc7bf88 100644
--- a/src/templates/zshare/verifycard/customscript/index.jsx
+++ b/src/templates/zshare/verifycard/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, Tooltip, Icon, Radio } from 'antd'
 import moment from 'moment'
 
 import Utils from '@/utils/utils.js'
@@ -13,7 +13,8 @@
   static propTpyes = {
     dict: PropTypes.object,         // 瀛楀吀椤�
     usefulfields: PropTypes.string, // 鍙敤瀛楁
-    initsql: PropTypes.string,      // 鍙敤瀛楁
+    initsql: PropTypes.string,      // sql鍓嶇紑
+    systemScripts: PropTypes.array, // 绯荤粺鑴氭湰
     scriptsChange: PropTypes.func   // 琛ㄥ崟
   }
 
@@ -28,7 +29,8 @@
     })
 
     this.props.form.setFieldsValue({
-      sql: record.sql
+      sql: record.sql,
+      position: record.position || 'back'
     })
   }
 
@@ -106,8 +108,14 @@
     })
   }
 
+  selectScript = (val) => {
+    this.props.form.setFieldsValue({
+      sql: val
+    })
+  }
+
   render() {
-    const { usefulfields } = this.props
+    const { usefulfields, systemScripts } = this.props
     const { getFieldDecorator } = this.props.form
     const formItemLayout = {
       labelCol: {
@@ -128,7 +136,7 @@
               {usefulfields}
             </Form.Item>
           </Col> : null}
-          <Col span={21} className="sql">
+          <Col span={20} className="sql">
             <Form.Item label={'sql'}>
               {getFieldDecorator('sql', {
                 initialValue: '',
@@ -141,10 +149,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