From 8acfcd6e349ef2d1b797a7483940a2f3f2dfcfe6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 03 二月 2024 17:49:25 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/utils/utils-datamanage.js |   50 ++++++++++++++++++++++++++++++++++----------------
 1 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/src/utils/utils-datamanage.js b/src/utils/utils-datamanage.js
index 4544fe1..5b82a9a 100644
--- a/src/utils/utils-datamanage.js
+++ b/src/utils/utils-datamanage.js
@@ -69,6 +69,12 @@
         } else {
           param.$token = setting.exInterface || ''
         }
+      } else if (setting.sysInterface === 'custom') {
+        if (window.GLOB.systemType === 'production') {
+          param.rduri = setting.proInterface
+        } else {
+          param.rduri = setting.interface
+        }
       } else {
         if (window.GLOB.systemType === 'production' && setting.proInterface) {
           param.rduri = setting.proInterface
@@ -204,8 +210,14 @@
         } else {
           DateCount = `/*system_query*/select count(1) as total from ${_dataresource} ${_search}`
         }
+      } else if (setting.$top) {
+        if (orderBy) {
+          LText = `/*system_query*/select top 1 ${arr_field} from ${_dataresource} ${_search} order by ${orderBy} `
+        } else {
+          LText = `/*system_query*/select top 1 ${arr_field} from ${_dataresource} ${_search}  `
+        }
       } else if (orderBy) {
-        LText = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows `
+        LText = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search} order by ${orderBy} `
       } else {
         LText = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search}  `
       }
@@ -272,9 +284,9 @@
       param.menuname = setting.$name
     }
 
-    param.custom_script = Utils.formatOptions(_customScript)
-    param.LText = Utils.formatOptions(LText)
-    param.DateCount = Utils.formatOptions(DateCount)
+    param.custom_script = Utils.formatOptions(_customScript, param.exec_type)
+    param.LText = Utils.formatOptions(LText, param.exec_type)
+    param.DateCount = Utils.formatOptions(DateCount, param.exec_type)
 
     if (setting.sub_field) {
       param.sub_name = setting.subdata
@@ -302,6 +314,8 @@
       if (setting.tableName === 's_custom_script' && window.GLOB.mainSystemApi) {
         param.rduri = window.GLOB.mainSystemApi
       }
+    } else if (window.GLOB.forcedUpdate) {
+      param.s_version_up = 'true'
     }
 
     return param
@@ -458,8 +472,14 @@
     _search = _search ? 'where ' + _search : ''
   }
 
-  if (setting.order && _dataresource) {
-    _dataresource = `select top 1000 ${setting.arr_field} from (select ${setting.arr_field} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows `
+  if (setting.$top) {
+    if (setting.order && _dataresource) {
+      _dataresource = `select top 1 ${setting.arr_field} from ${_dataresource} ${_search} order by ${setting.order} `
+    } else if (_dataresource) {
+      _dataresource = `select top 1 ${setting.arr_field} from ${_dataresource} ${_search} `
+    }
+  } else if (setting.order && _dataresource) {
+    _dataresource = `select top 1000 ${setting.arr_field} from ${_dataresource} ${_search} order by ${setting.order} `
   } else if (_dataresource) {
     _dataresource = `select top 1000 ${setting.arr_field} from ${_dataresource} ${_search} `
   }
@@ -500,7 +520,6 @@
 
 /**
  * @description 鐢熸垚sPC_Get_structured_data璇锋眰鍙傛暟
- * 1銆佹妸澶ф帴鍙PC_Get_structured_data鐨刲text鎷嗘垚涓変唤锛岀涓�娈碉細@LText1锛岀浜屾@LText锛岀涓夋@LText2
  */
 export function getStructuredParams (params, config, BID) {
   let LText_field = []
@@ -548,8 +567,6 @@
 
   let param = {
     func: 'sPC_Get_structured_data',
-    LText: _LText.join(' union all '),
-    LText_field: LText_field.join(' union all '),
     BID: BID,
     username: sessionStorage.getItem('User_Name') || '',
     fullName: sessionStorage.getItem('Full_Name') || ''
@@ -559,12 +576,13 @@
     param.menuname = config.MenuName
   }
 
-  let { LText, LText1, LText2 } = Utils.sPCInUpDeFormatOptions(param.LText)
-
-  param.LText1 = LText1
-  param.LText = LText
-  param.LText2 = LText2
-  param.LText_field = Utils.formatOptions(param.LText_field)
+  param.exec_type = 'y'
+  param.LText = Utils.formatOptions(_LText.join(' union all '))
+  param.custom_script = Utils.formatOptions(LText_field.join(' union all '))
+  // param.LText1 = LText1
+  // param.LText = LText
+  // param.LText2 = LText2
+  // param.LText_field = Utils.formatOptions(param.LText_field)
 
   if (config.cacheUseful === 'true') {
     param.time_type = config.timeUnit
@@ -576,7 +594,7 @@
   }
 
   param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
-  param.secretkey = Utils.encrypt(param.LText, param.timestamp)
+  param.secretkey = Utils.encrypt('', param.timestamp)
 
   return param
 }
\ No newline at end of file

--
Gitblit v1.8.0