From 3505aa60ad15de91bc9b437ca8d69124c8074974 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 25 六月 2024 11:42:28 +0800
Subject: [PATCH] 通用页面更新

---
 src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts |   97 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 85 insertions(+), 12 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts
index 1ae4ec7..6cffcb7 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_DEFECT_GRP.ts
@@ -4,21 +4,16 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-22 00:51:17
+ * @LastEditTime: 2024-06-25 11:28:25
  */
 
-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() {
-  /**
-   * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽�
-   * @return {*}
-   */
-  function ActionItem(params: Recordable<any>, data, ...args): ActionItem[] {
-    data[0].onClick = DftGrpEdit.bind(null, args, params);
-    return data;
-  }
-
   /**
    * @description: 鑷畾涔夌紪杈戞柟娉�
    * @param {Fn} args
@@ -37,7 +32,85 @@
     args[5](`/BAS_DEFECT/High/${encodeURI(JSON.stringify(param))}`);
   }
 
-  return [ActionItem];
+  const ActionColumn: BasicColumn = {
+    width: 100,
+    title: '鎿嶄綔',
+    dataIndex: 'action',
+    slots: { customRender: 'action' },
+    fixed: 'right',
+  };
+
+  const methods = {
+    /**
+     * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
+     * @return {*}
+     */
+    CreateAction: (fnName: string) => {
+      return {
+        action: 'go', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�)
+        url: 'BAS_DEFECT/High',
+        params: {
+          CODE: '0',
+          ID: buildUUID(),
+          Name: 'BAS_DEFECT',
+          Title: '鏂板涓嶈壇浠g爜缁�',
+          pCode: 'DFTG_CODE',
+          IsID: false,
+        },
+      };
+    },
+    /**
+     * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽�
+     * @return {*}
+     */
+    ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => {
+      if (!isNullOrUnDef(data[0])) {
+        data[0].onClick = DftGrpEdit.bind(null, args, params);
+      }
+      return data;
+    },
+    GetSelectSuccess: (d, u) => {
+      return {
+        ITEM_CODE: d.values['val'],
+      };
+    },
+    OpenSelectItem: (openItemModal: Fn) => {
+      openItemModal(true, {
+        title: '鐗╂枡鍒楄〃',
+        schemas: [
+          {
+            field: 'ITEM_CODE',
+            component: 'Input',
+            label: '鐗╂枡缂栫爜',
+            colProps: {
+              span: 12,
+            },
+          },
+        ],
+        ItemColumns: [
+          {
+            title: t('鐗╂枡缂栫爜'),
+            dataIndex: 'ITEM_CODE',
+            resizable: true,
+            sorter: true,
+            width: 200,
+          },
+          {
+            title: t('鐗╂枡鍚嶇О'),
+            dataIndex: 'ITEM_NAME',
+            resizable: true,
+            sorter: true,
+            width: 180,
+          },
+        ],
+        tableName: 'BAS_ITEM',
+        rowKey: 'ITEM_CODE',
+        searchInfo: { TABLE_NAME: 'BAS_ITEM' },
+      });
+    },
+  };
+
+  return [methods, ActionColumn];
 }
 
 export default _default;

--
Gitblit v1.9.3