From ac1d52c46ff9019fcc93cf3d5e7ab17cf850824e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 10 八月 2023 16:05:24 +0800
Subject: [PATCH] 2023-08-10

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

diff --git a/src/utils/utils.js b/src/utils/utils.js
index 967ae7e..bd64787 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -335,6 +335,8 @@
           item.initval = [moment().startOf('week').format(format), moment().endOf('week').format(format)].join(',')
         } else if (item.initval === 'month') {
           item.initval = [moment().startOf('month').format(format), moment().endOf('month').format(format)].join(',')
+        } else if (item.initval === 'lastMonth') {
+          item.initval = [moment().subtract(1, 'months').startOf('month').format(format), moment().subtract(1, 'months').endOf('month').format(format)].join(',')
         } else if (item.initval) {
           try {
             let _initval = JSON.parse(item.initval)
@@ -896,11 +898,6 @@
   let address = sessionStorage.getItem('address') || ''
   let _sheet = item.sheet
 
-  if (sessionStorage.getItem('isEditState') === 'true') {
-    userName = sessionStorage.getItem('CloudUserName') || ''
-    fullName = sessionStorage.getItem('CloudFullName') || ''
-  }
-
   if (window.GLOB.externalDatabase !== null) {
     _sheet = _sheet.replace(/@db@/ig, window.GLOB.externalDatabase)
   }
@@ -986,7 +983,7 @@
           val = val.replace(/'/ig, '"')
         }
 
-        val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
+        val = val.replace(/(^\s+$)|\t+|\v+/ig, '')
 
         if (!val && col.required === 'true') {            // 蹇呭~鏍¢獙
           errors.push(_position + '鍐呭涓嶅彲涓虹┖')
@@ -1021,7 +1018,7 @@
             val = moment('19000101', 'YYYYMMDD').add(Math.floor(val - 2), 'days').format('YYYY-MM-DD')
           }
         } else if (typeof(val) === 'string') {
-          val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
+          val = val.replace(/(^\s+$)|\t+|\v+/ig, '')
           if (!val && col.required === 'true') {           // 鏃堕棿蹇呭~鏍¢獙
             errors.push(_position + '鍐呭涓嶅彲涓虹┖')
           } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 鏃堕棿姝e垯鏍¢獙
@@ -1205,11 +1202,6 @@
 
   let _sheet = btn.sheet
   let BID = data[0].$$BID || ''
-
-  if (sessionStorage.getItem('isEditState') === 'true') {
-    userName = sessionStorage.getItem('CloudUserName') || ''
-    fullName = sessionStorage.getItem('CloudFullName') || ''
-  }
 
   if (window.GLOB.externalDatabase !== null) {
     _sheet = _sheet.replace(/@db@/ig, window.GLOB.externalDatabase)
@@ -1597,11 +1589,6 @@
   let city = sessionStorage.getItem('city') || ''
   let district = sessionStorage.getItem('district') || ''
   let address = sessionStorage.getItem('address') || ''
-
-  if (sessionStorage.getItem('isEditState') === 'true') {
-    userName = sessionStorage.getItem('CloudUserName') || ''
-    fullName = sessionStorage.getItem('CloudFullName') || ''
-  }
 
   // 鍒濆鍖栧嚟璇佸強鐢ㄦ埛淇℃伅瀛楁
   _sql += `

--
Gitblit v1.8.0