From f308a19516f0f15c0aca1af87c1aa722af0fee5c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 12 四月 2024 17:48:52 +0800
Subject: [PATCH] 2024-04-12

---
 src/menu/datasource/verifycard/index.jsx |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index ceabb28..a8300a1 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -48,6 +48,7 @@
     systemScripts: [],
     median: {},
     visible: false,
+    editLineId: '',
     pvisible: false,
     reload: false,
     script: null,
@@ -809,7 +810,9 @@
       return
     }
 
+    let editLineId = ''
     if (script) {
+      editLineId = script.uuid
       _scripts = _scripts.map(item => {
         if (script.uuid === item.uuid) {
           item.sql = scriptValue
@@ -824,10 +827,11 @@
         status: 'true'
       }
 
+      editLineId = _script.uuid
       _scripts.push(_script)
     }
 
-    this.setState({loading: true})
+    this.setState({loading: true, editLineId})
 
     this.sqlverify(() => {this.setState({scripts: _scripts, script: null, scriptValue: '', loading: false})}, () => {this.setState({loading: false})}, 'script', _scripts)
   }
@@ -1106,7 +1110,7 @@
 
   render() {
     const { config } = this.props
-    const { columns, subColumns, median, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue, searchKey } = this.state
+    const { columns, subColumns, median, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue, searchKey, editLineId } = this.state
 
     return (
       <div className="model-data-source-wrap">
@@ -1186,7 +1190,7 @@
                 })
                 return
               }
-              this.setState({visible: true, script: null, scriptValue: ''})
+              this.setState({visible: true, script: null, scriptValue: '', editLineId: ''})
             }}/> : null}
             <CustomScriptsForm
               type={config.type}
@@ -1236,8 +1240,14 @@
                   </div>
                 )
               } else {
+                let sign = ''
+                if (script && script.uuid === item.uuid) {
+                  sign = 'active'
+                } else if (editLineId === item.uuid) {
+                  sign = 'edited'
+                }
                 return (
-                  <div className={'script-item ' + (script && script.uuid === item.uuid ? 'active' : '') } key={item.uuid}>
+                  <div className={'script-item ' + sign} key={item.uuid}>
                     <div style={{cursor: 'pointer'}} onClick={() => {
                       this.setState({script: item, scriptValue: item.sql})
                     }}>

--
Gitblit v1.8.0