yyg1378265336
2025-02-27 1384174f03c9a009cfbb3ae99aaeec21f177e4c2
src/components/Form/src/hooks/useAdvanced.ts
@@ -1,9 +1,9 @@
import type { ColEx } from '../types';
import type { AdvanceState } from '../types/hooks';
import { ComputedRef, getCurrentInstance, Ref, shallowReactive, computed, unref, watch } from 'vue';
import type { FormProps, FormSchema } from '../types/form';
import { isBoolean, isFunction, isNumber, isObject } from '/@/utils/is';
import { useBreakpoint } from '/@/hooks/event/useBreakpoint';
import type { FormProps, FormSchemaInner as FormSchema } from '../types/form';
import { isBoolean, isFunction, isNumber, isObject } from '@/utils/is';
import { useBreakpoint } from '@/hooks/event/useBreakpoint';
import { useDebounceFn } from '@vueuse/core';
const BASIC_COL_LEN = 24;
@@ -120,24 +120,18 @@
    const { baseColProps = {} } = unref(getProps);
    for (const schema of unref(getSchema)) {
      const { show, colProps } = schema;
      const { show, ifShow, colProps } = schema;
      const renderCallbackParams = {
        schema: schema,
        model: formModel,
        field: schema.field,
        values: { ...unref(defaultValueRef), ...formModel },
      };
      let isShow = true;
      if (isBoolean(show)) {
        isShow = show;
      }
      if (isFunction(show)) {
        isShow = show({
          schema: schema,
          model: formModel,
          field: schema.field,
          values: {
            ...unref(defaultValueRef),
            ...formModel,
          },
        });
      }
      isShow && isBoolean(ifShow) && (isShow = ifShow);
      isShow && isFunction(ifShow) && (isShow = ifShow(renderCallbackParams));
      isShow && isBoolean(show) && (isShow = show);
      isShow && isFunction(show) && (isShow = show(renderCallbackParams));
      if (isShow && (colProps || baseColProps)) {
        const { itemColSum: sum, isAdvanced } = getAdvanced(
@@ -160,7 +154,7 @@
    getAdvanced(unref(getProps).actionColOptions || { span: BASIC_COL_LEN }, itemColSum, true);
    emit('advanced-change');
    emit('advanced-change', advanceState.isAdvanced);
  }
  function handleToggleAdvanced() {