From 3f0f0b7e222cf0c159b6f646af7084ed4c29e409 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 26 八月 2023 10:46:52 +0800
Subject: [PATCH] 2023-08-26

---
 src/utils/utils.js |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index 35d083e..7f89611 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1,6 +1,5 @@
 import moment from 'moment'
 import md5 from 'md5'
-import options from '@/store/options.js'
 
 const formatKeys = [
   { key: 'select', value: ' msltk ' },
@@ -798,8 +797,8 @@
     
     let baseurl = ''
     
-    if (options.cloudServiceApi) {
-      baseurl = options.cloudServiceApi.replace(/webapi(.*)$/, '')
+    if (window.GLOB.cloudServiceApi) {
+      baseurl = window.GLOB.cloudServiceApi.replace(/webapi(.*)$/, '')
     } else {
       baseurl = window.GLOB.baseurl
     }
@@ -968,7 +967,15 @@
       let _colindex = cols[cindex] || (cindex + 1)
       let _position = (_topline + lindex + 1) + '琛� ' + _colindex + '鍒� '
 
-      if (/^Nvarchar/ig.test(col.type)) {
+      if (col.import === 'init') {
+        if (/^Nvarchar/ig.test(col.type)) {
+          val = ''
+        } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) {
+          val = 0
+        } else if (col.type === 'date') {
+          val = '1949-10-01'
+        }
+      } else if (/^Nvarchar/ig.test(col.type)) {
         val = val + ''
 
         if (/'/.test(val)) {
@@ -1161,7 +1168,7 @@
       _sqlBottom = _sqlBottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
     }
 
-    if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       let fsql = `
       ${_sql}
       ${_sqlInsert}
@@ -1396,7 +1403,7 @@
       _sqlBottom = _sqlBottom.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'')
     }
 
-    if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
+    if (window.GLOB.debugger === true) {
       let fsql = `
       ${_sql}
       ${_sqlInsert}
@@ -2187,7 +2194,7 @@
     _sql = _sql.replace(/@datam@/ig, '\'\'')
   }
 
-  if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) {
+  if (window.GLOB.debugger === true) {
     // _sql = _sql.replace(/\n\s{8}/ig, '\n')
     console.info(_sql)
   }

--
Gitblit v1.8.0