From 25f128f26f0330b5431e5513c16ea035ce46099a Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期日, 21 七月 2024 21:00:41 +0800
Subject: [PATCH] 工单更新

---
 src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts |   66 +++++++++++++++++++++-----------
 1 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
index d158aea..0e64210 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
@@ -4,34 +4,17 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-24 15:50:49
+ * @LastEditTime: 2024-07-04 09:26:04
  */
 
 import { ActionItem, BasicColumn } from '/@/components/Table';
 import { buildUUID } from '/@/utils/uuid';
 import { useI18n } from '/@/hooks/web/useI18n';
+import { isNullOrUnDef } from '/@/utils/is';
 
 const { t } = useI18n();
 
 function _default() {
-  /**
-   * @description: 鑷畾涔夌紪杈戞柟娉曪紝璺宠浆鍒伴珮绾ч〉闈�
-   * @param {Fn} args
-   * @param {*} params
-   * @return {*}
-   */
-  function rsnGrpEdit(args: Fn[], params: {}) {
-    const param = {
-      CODE: params['record']['RSNG_CODE'],
-      ID: params['record']['ID'],
-      Name: 'BAS_REASON',
-      Title: `缂栬緫涓嶈壇鍘熷洜缁勶細${params['record']['RSNG_CODE']}`,
-      pCode: 'RSNG_CODE',
-      IsID: false,
-    };
-    args[5](`/BAS_REASON/High/${encodeURI(JSON.stringify(param))}`);
-  }
-
   const ActionColumn: BasicColumn = {
     width: 180,
     title: '鎿嶄綔',
@@ -40,6 +23,10 @@
     fixed: undefined,
   };
 
+  /**
+   * @description: 涓�浜涜嚜瀹氫箟鏂规硶
+   * @return {*}
+   */
   const methods = {
     /**
      * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
@@ -56,6 +43,7 @@
           Title: '鏂板涓嶈壇鍘熷洜缁�',
           pCode: 'RSNG_CODE',
           IsID: false,
+          drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE', type: 'one', keyName: 'BAS_REASON' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
         },
       };
     },
@@ -64,7 +52,9 @@
      * @return {*}
      */
     ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
-      data[0].onClick = rsnGrpEdit.bind(null, args, params); //鏇挎崲涓婚〉闈㈢紪杈戞寜閽柟娉曞彉涓鸿烦杞埌楂樼骇椤甸潰
+      if (!isNullOrUnDef(data[0])) {
+        data[0].onClick = rsnGrpEdit.bind(null, args, params); //鏇挎崲涓婚〉闈㈢紪杈戞寜閽柟娉曞彉涓鸿烦杞埌楂樼骇椤甸潰
+      }
       return data;
     },
     GetSelectSuccess: (d, u) => {
@@ -72,7 +62,7 @@
         RSNG_CODE: d.values['val'],
       };
     },
-    OpenSelectItem:(openItemModal: Fn) => {
+    OpenSelectItem: (openItemModal: Fn, ...args) => {
       openItemModal(true, {
         title: '涓嶈壇鍘熷洜缁勫垪琛�',
         schemas: [
@@ -103,11 +93,41 @@
         ],
         tableName: 'BAS_REASON_GRP',
         rowKey: 'RSNG_CODE',
-        searchInfo: {TABLE_NAME: 'BAS_REASON_GRP'}
+        searchInfo: { TABLE_NAME: 'BAS_REASON_GRP' },
       });
-    }
+    },
+    GetUseForm: () => {
+      return {};
+    },
   };
 
+  /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */
+
+  /**
+   * @description: 鑷畾涔夌紪杈戞柟娉曪紝璺宠浆鍒伴珮绾ч〉闈�
+   * @param {Fn} args
+   * @param {*} params
+   * @return {*}
+   */
+  function rsnGrpEdit(args: Fn[], params: {}) {
+    const param = {
+      CODE: params['record']['RSNG_CODE'],
+      ID: params['record']['ID'],
+      Name: 'BAS_REASON',
+      SessionName: 'BAS_REASON_update',
+      Title: `缂栬緫涓嶈壇鍘熷洜缁勶細${params['record']['RSNG_CODE']}`,
+      pCode: 'RSNG_CODE',
+      IsID: false,
+      drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE', type: 'one', keyName: 'BAS_REASON' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
+    };
+    // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage
+    sessionStorage.removeItem(`${param.SessionName}_params`);
+    sessionStorage.setItem(`${param.SessionName}_params`, encodeURI(JSON.stringify(param)));
+    args[5](
+      `/BAS_REASON/High/${encodeURI(JSON.stringify({ sName: param.SessionName, Name: param.Name }))}`,
+    );
+  }
+
   return [methods, ActionColumn];
 }
 

--
Gitblit v1.9.3