From ffd044cf75ae896187b938e91dbd8fb83abd3615 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 28 三月 2023 20:58:11 +0800
Subject: [PATCH] 2023-03-28

---
 src/utils/utils.js |   39 ++++++++++++---------------------------
 1 files changed, 12 insertions(+), 27 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index 4431f93..3350032 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1707,7 +1707,7 @@
       /* 澶辨晥楠岃瘉 */
       select @tbid='', @ErrorCode='',@retmsg=''
       select @tbid='X' from ${datasource} right join (select ID from  dbo.SplitComma(@ID@)) sp
-      on tb.id =sp.id where tb.id is null
+      on tb.${primaryKey} =sp.id where tb.${primaryKey} is null
 
       If @tbid!=''
       Begin
@@ -2253,36 +2253,21 @@
  */
 export function setGLOBFuncs () {
   window.GLOB.funcs = []
-  if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
+  if (!window.GLOB.IndexDB) {
     return
   }
 
-  if (window.GLOB.WebSql) {
-    window.GLOB.WebSql.transaction(tx => {
-      tx.executeSql("SELECT * FROM FUNCS", [], (tx, results) => {
-        let rows = results.rows
-        if (!rows || rows.length === 0) return
-        for (let i = 0; i < rows.length; i++) {
-          window.GLOB.funcs.push({
-            func_code: rows[i].func_code,
-            key_sql: window.decodeURIComponent(window.atob(rows[i].key_sql))
-          })
-        }
+  let objectStore = window.GLOB.IndexDB.transaction('funcs').objectStore('funcs')
+
+  objectStore.openCursor().onsuccess = (event) => {
+    let cursor = event.target.result
+
+    if (cursor) {
+      window.GLOB.funcs.push({
+        func_code: cursor.value.func_code,
+        key_sql: window.decodeURIComponent(window.atob(cursor.value.key_sql))
       })
-    })
-  } else {
-    let objectStore = window.GLOB.IndexDB.transaction('funcs').objectStore('funcs')
-
-    objectStore.openCursor().onsuccess = (event) => {
-      let cursor = event.target.result
-
-      if (cursor) {
-        window.GLOB.funcs.push({
-          func_code: cursor.value.func_code,
-          key_sql: window.decodeURIComponent(window.atob(cursor.value.key_sql))
-        })
-        cursor.continue()
-      }
+      cursor.continue()
     }
   }
 }

--
Gitblit v1.8.0