From c8f8a9c645f7857859a9d56fac96192d994be70b Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期一, 24 六月 2024 18:48:29 +0800
Subject: [PATCH] 按钮权限更新

---
 src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts |  223 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 217 insertions(+), 6 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts
index bb4dcce..9916686 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_REASON.ts
@@ -1,19 +1,28 @@
 /*
+ * @Description: file content
+ * @Author: Ben Lin
+ * @version:
+ * @Date: 2024-06-22 00:58:43
+ * @LastEditors: Ben Lin
+ * @LastEditTime: 2024-06-24 15:50:42
+ */
+/*
  * @Description: 涓嶈壇鍘熷洜鐩稿叧
  * @Author: Ben Lin
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-06-23 00:21:58
+ * @LastEditTime: 2024-06-23 18:12:40
  */
 
-import { Ref } from 'vue';
-import { DeleteEntity } from '/@/api/tigerapi/system';
+import { Ref, h } from 'vue';
+import { DeleteEntity, getEntity } from '/@/api/tigerapi/system';
 import { ActionItem, BasicColumn } from '/@/components/Table';
 import { isNullOrEmpty } from '/@/utils/is';
 import { buildUUID } from '/@/utils/uuid';
 import { useUserStore } from '/@/store/modules/user';
 import { formatToDateTime } from '/@/utils/dateUtil';
+import { Tag } from 'ant-design-vue';
 
 function _default() {
   /**
@@ -55,7 +64,7 @@
      * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓�
      * @return {*}
      */
-    CreateAction: () => {
+    CreateAction: (fnName: string) => {
       return {
         action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�)
       };
@@ -75,7 +84,7 @@
      * @param {*} u
      * @return {*}
      */
-    EditeOperation:( data: Ref<any[]>, d, u) => {
+    EditeOperation: (data: Ref<any[]>, d, u) => {
       if (u.isUpdate) {
         //鏇存柊
         var _data = data.value.map((item) => {
@@ -108,7 +117,209 @@
     },
     GetHomeUrl: () => {
       return `/BAS_REASON_GRP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_REASON_GRP', colSlots: [], crudColSlots: [] }))}`;
-    }
+    },
+    GetBaseColumns: () => {
+      return [
+        {
+          title: '涓嶈壇鍘熷洜缂栫爜',
+          dataIndex: 'RSN_CODE',
+          // ifShow: false,
+          width: 180,
+        },
+        {
+          title: '涓嶈壇鍘熷洜鍚嶇О',
+          dataIndex: 'RSN_NAME',
+        },
+        {
+          title: '鏄惁蹇呴』鏇存崲闆朵欢',
+          dataIndex: 'NEED_REPLACE',
+          customRender: ({ record }) => {
+            const type = record.NEED_REPLACE;
+            var text = '';
+            var color = 'green';
+            switch (type) {
+              case 'Y':
+                text = '鏇存崲';
+                break;
+              case 'N':
+                color = 'blue';
+                text = '涓嶆洿鎹�';
+                break;
+            }
+            return h(Tag, { color: color }, () => text);
+          },
+        },
+        {
+          title: '涓嶈壇鍘熷洜缁勭紪鐮�',
+          dataIndex: 'RSNG_CODE',
+        },
+        {
+          title: '澶囨敞',
+          dataIndex: 'REMARK',
+        },
+        {
+          title: '鏇存柊鏃堕棿',
+          dataIndex: 'UPDATE_TIME',
+        },
+        {
+          title: '鏇存柊浜�',
+          dataIndex: 'UPDATE_USER',
+        },
+      ];
+    },
+    GetSearchForm: () => {
+      return [
+        {
+          field: 'RSN_CODE',
+          label: '涓嶈壇鍘熷洜缂栫爜',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '涓嶈壇鍘熷洜鍚嶇О',
+          field: 'RSN_NAME',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+      ];
+    },
+    GetCrudForm: () => {
+      return [
+        {
+          field: 'RSN_CODE',
+          label: '涓嶈壇鍘熷洜缂栫爜',
+          component: 'Input',
+          required: true,
+          colProps: {
+            span: 24,
+          },
+        },
+        {
+          label: '涓嶈壇鍘熷洜鍚嶇О',
+          field: 'RSN_NAME',
+          component: 'Input',
+          required: true,
+          colProps: {
+            span: 24,
+          },
+        },
+        {
+          label: '涓嶈壇鍘熷洜缁勭紪鐮�',
+          field: 'RSNG_CODE',
+          component: 'ApiSelect',
+          colProps: {
+            span: 24,
+          },
+          componentProps: {
+            api: getEntity,
+            params: { entityName: 'BAS_REASON_GRP', sqlcmd: ' 1=1 ' },
+            resultField: 'Data.Items',
+            labelField: 'RSNG_NAME',
+            valueField: 'RSNG_CODE',
+          },
+          dynamicDisabled: ({ values }) => {
+            return true;
+          },
+        },
+        {
+          label: '鏄惁蹇呴』鏇存崲闆朵欢',
+          field: 'NEED_REPLACE',
+          component: 'Select',
+          required: true,
+          colProps: {
+            span: 24,
+          },
+          componentProps: {
+            options: [
+              {
+                label: '鏇存崲',
+                value: 'Y',
+                key: 'Y',
+              },
+              {
+                label: '涓嶆洿鎹�',
+                value: 'N',
+                key: 'N',
+              },
+            ],
+          },
+        },
+        {
+          label: '澶囨敞',
+          field: 'REMARK',
+          component: 'Input',
+          colProps: {
+            span: 24,
+          },
+        },
+        {
+          label: 'ID',
+          field: 'ID',
+          component: 'Input',
+          colProps: {
+            span: 24,
+          },
+          show: false,
+        },
+      ];
+    },
+    GetBaseForm: () => {
+      return [
+        {
+          field: 'RSNG_CODE',
+          label: '涓嶈壇鍘熷洜缁勭紪鐮�',
+          component: 'Input',
+          required: true,
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '涓嶈壇鍘熷洜缁勫悕绉�',
+          field: 'RSNG_NAME',
+          required: true,
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: '澶囨敞',
+          field: 'REMARK',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+        },
+        {
+          label: 'ID',
+          field: 'ID',
+          component: 'Input',
+          colProps: {
+            span: 8,
+          },
+          show: false,
+        },
+      ];
+    },
+    GetBaseCards: () => {
+      return [
+        {
+          name: 'BaseForm',
+          slots: [],
+          preIcons: {},
+          title: '涓嶈壇鍘熷洜缁勪俊鎭�',
+          entityName: 'BAS_REASON_GRP',
+        },
+      ];
+    },
+    OthersValues: (val: string, id: string) => {
+      return { RSNG_CODE: val };
+    },
   };
 
   return [methods, ActionColumn];

--
Gitblit v1.9.3