From c4564064afe704f73acab29dded85e8c85dcc182 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 26 三月 2024 14:28:23 +0800
Subject: [PATCH] 2024-03-26

---
 src/utils/utils.js |   49 +++++++++++++++++++++++++++++++------------------
 1 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index e6eb0cf..8e92379 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -204,6 +204,13 @@
       values = window.GLOB.SearchBox.get(config.$searchId + 'cache')
     }
 
+    let supModule = ''
+    if (config.setting && config.setting.supModule) {
+      supModule = config.setting.supModule
+    } else if (config.wrap && config.wrap.supModule) {
+      supModule = config.wrap.supModule
+    }
+
     config.search = config.search.map(item => {
       item.hidden = item.Hide === 'true'
       item.required = !item.hidden && item.required === 'true'
@@ -234,12 +241,14 @@
           } else {
             item.$initval = item.initval
             item.$supId = config.$pageId
-            if (config.setting && config.setting.supModule) {
-              item.$supId = config.setting.supModule
+            if (supModule) {
+              item.$supId = supModule
 
               config.checkBid = true
-              config.setting.checkBid = true
               item.checkShift = true
+              if (config.setting) {
+                config.setting.checkBid = true
+              }
             }
 
             item.initval = ''
@@ -296,12 +305,14 @@
           } else {
             item.$initval = item.initval
             item.$supId = config.$pageId
-            if (config.setting && config.setting.supModule) {
-              item.$supId = config.setting.supModule
+            if (supModule) {
+              item.$supId = supModule
 
               config.checkBid = true
-              config.setting.checkBid = true
               item.checkShift = true
+              if (config.setting) {
+                config.setting.checkBid = true
+              }
             }
 
             item.initval = ''
@@ -393,10 +404,12 @@
           item.initType = ''
         }
       } else if ((item.type === 'select' || item.type === 'link') && item.resourceType === '1') {
-        if (/@BID@/ig.test(item.dataSource) && config.setting && config.setting.supModule) {
+        if (/@BID@/ig.test(item.dataSource) && supModule) {
           config.checkBid = true
-          config.setting.checkBid = true
           item.checkBid = true
+          if (config.setting) {
+            config.setting.checkBid = true
+          }
         }
         if (item.initval === '$first') {
           item.initval = ''
@@ -726,9 +739,9 @@
       if (item.type === 'date') {
         if (!item.value) {
           if (['>=', '>'].includes(item.match)) {
-            item.value = '1970-01-01 00:00:00.000'
+            item.value = '1900-01-01 00:00:00.000'
           } else if (['<=', '<'].includes(item.match)) {
-            item.value = '2050-01-01 00:00:00.000'
+            item.value = '3000-01-01 00:00:00.000'
           }
         } else if (search.precision === 'day') {
           if (['>=', '>'].includes(item.match)) {
@@ -749,8 +762,8 @@
         if (item.match === '=') {
           options.push(item)
         } else {
-          let _startval = item.value ? moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000'
-          let _endval = item.value ? moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000'
+          let _startval = item.value ? moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' : '1900-01-01 00:00:00.000'
+          let _endval = item.value ? moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '3000-01-01 00:00:00.000'
   
           let copy = JSON.parse(JSON.stringify(item))
           copy.key = copy.key + '1'
@@ -773,8 +786,8 @@
         options.push(item)
         options.push(copy)
       } else if (item.type === 'dateweek') {
-        let _startval = item.value ? moment(item.value, 'YYYY-MM-DD').startOf('week').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000'
-        let _endval = item.value ? moment(item.value, 'YYYY-MM-DD').endOf('week').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000'
+        let _startval = item.value ? moment(item.value, 'YYYY-MM-DD').startOf('week').format('YYYY-MM-DD') + ' 00:00:00.000' : '1900-01-01 00:00:00.000'
+        let _endval = item.value ? moment(item.value, 'YYYY-MM-DD').endOf('week').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '3000-01-01 00:00:00.000'
 
         let copy = JSON.parse(JSON.stringify(item))
         copy.key = copy.key + '1'
@@ -785,8 +798,8 @@
         options.push(item)
         options.push(copy)
       } else if (item.type === 'daterange') {
-        let _startval = '1970-01-01 00:00:00.000'
-        let _endval = '2050-01-01 00:00:00.000'
+        let _startval = '1900-01-01 00:00:00.000'
+        let _endval = '3000-01-01 00:00:00.000'
 
         if (item.value) {
           let val = item.value.split(',')
@@ -1156,7 +1169,7 @@
       end
       
       ${unique.verifyType.indexOf('temp') === -1 ? `Set @tbid=''
-      Select top 1 @tbid=${_afields.join('+\' \'+')} from  #${sheet} a Inner join ${sheet} b on ${_fields_}
+      Select top 1 @tbid=${_afields.join('+\' \'+')} from  #${sheet} a Inner join ${database}${sheet} b on ${_fields_}
       
       If @tbid!=''
       Begin
@@ -1376,7 +1389,7 @@
       end
       
       ${unique.verifyType.indexOf('temp') === -1 ? `Set @tbid=''
-      Select top 1 @tbid=${_afields.join('+\' \'+')} from  #${sheet} a Inner join ${sheet} b on ${_fields_}
+      Select top 1 @tbid=${_afields.join('+\' \'+')} from  #${sheet} a Inner join ${database}${sheet} b on ${_fields_}
       
       If @tbid!=''
       Begin

--
Gitblit v1.8.0