无木
2022-10-29 58b30aae9a1d749fdbeaca4f1310059a7cc96db2
src/components/Form/src/hooks/useAdvanced.ts
@@ -1,6 +1,6 @@
import type { ColEx } from '../types';
import type { AdvanceState } from '../types/hooks';
import { ComputedRef, getCurrentInstance, Ref } from 'vue';
import { ComputedRef, getCurrentInstance, Ref, shallowReactive } from 'vue';
import type { FormProps, FormSchema } from '../types/form';
import { computed, unref, watch } from 'vue';
import { isBoolean, isFunction, isNumber, isObject } from '/@/utils/is';
@@ -113,6 +113,8 @@
    }
  }
  const fieldsIsAdvancedMap = shallowReactive({});
  function updateAdvanced() {
    let itemColSum = 0;
    let realItemColSum = 0;
@@ -148,7 +150,7 @@
        if (isAdvanced) {
          realItemColSum = itemColSum;
        }
        schema.isAdvanced = isAdvanced;
        fieldsIsAdvancedMap[schema.field] = isAdvanced;
      }
    }
@@ -166,5 +168,5 @@
    advanceState.isAdvanced = !advanceState.isAdvanced;
  }
  return { handleToggleAdvanced };
  return { handleToggleAdvanced, fieldsIsAdvancedMap };
}