From 574ea3b532b625456c09f14fc11073aad6b61db7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 02 八月 2023 12:11:47 +0800
Subject: [PATCH] 2023-08-02

---
 src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx |   33 ++++++++++++---------------------
 1 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
index bf43e2c..2c8eaf4 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Form, Row, Col, Button, notification, Tooltip, Select } from 'antd'
+import { Form, Row, Col, Button, notification, Tooltip, Select, Switch } from 'antd'
 import moment from 'moment'
 
 import Api from '@/api'
@@ -21,6 +21,7 @@
     systemScripts: [],
     usefulfields: null,
     loading: false,
+    skip: false
   }
 
   UNSAFE_componentWillMount () {
@@ -119,6 +120,7 @@
   }
 
   handleConfirm = () => {
+    const { skip } = this.state
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     this.props.form.validateFieldsAndScroll((err, values) => {
       if (!err) {
@@ -189,6 +191,7 @@
         this.props.scriptsChange(values, (status) => {
           if (status) {
             this.setState({
+              skip: false,
               loading: false,
               editItem: null
             })
@@ -200,7 +203,7 @@
               loading: false
             })
           }
-        })
+        }, skip)
       }
     })
   }
@@ -216,20 +219,7 @@
   }
 
   selectScript = (value, option) => {
-    const { usefulfields, sheet } = this.props
-
-    let _value = ''
-    if (value === 'default') {
-      let fields = usefulfields.filter(item => item.import !== 'false')
-      fields = fields.map(col => col.Column).join(',')
-
-      let _sheet = sheet.replace(/(.*)\.(.*)\.|@db@/ig, '')
-
-      _value = `Select ${fields} From ${_sheet}`
-    } else {
-      _value = value
-    }
-
+    let _value = value
     let _sql = this.props.form.getFieldValue('sql')
     if (/^\s+$/.test(_sql)) {
       _sql = ''
@@ -253,7 +243,7 @@
 
   render() {
     const { sheet, linefields } = this.props
-    const { usefulfields, systemScripts } = this.state
+    const { usefulfields, systemScripts, skip } = this.state
     const { getFieldDecorator } = this.props.form
     const formItemLayout = {
       labelCol: {
@@ -295,9 +285,6 @@
                 onSelect={this.selectScript}
                 getPopupContainer={() => document.getElementById('verify-excelin-custom-scripts')}
               >
-                <Select.Option key="default" value={'default'}>
-                  榛樿sql
-                </Select.Option>
                 <Select.Option key="debugger" value={`z_debug: select @ErrorCode='E',@retmsg='娴嬭瘯鏂偣' goto aaa`}>
                   娴嬭瘯鏂偣
                 </Select.Option>
@@ -309,7 +296,7 @@
               </Select>
             </Form.Item>
           </Col>
-          <Col span={6} className="add">
+          <Col span={5} className="add" style={{whiteSpace: 'nowrap'}}>
             <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}>
               淇濆瓨
             </Button>
@@ -317,6 +304,10 @@
               鍙栨秷
             </Button>
           </Col>
+          <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}>
+            寮哄埗淇濆瓨锛�
+            <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/>
+          </Col>
           <Col span={24} className="sql">
             <Form.Item label="sql">
               {getFieldDecorator('sql', {

--
Gitblit v1.8.0