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/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx |   69 +++++++++++++++++++++-------------
 1 files changed, 43 insertions(+), 26 deletions(-)

diff --git a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
index a4a7025..f4accd7 100644
--- a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
+++ b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
@@ -1,6 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-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'
 
@@ -22,6 +22,7 @@
     editItem: null,
     usefulfields: null,
     loading: false,
+    skip: false,
     verifySql: ''
   }
 
@@ -67,7 +68,7 @@
 
   handleConfirm = () => {
     const { type } = this.props
-    const { editItem } = this.state
+    const { editItem, skip } = this.state
     // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
     this.props.form.validateFieldsAndScroll((err, values) => {
       if (type === 'fullscreen' && err) {
@@ -208,27 +209,39 @@
 
         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({
+            editItem: null,
+            skip: false
+          }, () => {
+            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
+              })
+            }
+          })
+        }
       }
     })
   }
@@ -287,7 +300,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: {
@@ -338,7 +351,7 @@
               )}
             </Form.Item>
           </Col> : null}
-          {!type ? <Col span={10}>
+          {!type ? <Col span={8}>
             <Form.Item style={{marginBottom: 0}} label={'蹇嵎娣诲姞'}>
               <Select
                 showSearch
@@ -360,14 +373,18 @@
               </Select>
             </Form.Item>
           </Col> : null}
-          <Col span={6} className="add">
-            <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}>
+          <Col span={5} style={{paddingTop: '3px', whiteSpace: 'nowrap'}}>
+            <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 15}}>
               {type === 'fullscreen' && !editItem ? '娣诲姞' : '淇濆瓨'}
             </Button>
             <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}>
               鍙栨秷
             </Button>
           </Col>
+          <Col span={3} style={{paddingTop: '12px', 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