From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 十一月 2022 16:11:55 +0800
Subject: [PATCH] 2022-11-21

---
 src/menu/datasource/verifycard/index.jsx |  121 +++++++++++++++++++++++++---------------
 1 files changed, 76 insertions(+), 45 deletions(-)

diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index 66a6a93..59ae132 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -14,6 +14,7 @@
 import SettingForm from './settingform'
 import PasteForm from '@/templates/zshare/pasteform'
 import SettingUtils from './utils'
+import MKEmitter from '@/utils/events.js'
 import MinView from '@/assets/img/minview.png'
 import './index.scss'
 
@@ -354,6 +355,7 @@
     } else {
       values.uuid = Utils.getuuid()
       scripts.push(values)
+      MKEmitter.emit('editLineId', values.uuid)
     }
 
     this.setState({ scripts })
@@ -739,6 +741,7 @@
   }
 
   pasteSubmit = () => {
+    const { config } = this.props
     const { setting } = this.state
 
     this.pasteFormRef.handleConfirm().then(res => {
@@ -762,21 +765,35 @@
         res.data.setting.supModule = setting.supModule
       }
 
-      this.setState({
-        scripts: res.data.scripts.map(col => {
-          col.uuid = Utils.getuuid()
-          return col
-        }),
-        columns: res.data.columns.map(col => {
-          col.uuid = Utils.getuuid()
-          return col
-        }),
-        setting: res.data.setting,
-        reload: true,
-        pvisible: false
-      }, () => {
-        this.setState({reload: false})
-      })
+      if (config.subtype !== 'basetable') {
+        this.setState({
+          scripts: res.data.scripts.map(col => {
+            col.uuid = Utils.getuuid()
+            return col
+          }),
+          columns: res.data.columns.map(col => {
+            col.uuid = Utils.getuuid()
+            return col
+          }),
+          setting: res.data.setting,
+          reload: true,
+          pvisible: false
+        }, () => {
+          this.setState({reload: false})
+        })
+      } else {
+        this.setState({
+          scripts: res.data.scripts.map(col => {
+            col.uuid = Utils.getuuid()
+            return col
+          }),
+          setting: res.data.setting,
+          reload: true,
+          pvisible: false
+        }, () => {
+          this.setState({reload: false})
+        })
+      }
     })
   }
 
@@ -834,7 +851,7 @@
               wrappedComponentRef={(inst) => this.settingForm = inst}
             /> : null}
           </TabPane>
-          <TabPane tab={
+          {config.subtype !== 'basetable' ? <TabPane tab={
             <span>
               瀛楁闆�
               {columns.length ? <span className="count-tip">{columns.length}</span> : null}
@@ -848,7 +865,7 @@
               updatefield={this.updatefields}
             />
             <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/>
-          </TabPane>
+          </TabPane> : null}
           <TabPane tab={
             <span>
               鑷畾涔夎剼鏈�
@@ -895,36 +912,50 @@
               title = title && title[0] ? title[0] : ''
               let _text = title ? item.sql.replace(title, '') : item.sql
 
-              return (
-                <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}>
-                  <div style={{cursor: 'pointer'}} onClick={() => {
-                    this.setState({script: item, scriptValue: item.sql})
-                  }}>
-                    {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null}
-                    <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph>
-                    <div>{item.status === 'false' ?
-                      <span style={{color: '#ff4d4f', marginLeft: '20px'}}>
-                        绂佺敤
-                        <StopOutlined style={{marginLeft: '5px'}} />
-                      </span> : 
-                      <span style={{color: '#26C281', marginLeft: '20px'}}>
-                        鍚敤
-                        <CheckCircleOutlined style={{marginLeft: '5px'}}/>
-                      </span>}
+              if (item.status === 'false') {
+                return (
+                  <div className="script-item" key={item.uuid}>
+                    <div style={{cursor: 'not-allowed'}}>
+                      {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null}
+                      <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph>
+                      <div>
+                        <span style={{color: '#ff4d4f', marginLeft: '20px'}}>
+                          绂佺敤
+                          <StopOutlined style={{marginLeft: '5px'}} />
+                        </span>
+                      </div>
+                    </div>
+                    <div style={{height: '24px'}}></div>
+                  </div>
+                )
+              } else {
+                return (
+                  <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}>
+                    <div style={{cursor: 'pointer'}} onClick={() => {
+                      this.setState({script: item, scriptValue: item.sql})
+                    }}>
+                      {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null}
+                      <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph>
+                      <div>
+                        <span style={{color: '#26C281', marginLeft: '20px'}}>
+                          鍚敤
+                          <CheckCircleOutlined style={{marginLeft: '5px'}}/>
+                        </span>
+                      </div>
+                    </div>
+                    <div style={{textAlign: 'right'}}>
+                      <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span>
+                      <Popconfirm
+                        overlayClassName="popover-confirm"
+                        title="纭畾鍒犻櫎鍚�?"
+                        onConfirm={() => this.deleteScript(item)
+                      }>
+                        <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
+                      </Popconfirm>
                     </div>
                   </div>
-                  <div style={{textAlign: 'right'}}>
-                    <span className="operation-btn" onClick={() => this.handleStatus(item)} style={{color: '#8E44AD'}}><SwapOutlined /></span>
-                    <Popconfirm
-                      overlayClassName="popover-confirm"
-                      title="纭畾鍒犻櫎鍚�?"
-                      onConfirm={() => this.deleteScript(item)
-                    }>
-                      <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span>
-                    </Popconfirm>
-                  </div>
-                </div>
-              )
+                )
+              }
             })}
           </div>
           <div className="script-button">

--
Gitblit v1.8.0