From a4ee6ba0ca28833cbbb8cf0e675561b10fa4c1af Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 12 九月 2024 01:23:40 +0800
Subject: [PATCH] 规则维护更新

---
 src/views/tigerprojects/system/lowcode/entityts/BAS_ITEM_CUST.ts |   88 +++++++++++++++++++++++++++++++------------
 1 files changed, 63 insertions(+), 25 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_ITEM_CUST.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_ITEM_CUST.ts
index 35e8f54..d233f83 100644
--- a/src/views/tigerprojects/system/lowcode/entityts/BAS_ITEM_CUST.ts
+++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_ITEM_CUST.ts
@@ -4,18 +4,19 @@
  * @version:
  * @Date: 2024-06-19 20:34:27
  * @LastEditors: Ben Lin
- * @LastEditTime: 2024-09-11 19:33:59
+ * @LastEditTime: 2024-09-12 01:13:02
  */
 
 import { Ref, h, unref } from 'vue';
-import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system';
 import { ActionItem, BasicColumn, FormSchema, useTable } from '/@/components/Table';
 import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
-import { Tag } from 'ant-design-vue';
 import { useLocale } from '/@/locales/useLocale';
 import { useDrawer } from '/@/components/Drawer';
 import { EditOperation, Search, custDel } from '../data';
 import { SaveBasItemRule } from '/@/api/tigerapi/mes/baserule';
+import { useModal } from '/@/components/Modal';
+import { SaveEntity } from '/@/api/tigerapi/system';
+import { useUserStore } from '/@/store/modules/user';
 
 const { getLocale } = useLocale();
 function _default() {
@@ -26,7 +27,7 @@
     slots: { customRender: 'action' },
     fixed: undefined,
   };
-  
+
   /**
    * @description: 浜涜嚜瀹氫箟鏂规硶
    * @return {*}
@@ -61,6 +62,15 @@
     GetBaseColumns: (type: string) => {
       return baseColumns[type];
     },
+    /**
+     * @description: 鑾峰彇妯℃�佹搴旂敤鍒楄〃
+     * @return {*}
+     */
+    GetUseModals: () => {
+      return {
+        BAS_CODE_RULE1add: useModal(),
+      };
+    },
     GetSearchForm: (type: string) => {
       return searchForms[type];
     },
@@ -94,6 +104,23 @@
           },
         },
         {
+          label: '瑙勫垯缂栫爜',
+          field: 'RULE_CODE',
+          required: true,
+          component: 'Input',
+          colProps: {
+            span: 7,
+          },
+        },
+        {
+          field: 'BAS_CODE_RULE1PSelect_0', //鎸変綆浠g爜閰嶇疆鐨勮鍒欙紝瀹炰綋鍚�+搴忓彿+PSelect_0锛屽簭鍙风敤鏉ュ尯鍒嗗涓殑鏃跺�欙紝PSelect_0杩欐槸涓浐瀹氬悗缂�
+          label: '1',
+          defaultValue: 'BAS_CODE_RULE',
+          component: 'Input',
+          colProps: { span: 1 },
+          colSlot: 'BAS_CODE_RULE1add', //鎸変綆浠g爜閰嶇疆鐨勮鍒欙紝瀹炰綋鍚�+搴忓彿+add锛屽簭鍙风敤鏉ュ尯鍒嗗涓殑鏃跺�欙紝add杩欐槸涓浐瀹氬悗缂�
+        },
+        {
           label: 'ID',
           field: 'ID',
           component: 'Input',
@@ -107,7 +134,7 @@
     /**
      * @description: 鑾峰彇鍗$墖鍐呴厤缃垪琛紝浠ュ惊鐜樉绀哄涓崱鐗囧苟閰嶇疆澶氫釜鎻掓Ы
      * @return {*}
-     */    
+     */
     GetBaseCards: (type: string) => {
       return [
         {
@@ -129,18 +156,20 @@
     /**
      * @description: 鑾峰彇鍙充晶杈规use鏂规硶
      * @return {*}
-     */    
+     */
     GetUseDrawers: () => {
-      return [{
-        'BAS_ITEM_CUST': useDrawer(),
-      }];
+      return [
+        {
+          BAS_ITEM_CUST: useDrawer(),
+        },
+      ];
     },
     /**
      * @description: 鑾峰彇琛ㄦ牸use鍒楄〃
      * @param {string} type
      * @param {array} args
      * @return {*}
-     */    
+     */
     GetUseTables: (data: Ref<{}>, ...args) => {
       return {
         BAS_ITEM_CUST: useTable({
@@ -164,7 +193,7 @@
             slots: { customRender: 'action' },
             fixed: 'right',
           }, //鑷畾涔夋搷浣滃垪
-        })
+        }),
       };
     },
     /**
@@ -176,10 +205,7 @@
       let data = {} as any;
       switch (d.type) {
         case 'BAS_ITEM_CUST':
-          data = d.data.value[d.type].filter(
-            (item) =>
-              item.RULE_CODE.includes(d.values.RULE_CODE),
-          );
+          data = d.data.value[d.type].filter((item) => item.RULE_CODE.includes(d.values.RULE_CODE));
           if (isNullOrEmpty(d.values.RULE_CODE)) {
             data = d.data.value[d.type];
           }
@@ -187,15 +213,22 @@
       }
       return data;
     },
+    /**
+     * @description:
+     * @param {string} val
+     * @param {string} id
+     * @return {*}
+     */
     KeyFieldValues: (val: string, id: string) => {
       return { ITEM_CODE: val, ITEM_ID: id };
-    } /**
+    },
+    /**
      * @description: 鑷畾涔夋槑缁嗚〃涓紪杈戣繑鍥炴柟娉�
      * @param {string} type
      * @param {*} d
      * @param {*} u
      * @return {*}
-     */,
+     */
     EditOperation: (data: Ref<any[]>, d, u, item) => {
       //鏇存柊
       var _data = data.value[item].map((item) => {
@@ -208,7 +241,7 @@
           };
         return item;
       });
-      EditOperation(data,d, u, item, _data);
+      EditOperation(data, d, u, item, _data);
     },
     /**
      * @description: 鑾峰彇鏍囬淇℃伅
@@ -217,11 +250,11 @@
      */
     GetTitle: () => {
       return {
-        pageTitle: '鐗╂枡绠$悊',
+        pageTitle: '鐗╂枡瑙勫垯绠$悊',
         pageContent: '杩欓噷鍙互娣诲姞鍜屼慨鏀圭墿鏂欒鍒欍��',
         tableTitle: {
-          BAS_ITEM_CUST: '鐗╂枡瑙勫垯绠$悊',
-        }
+          BAS_ITEM_CUST: '鐗╂枡瀹㈡埛瑙勫垯绠$悊',
+        },
       };
     },
     GetUseForm: () => {
@@ -232,7 +265,11 @@
      * @return {*}
      */
     SubmitAll: (data: Ref<any[]>, keyFieldValues: Ref<{}>, ...args) => {
+      const validates = args[1].validates;
+      const Keys = args[1].Keys;
+      validates[Keys[0]].AUTH_ORG = useUserStore().getUserInfo.orgCode.toString()
       SaveBasItemRule({
+        Item: validates[Keys[0]],
         ItemCusts: data.value['BAS_ITEM_CUST'],
       }).then((action) => {
         if (action.IsSuccessed) {
@@ -272,9 +309,10 @@
         title: '鏇存柊浜�',
         dataIndex: 'UPDATE_USER',
       },
-    ]
-  }
+    ],
+  };
 
+  /* 鎼滅储鏌ヨ缁撴瀯 */
   const searchForms = {
     BAS_ITEM_CUST: [
       {
@@ -294,7 +332,7 @@
       //   },
       // },
     ] as FormSchema[],
-  }
+  };
 
   const crudForms = {
     BAS_ITEM_CUST: [
@@ -369,7 +407,7 @@
         show: false,
       },
     ] as FormSchema[],
-  }
+  };
 
   return [methods, ActionColumn];
 }

--
Gitblit v1.9.3