mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-03 10:56:00 +00:00
perf(util): remove handleInputNumberValue (#3806)
* perf(util): remove handleInputNumberValue * fix: remove unuse fn
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间字段
|
||||
*/
|
||||
|
@@ -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') {
|
||||
|
Reference in New Issue
Block a user