From 5a813f3b28f3cbf1db3a3657ccf83267c6e0d315 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 24 十月 2024 11:22:02 +0800
Subject: [PATCH] 工艺路线相关优化

---
 src/views/tigerprojects/system/lowcode/normal/mainTable.vue |   48 +++++++++++-------------------------------------
 1 files changed, 11 insertions(+), 37 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
index d4e5502..ac407e2 100644
--- a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
+++ b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue
@@ -87,7 +87,7 @@
   import { getRoleButtons } from '/@/api/sys/menu';
   import { useUserStore } from '/@/store/modules/user';
   import { useRouter } from 'vue-router';
-  import { GenerateActionButton, initRoute } from '../data';
+  import { afterFetchFn, GenerateActionButton, initRoute, SearchInfoFn } from '../data';
   import LogicFlow from '@logicflow/core';
   import { isFunction } from 'xe-utils';
   import { CustModalParams } from '/@/api/tigerapi/model/systemModel';
@@ -138,7 +138,9 @@
   /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */
   try {
     custImport.value = await import(`../entityts/${objParams.value['ID']}.ts`);
-  } catch (e) {}
+  } catch (e) {
+    console.log(e)
+  }
   const [
     {
       ActionItem: nActionItem,
@@ -187,14 +189,14 @@
             }
           : '',
     },
-    beforeFetch: SearchInfoFn,
-    afterFetch: afterFetchFn,
+    beforeFetch: (t) => SearchInfoFn(t, route.name, AuthOption.value['BY_ORG'] == 'Y'),
+    afterFetch: afterFetch,
     columns: _columns as unknown as BasicColumn[],
     formConfig: {
       labelWidth: 140,
       schemas: _searchFormSchema as unknown as FormSchema[],
       submitFunc: () => Search(), //鑷畾涔夋煡璇㈡彁浜ゆ寜閽殑鏂规硶锛岃Е鍙戞煡璇㈡彁浜や簨浠�
-      resetFunc: () => useQuery.resetFunc(route.name, getForm()),
+      resetFunc: () => useQuery.resetFunc(route.name, getForm(), AuthOption.value['BY_ORG'] == 'Y'),
     },
     useSearchForm: true,
     showTableSetting: true,
@@ -259,46 +261,18 @@
    * @return {*}
    */
   async function Search() {
-    useQuery.submitFunc(route.name, getForm()).then(() => {
+    useQuery.submitFunc(route.name, getForm(), AuthOption.value['BY_ORG'] == 'Y').then(() => {
       reload();
     });
   }
-
-  /**
-   * @description: 璋冪敤api鍓嶏紝鍙傛暟鏁寸悊
-   * @param {*} t
-   * @return {*}
-   */
-  function SearchInfoFn(t) {
-    if (
-      !isNullOrUnDef(useQuery.getCurSearchInfo) &&
-      useQuery.getCurSearchInfo.some((q) => q.name == route.name)
-    ) {
-      const curSearchInfo = useQuery.getCurSearchInfo.filter((q) => q.name == route.name);
-      const Keys = Object.getOwnPropertyNames(curSearchInfo[0].searchInfo);
-      for (const k in Keys) {
-        if (Keys[k] != 'page' && Keys[k] != 'pageSize') {
-          t[Keys[k]] = curSearchInfo[0].searchInfo[Keys[k]];
-        }
-      }
-      useQuery.setCurSearchInfo({ name: route.name, searchInfo: t });
-    }
-    return t;
-  }
-
+  
   /**
    * @description: 璇锋眰涔嬪悗瀵硅繑鍥炲�艰繘琛屽鐞�
    * @param {*} t
    * @return {*}
    */
-  function afterFetchFn(t) {
-    if (
-      !isNullOrUnDef(useQuery.getCurSearchInfo) &&
-      useQuery.getCurSearchInfo.some((q) => q.name == route.name)
-    ) {
-      const curSearchInfo = useQuery.getCurSearchInfo.filter((q) => q.name == route.name);
-      getForm().setFieldsValue(curSearchInfo[0].searchInfo);
-    }
+  function afterFetch(t) {
+    afterFetchFn(t,route.name, getForm())
   }
 
   const currlf = ref(null) as Ref<LogicFlow | null>;

--
Gitblit v1.9.3