Ben Lin
2024-06-09 38b2a8369513ebcc34c6dd01a176593b825fe71e
src/views/components/data.ts
@@ -1,20 +1,40 @@
import { getFns, woGetSelectSuccess, woCustFn, woformSchema, woCfgformSchema } from './bizMesWo';
import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table';
import {
  getWoFns,
  woGetSelectSuccess,
  woCustFn,
  woformSchema,
  woCfgformSchema,
  prodCfgformSchema,
  xxCfgformSchema,
} from './bizMesWo';
import { FormSchema } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
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;
  }
}
@@ -24,8 +44,14 @@
    case 'BIZ_MES_WO':
      _formSchema = woformSchema;
      break;
    case 'BIZ_MES_WO_Config':
    case 'woinfo':
      _formSchema = woCfgformSchema;
      break;
    case 'prodinfo':
      _formSchema = prodCfgformSchema;
      break;
    case 'xxinfo':
      _formSchema = xxCfgformSchema;
      break;
    default:
      break;
@@ -39,6 +65,7 @@
  let data = {};
  switch (entityName) {
    case 'BIZ_MES_WO':
    case 'BIZ_MES_WO_Config':
      data = woGetSelectSuccess(d, u);
      break;
    default:
@@ -60,9 +87,10 @@
) {
  switch (entityName) {
    case 'BIZ_MES_WO':
    case 'BIZ_MES_WO_Config': //根据带入的名称打开不同的实体列表
      woCustFn(openItemModal, slotName, others, args);
      break;
    default:
    default: //默认打开物料列表
      openItemModal(true, {
        title: '物料列表',
        schemas: [