perf(util): remove handleInputNumberValue (#3806)

* perf(util): remove handleInputNumberValue

* fix: remove unuse fn
This commit is contained in:
Electrolux
2024-05-02 03:22:53 +08:00
committed by GitHub
parent 08a1f7b682
commit ba5b8f8506
2 changed files with 1 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ import type { Rule as ValidationRule } from 'ant-design-vue/lib/form/interface';
import type { ComponentType } from './types';
import { useI18n } from '@/hooks/web/useI18n';
import { dateUtil } from '@/utils/dateUtil';
import { isNumber, isObject } from '@/utils/is';
import { isObject } from '@/utils/is';
const { t } = useI18n();
@@ -69,14 +69,6 @@ export const defaultValueComponents = [
'InputTextArea',
];
export function handleInputNumberValue(component?: ComponentType, val?: any) {
if (!component) return val;
if (defaultValueComponents.includes(component)) {
return val && isNumber(val) ? val : `${val}`;
}
return val;
}
/**
* 时间字段
*/

View File

@@ -6,7 +6,6 @@ import { isArray, isFunction, isObject, isString, isDef, isNil } from '@/utils/i
import { deepMerge } from '@/utils';
import {
dateItemType,
handleInputNumberValue,
defaultValueComponents,
isIncludeSimpleComponents,
} from '../helper';
@@ -79,8 +78,6 @@ export function useFormEvents({
const schema = unref(getSchema).find((item) => item.field === key);
let value = get(values, key);
const hasKey = has(values, key);
value = handleInputNumberValue(schema?.component, value);
const { componentProps } = schema || {};
let _props = componentProps as any;
if (typeof componentProps === 'function') {