From cf2389121671bc8d09f32175acae80b074e21fc3 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 10 十月 2024 01:23:08 +0800
Subject: [PATCH] 一些更改

---
 src/api/tigerapi/system.ts |   42 ++++++++++++++++++++++--------------------
 1 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/src/api/tigerapi/system.ts b/src/api/tigerapi/system.ts
index d3ad65c..dae8570 100644
--- a/src/api/tigerapi/system.ts
+++ b/src/api/tigerapi/system.ts
@@ -31,8 +31,9 @@
   pParams,
 } from './model/systemModel';
 import { defHttp } from '/@/utils/http/axios';
-import { isArray, isNullOrEmpty, isTimeViaRegExp8601 } from '/@/utils/is';
+import { isArray, isNullOrEmpty, isNullOrUnDef, isTimeViaRegExp8601 } from '/@/utils/is';
 import { isNumber } from 'xe-utils';
+import { dateUtil, formatToDateTime } from '/@/utils/dateUtil';
 
 export enum Api {
   QueryUrl = '/Base/Query',
@@ -288,7 +289,7 @@
  * @param {T} data
  * @param {string} parentField 鐖跺瓧娈靛悕
  * @param {string} idField 鍞竴key瀛楁鍚�
- * @param {string} pid_val 鐖秈d鍊�
+ * @param {string} pid 鐖秈d鍊�
  * @return {*}
  */
 export function convertToTree<T>(data: T[], parentField: string, idField: string, pid?: string) {
@@ -714,24 +715,26 @@
   }
   const rParams = genAction(
     params['TABLE_NAME'],
-    {
-      QueryAble_T: '',
-      where: sqlcmd,
-      order: order,
-      page: {
-        pageAble_T: 'string',
-        draw: 1,
-        pageIndex: params['page'],
-        pageSize: params['pageSize'],
-      },
-    },
+    !isNullOrEmpty(params['apiUrl'])
+      ? params
+      : {
+          QueryAble_T: '',
+          where: sqlcmd,
+          order: order,
+          page: {
+            pageAble_T: 'string',
+            draw: 1,
+            pageIndex: params['page'],
+            pageSize: params['pageSize'],
+          },
+        },
     params['option'],
   );
-  return getListByPageAsync(rParams);
+  return getListByPageAsync(rParams, params['apiUrl']); //濡傛灉涓嶆兂鐢ㄩ粯璁ょ殑鍩虹鏂规硶鑾峰彇鍒嗛〉鏁版嵁锛屽彲浠ユ崲鍏朵粬鐨刟pi
 }
-async function getListByPageAsync(params: any) {
+async function getListByPageAsync(params: any, apiUrl: string | null | undefined) {
   const data = await defHttp.post(
-    { url: Api.QueryUrl, params, timeout: 50000 },
+    { url: !isNullOrEmpty(apiUrl) ? apiUrl : Api.QueryUrl, params, timeout: 50000 },
     {
       isTransformResponse: false,
     },
@@ -762,6 +765,7 @@
       Keys[k] != 'field' &&
       Keys[k] != 'option' &&
       Keys[k] != '0' &&
+      Keys[k] != 'apiUrl' &&
       !Keys[k].toString().endsWith('PSelect_0')
     ) {
       if (!isNullOrEmpty(params[Keys[k]].length) && isTimeViaRegExp8601(params[Keys[k]][0])) {
@@ -769,6 +773,8 @@
         sqlcmd += ` And ${Keys[k]} < '${params[Keys[k]][1]}'`;
       } else if (isNumber(params[Keys[k]])) {
         sqlcmd += `And ${Keys[k]} = ${params[Keys[k]]}`;
+      } else if (Keys[k] == 'sqlcmd') {
+        sqlcmd += ` And ${params[Keys[k]]}`;
       } else {
         sqlcmd += `And ${Keys[k]} like '%${params[Keys[k]]}%'`;
       }
@@ -779,10 +785,6 @@
 
 export async function SaveEntity<T>(params: T, isUpdate: boolean, entityName: string, ...args) {
   let data;
-  /* 閽堝妯℃澘鍦板潃鍋氭浛鎹紝鐗规畩澶勭悊 */
-  if(params['TEMP_PATH']){
-    params['TEMP_PATH'] = params['TEMP_PATH'].toString().replace('/','//');
-  }
   if (isUpdate) {
     data = await defHttp.post(
       { url: Api.UpdateEntity, params: genAction(entityName, params) },

--
Gitblit v1.9.3