From f74d06cff0e27653c2c5ff33cf3824fa3cfb4464 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 17 三月 2023 15:21:47 +0800
Subject: [PATCH] 2023-03-17

---
 src/utils/utils.js |   71 +++++++++++++++++------------------
 1 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index 09aede5..553ca2f 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -856,10 +856,9 @@
  * @description 鑾峰彇excel瀵煎叆鍙傛暟
  * @return {Object} item   鎸夐挳淇℃伅
  * @return {Array}  data   excel鏁版嵁
- * @return {Object} dict   瀛楀吀椤�
  * @return {String} BID    涓婄骇Id
  */
-export function getExcelInSql (item, data, dict, BID, primaryId) {
+export function getExcelInSql (item, data, BID, primaryId) {
   let btn = item.verify
   let keys = ['delete', 'drop', 'insert', 'truncate', 'update']
   let userName = sessionStorage.getItem('User_Name') || ''
@@ -956,7 +955,7 @@
 
       let val = item[col.Column] !== undefined ? item[col.Column] : ''
       let _colindex = cols[cindex] || (cindex + 1)
-      let _position = (_topline + lindex + 1) + dict['main.excel.line'] + ' ' + _colindex + dict['main.excel.column']  + ' '
+      let _position = (_topline + lindex + 1) + '琛� ' + _colindex + '鍒� '
 
       if (/^Nvarchar/ig.test(col.type)) {
         if (typeof(val) === 'number') {
@@ -966,54 +965,54 @@
         val = val.replace(/(^\s*$)|\t*|\v*|'*/ig, '')
 
         if (!val && col.required === 'true') {            // 蹇呭~鏍¢獙
-          errors.push(_position + dict['main.excel.content.emptyerror'])
+          errors.push(_position + '鍐呭涓嶅彲涓虹┖')
         } else if (col.limit && val.length > col.limit) { // 闀垮害鏍¢獙
-          errors.push(_position + dict['main.excel.content.maxlimit'])
+          errors.push(_position + '鍐呭瓒呴暱')
         } else {                                          // 鍏抽敭瀛楁牎楠�
           keys.forEach(key => {
             let _patten = new RegExp('(^' + key + '\\s+)|(\\s+' + key + '\\s+)', 'ig')
             if (_patten.test(val)) {
-              errors.push(_position + dict['main.excel.includekey'] + key)
+              errors.push(_position + '鍚湁鍏抽敭瀛�' + key)
             }
           })
         }
       } else if (/^int/ig.test(col.type)) {
         if (!val && val !== 0) {
-          errors.push(_position + dict['main.excel.content.emptyerror'])
+          errors.push(_position + '鍐呭涓嶅彲涓虹┖')
         } else {
           let _val = val + ''
 
           if (!/^(([^0][0-9]+|0)$)|^(([1-9]+)$)/.test(_val)) {               // 妫�楠屾槸鍚︿负鏁存暟
-            errors.push(_position + dict['main.excel.content.interror'])
+            errors.push(_position + '鍐呭搴斾负鏁存暟')
           } else if ((col.min || col.min === 0) && val < col.min) {          // 鏈�灏忓�兼楠�
-            errors.push(_position + dict['main.excel.content.limitmin'])
+            errors.push(_position + '灏忎簬鏈�灏忓��')
           } else if ((col.max || col.max === 0) && val > col.max) {          // 鏈�澶у�兼楠�
-            errors.push(_position + dict['main.excel.content.limitmax'])
+            errors.push(_position + '澶т簬鏈�澶у��')
           }
         }
       } else if (/^Decimal/ig.test(col.type)) {
         if (!val && val !== 0) {
-          errors.push(_position + dict['main.excel.content.emptyerror'])
+          errors.push(_position + '鍐呭涓嶅彲涓虹┖')
         } else {
           let _val = val + ''
           let _vals = _val.split('.')
 
           if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(_val)) {                           // 妫�楠屾槸鍚︿负娴偣鏁�
-            errors.push(_position + dict['main.excel.content.floaterror'])
+            errors.push(_position + '鍐呭搴斾负娴偣鏁�')
           } else if (_vals[0].length > 18) {                          // 妫�楠屾暣鏁颁綅
-            errors.push(_position + dict['main.excel.content.floatIntover'])
+            errors.push(_position + '鏁存暟浣嶈秴鍑鸿寖鍥�')
           } else if (_vals[1] && _vals[1].length > col.limit) {       // 鏈�灏忓�兼楠�
-            errors.push(_position + dict['main.excel.content.floatPointover'])
+            errors.push(_position + '灏忔暟浣嶈秴鍑鸿寖鍥�')
           } else if ((col.min || col.min === 0) && val < col.min) {   // 鏈�灏忓�兼楠�
-            errors.push(_position + dict['main.excel.content.limitmin'])
+            errors.push(_position + '灏忎簬鏈�灏忓��')
           } else if ((col.max || col.max === 0) && val > col.max) {   // 鏈�澶у�兼楠�
-            errors.push(_position + dict['main.excel.content.limitmax'])
+            errors.push(_position + '澶т簬鏈�澶у��')
           }
         }
       } else if (col.type === 'date') {
         if (typeof(val) === 'number') {
           if (val > 2958465 || val <= 0) {                 // 鏃堕棿杩囧ぇ鎴栧皬浜庣瓑浜�0
-            errors.push(_position + dict['main.excel.content.date.over'])
+            errors.push(_position + '鏃堕棿涓鸿礋鍊兼垨澶ぇ')
           } else {                                         // 鏃堕棿鏍煎紡鍖�
             if (val < 60) {                                // 1900-2-29锛宔xcel涓瓨鍦紝瀹為檯涓嶅瓨鍦�
               val++
@@ -1023,12 +1022,12 @@
         } else if (typeof(val) === 'string') {
           val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
           if (!val && col.required === 'true') {           // 鏃堕棿蹇呭~鏍¢獙
-            errors.push(_position + dict['main.excel.content.emptyerror'])
+            errors.push(_position + '鍐呭涓嶅彲涓虹┖')
           } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 鏃堕棿姝e垯鏍¢獙
-            errors.push(_position + dict['main.excel.content.date.formatError'])
+            errors.push(_position + '鏃堕棿鏍煎紡閿欒')
           }
         } else {                                           // 鏃堕棿鏍煎紡閿欒
-          errors.push(_position + dict['main.excel.content.date.formatError'])
+          errors.push(_position + '鏃堕棿鏍煎紡閿欒')
         }
       }
 
@@ -2254,24 +2253,24 @@
  */
 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))
-          })
-        }
-      })
-    })
-  } else {
+  // 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))
+  //         })
+  //       }
+  //     })
+  //   })
+  // } else {
     let objectStore = window.GLOB.IndexDB.transaction('funcs').objectStore('funcs')
 
     objectStore.openCursor().onsuccess = (event) => {
@@ -2285,7 +2284,7 @@
         cursor.continue()
       }
     }
-  }
+  // }
 }
 
 /**

--
Gitblit v1.8.0