From 38b2a8369513ebcc34c6dd01a176593b825fe71e Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 09 六月 2024 17:06:08 +0800 Subject: [PATCH] 工单管理更新 --- src/views/components/data.ts | 28 ++++++++++++++++++++-------- 1 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/views/components/data.ts b/src/views/components/data.ts index e6b981b..cbb4c0b 100644 --- a/src/views/components/data.ts +++ b/src/views/components/data.ts @@ -1,5 +1,5 @@ import { - getFns, + getWoFns, woGetSelectSuccess, woCustFn, woformSchema, @@ -12,17 +12,29 @@ const { t } = useI18n(); export const formSchema: FormSchema[] = []; -export function custFunction(e: any, fnName: string, type: string, ...args) { +export async function custFunction<T = any>( + e: any, + fnName: string, + type: string, + ...args +): Promise<T> { switch (type) { case 'BIZ_MES_WO': - getFns[fnName](e, args); - break; case 'BIZ_MES_WO_Config': - getFns[fnName](e, args); - break; + return getWoFns[fnName](e, args); + // break; default: - break; - (e) => {}; + return new Promise((resolve, reject) => { + try { + (e) => {}; + resolve(true); + } catch { + reject(false); + } finally { + args[0][0]({ confirmLoading: false }); + } + }); + // break; } } -- Gitblit v1.9.3