From d582f081e148c5df7c1b334a94fa1df1cd2655a9 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 04 七月 2024 22:40:20 +0800
Subject: [PATCH] 班制更新

---
 src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts |  142 ++++++++++++++++++++++++++++++++--------------
 1 files changed, 98 insertions(+), 44 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 e5d89da..73a552a 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
@@ -4,13 +4,102 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-22 22:39:11
+ * @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() {
+  const ActionColumn: BasicColumn = {
+    width: 180,
+    title: '鎿嶄綔',
+    dataIndex: 'action',
+    slots: { customRender: 'action' },
+    fixed: undefined,
+  };
+
+  /**
+   * @description: 涓�浜涜嚜瀹氫箟鏂规硶
+   * @return {*}
+   */
+  const methods = {
+    /**
+     * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
+     * @return {*}
+     */
+    CreateAction: (fnName: string) => {
+      return {
+        action: 'go', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�)
+        url: 'BAS_REASON/High',
+        params: {
+          CODE: '0',
+          ID: buildUUID(),
+          Name: 'BAS_REASON',
+          Title: '鏂板涓嶈壇鍘熷洜缁�',
+          pCode: 'RSNG_CODE',
+          IsID: false,
+          drawers: [{ name: 'BAS_REASON', code: 'RSNG_CODE', type: 'one', keyName: 'BAS_REASON' }], //drawers鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
+        },
+      };
+    },
+    /**
+     * @description: 鎿嶄綔瀛楁鑷畾涔夋寜閽�
+     * @return {*}
+     */
+    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
+      if (!isNullOrUnDef(data[0])) {
+        data[0].onClick = rsnGrpEdit.bind(null, args, params); //鏇挎崲涓婚〉闈㈢紪杈戞寜閽柟娉曞彉涓鸿烦杞埌楂樼骇椤甸潰
+      }
+      return data;
+    },
+    GetSelectSuccess: (d, u) => {
+      return {
+        RSNG_CODE: d.values['val'],
+      };
+    },
+    OpenSelectItem: (openItemModal: Fn, ...args) => {
+      openItemModal(true, {
+        title: '涓嶈壇鍘熷洜缁勫垪琛�',
+        schemas: [
+          {
+            field: 'RSNG_CODE',
+            component: 'Input',
+            label: '涓嶈壇鍘熷洜缁勪唬鐮�',
+            colProps: {
+              span: 12,
+            },
+          },
+        ],
+        ItemColumns: [
+          {
+            title: t('涓嶈壇鍘熷洜缁勪唬鐮�'),
+            dataIndex: 'RSNG_CODE',
+            resizable: true,
+            sorter: true,
+            width: 200,
+          },
+          {
+            title: t('涓嶈壇鍘熷洜缁勫悕绉�'),
+            dataIndex: 'RSNG_NAME',
+            resizable: true,
+            sorter: true,
+            width: 180,
+          },
+        ],
+        tableName: 'BAS_REASON_GRP',
+        rowKey: 'RSNG_CODE',
+        searchInfo: { TABLE_NAME: 'BAS_REASON_GRP' },
+      });
+    },
+  };
+
+  /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */
+
   /**
    * @description: 鑷畾涔夌紪杈戞柟娉曪紝璺宠浆鍒伴珮绾ч〉闈�
    * @param {Fn} args
@@ -22,54 +111,19 @@
       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鏄彸杈瑰脊鍑哄鏀逛晶妗嗙殑鍚嶅瓧鍒楄〃
     };
-    args[5](`/BAS_REASON/High/${encodeURI(JSON.stringify(param))}`);
+    // 灏嗗璞¤浆鎹负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 }))}`,
+    );
   }
-
-  const ActionColumn: BasicColumn = {
-    width: 180,
-    title: '鎿嶄綔',
-    dataIndex: 'action',
-    slots: { customRender: 'action' },
-    fixed: undefined,
-  };
-
-  const methods = {
-    /**
-     * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
-     * @return {*}
-     */
-    CreateAction: () => {
-      return {
-        action: 'go', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�)
-        url: 'BAS_REASON/High',
-        params: {
-          CODE: '0',
-          ID: buildUUID(),
-          Name: 'BAS_REASON',
-          Title: '鏂板涓嶈壇鍘熷洜缁�',
-          pCode: 'RSNG_CODE',
-          IsID: false,
-        },
-      };
-    },
-    /**
-     * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽�
-     * @return {*}
-     */
-    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
-      data[0].onClick = rsnGrpEdit.bind(null, args, params); //鏇挎崲涓婚〉闈㈢紪杈戞寜閽柟娉曞彉涓鸿烦杞埌楂樼骇椤甸潰
-      return data;
-    },
-    GetSelectSuccess: (d, u) => {
-      return {
-        RSNG_CODE: d.values['val'],
-      };
-    },
-  };
 
   return [methods, ActionColumn];
 }

--
Gitblit v1.9.3