From 6cc2d85787171281c269f4a6c3290b4a0762bcb6 Mon Sep 17 00:00:00 2001
From: YangYuGang <1378265336@qq.com>
Date: 星期三, 05 三月 2025 16:21:43 +0800
Subject: [PATCH] 生产工具

---
 src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts |  111 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 102 insertions(+), 9 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 aa25374..33acb6e 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON_GRP.ts
@@ -4,20 +4,105 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-22 01:02:52
+ * @LastEditTime: 2024-08-04 14:20:37
  */
 
-import { ActionItem } from '/@/components/Table';
+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: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽�
+   * @description: 涓�浜涜嚜瀹氫箟鏂规硶
    * @return {*}
    */
-  function ActionItem(params: Recordable<any>, data, ...args): ActionItem[] {
-    data[0].onClick = rsnGrpEdit.bind(null, args, params); //鏇挎崲涓婚〉闈㈢紪杈戞寜閽柟娉曞彉涓鸿烦杞埌楂樼骇椤甸潰
-    return data;
-  }
+  const methods = {
+    /**
+     * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
+     * @return {*}
+     */
+    CreateAction: (type: string) => {
+      return {
+        action: 'go', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) | edit(濡傛灉鏄〃鏍煎彲缂栬緫椤甸潰灏辨槸鑷畾涔夋柟娉�)
+        url: 'BAS_REASON/High',
+        params: {
+          CODE: '0',
+          ID: buildUUID(),
+          Name: 'BAS_REASON',
+          Title: '鏂板涓嶈壇鍘熷洜缁�',
+          pCode: 'RSNG_CODE',
+          IsID: false,
+          ifSave: 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' },
+      });
+    },
+    GetUseForm: () => {
+      return {};
+    },
+  };
+
+  /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */
 
   /**
    * @description: 鑷畾涔夌紪杈戞柟娉曪紝璺宠浆鍒伴珮绾ч〉闈�
@@ -30,14 +115,22 @@
       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,
+      ifSave: 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 }))}`,
+    );
   }
 
-  return [ActionItem];
+  return [methods, ActionColumn];
 }
 
 export default _default;

--
Gitblit v1.9.3