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/data.ts | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 53 insertions(+), 1 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/data.ts b/src/views/tigerprojects/system/lowcode/data.ts index c5ec40c..8136cb0 100644 --- a/src/views/tigerprojects/system/lowcode/data.ts +++ b/src/views/tigerprojects/system/lowcode/data.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-02 17:52:35 * @LastEditors: Ben Lin - * @LastEditTime: 2024-10-15 20:55:16 + * @LastEditTime: 2024-10-23 23:01:49 */ import { ActionItem, FormSchema, PopConfirm } from '/@/components/Table'; @@ -19,6 +19,8 @@ import { formatToDateTime } from '/@/utils/dateUtil'; import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; import { useGo } from '/@/hooks/web/usePage'; +import { useQueryStore } from '/@/store/modules/queryInpage'; +import { RouteRecordName } from 'vue-router'; const { t } = useI18n(); /** @@ -379,3 +381,53 @@ go(`${path}/${encodeURI(JSON.stringify({ sName: id.sName}))}`); } } + + + + /** + * @description: 璋冪敤api鍓嶏紝鍙傛暟鏁寸悊 + * @param {*} t + * @return {*} + */ + export function SearchInfoFn(param: any, name: RouteRecordName | null | undefined, ByOrg: boolean) { + const useQuery = useQueryStore(); + if ( + !isNullOrUnDef(useQuery.getCurSearchInfo) && + useQuery.getCurSearchInfo.some((q) => q.name == name) + ) { + const curSearchInfo = useQuery.getCurSearchInfo.filter((q) => q.name == name); + const Keys = Object.getOwnPropertyNames(curSearchInfo[0].searchInfo); + for (const k in Keys) { + if (Keys[k] != 'page' && Keys[k] != 'pageSize') { + param[Keys[k]] = curSearchInfo[0].searchInfo[Keys[k]]; + } + } + useQuery.setCurSearchInfo({ name: name, searchInfo: param }); + } + if (isNullOrEmpty(param.option) && ByOrg) { + param.option = { + //鏍规嵁鎹偣鏌ヨ锛屽繀闇�甯﹁繖涓弬鏁� + UserId: useUserStore().getUserInfo.userId, + ByOrg: true, + CurOrg: useUserStore().getUserInfo.orgCode, + }; + } + return param; + } + + + /** + * @description: 璇锋眰涔嬪悗瀵硅繑鍥炲�艰繘琛屽鐞� + * @param {*} t + * @return {*} + */ + export function afterFetchFn(t: any, name: RouteRecordName | null | undefined, f) { + const useQuery = useQueryStore(); + if ( + !isNullOrUnDef(useQuery.getCurSearchInfo) && + useQuery.getCurSearchInfo.some((q) => q.name == name) + ) { + const curSearchInfo = useQuery.getCurSearchInfo.filter((q) => q.name == name); + f.setFieldsValue(curSearchInfo[0].searchInfo); + } + } -- Gitblit v1.9.3