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/verifyexcelin/customscript/index.jsx |   67 +++++++++++++++++++++------------
 1 files changed, 42 insertions(+), 25 deletions(-)

diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
index c3e8a56..7a197af 100644
--- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
+++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/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, Modal, Tooltip, Radio, Select } from 'antd'
+import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 import moment from 'moment'
 
@@ -23,6 +23,7 @@
     editItem: null,
     usefulfields: null,
     loading: false,
+    skip: false,
     verifySql: ''
   }
 
@@ -81,7 +82,7 @@
 
   handleConfirm = () => {
     const { type } = this.props
-    const { editItem } = this.state
+    const { editItem, skip } = this.state
 
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     this.props.form.validateFieldsAndScroll((err, values) => {
@@ -226,26 +227,38 @@
         param.LText = Utils.formatOptions(param.LText)
         param.secretkey = Utils.encrypt('', param.timestamp)
         
-        this.setState({loading: true})
-        Api.genericInterface(param).then(res => {
-          if (res.status) {
-            this.setState({
-              loading: false,
-              editItem: null
-            }, () => {
-              this.props.scriptsChange(values)
-            })
-            this.props.form.setFieldsValue({
-              sql: ' '
-            })
-          } else {
-            this.setState({loading: false})
-
-            Modal.error({
-              title: res.message
-            })
-          }
-        })
+        if (skip) {
+          this.setState({
+            skip: false,
+            editItem: null
+          }, () => {
+            this.props.scriptsChange(values)
+          })
+          this.props.form.setFieldsValue({
+            sql: ' '
+          })
+        } else {
+          this.setState({loading: true})
+          Api.genericInterface(param).then(res => {
+            if (res.status) {
+              this.setState({
+                loading: false,
+                editItem: null
+              }, () => {
+                this.props.scriptsChange(values)
+              })
+              this.props.form.setFieldsValue({
+                sql: ' '
+              })
+            } else {
+              this.setState({loading: false})
+  
+              Modal.error({
+                title: res.message
+              })
+            }
+          })
+        }
       }
     })
   }
@@ -305,7 +318,7 @@
 
   render() {
     const { systemScripts, btn, type } = this.props
-    const { usefulfields, editItem } = this.state
+    const { usefulfields, editItem, skip } = this.state
     const { getFieldDecorator } = this.props.form
     const formItemLayout = {
       labelCol: {
@@ -356,7 +369,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {!type ? <Col span={10}>
+          {!type ? <Col span={8}>
             <Form.Item style={{marginBottom: 0}} label={'蹇嵎娣诲姞'}>
               <Select
                 showSearch
@@ -378,7 +391,7 @@
               </Select>
             </Form.Item>
           </Col> : null}
-          <Col span={6} className="add">
+          <Col span={5} className="add" style={{paddingTop: '2px', whiteSpace: 'nowrap'}}>
             <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}>
             {type === 'fullscreen' && !editItem ? '娣诲姞' : '淇濆瓨'}
             </Button>
@@ -386,6 +399,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