|
|
@ -6,7 +6,7 @@ import { isArray, isFunction, isObject, isString, isDef, isNullOrUnDef, isEmpty |
|
|
|
import { deepMerge } from '@/utils' |
|
|
|
import { deepMerge } from '@/utils' |
|
|
|
import { dateItemType, handleInputNumberValue, defaultValueComponents } from '../helper' |
|
|
|
import { dateItemType, handleInputNumberValue, defaultValueComponents } from '../helper' |
|
|
|
import { dateUtil } from '@/utils/dateUtil' |
|
|
|
import { dateUtil } from '@/utils/dateUtil' |
|
|
|
import { cloneDeep, set, uniqBy } from 'lodash-es' |
|
|
|
import { cloneDeep, set, uniqBy, get } from 'lodash-es' |
|
|
|
import { error } from '@/utils/log' |
|
|
|
import { error } from '@/utils/log' |
|
|
|
|
|
|
|
|
|
|
|
interface UseFormActionContext { |
|
|
|
interface UseFormActionContext { |
|
|
@ -35,7 +35,7 @@ function tryConstructArray(field: string, values: Recordable = {}): any[] | unde |
|
|
|
set(result, index, values[k.trim()]) |
|
|
|
set(result, index, values[k.trim()]) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
return result.length ? result : undefined |
|
|
|
return result.filter(Boolean).length ? result : undefined |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -104,9 +104,8 @@ export function useFormEvents({ |
|
|
|
const validKeys: string[] = [] |
|
|
|
const validKeys: string[] = [] |
|
|
|
fields.forEach((key) => { |
|
|
|
fields.forEach((key) => { |
|
|
|
const schema = unref(getSchema).find((item) => item.field === key) |
|
|
|
const schema = unref(getSchema).find((item) => item.field === key) |
|
|
|
let value = values[key] |
|
|
|
let value = get(values, key) |
|
|
|
|
|
|
|
const hasKey = !!get(values, key) |
|
|
|
const hasKey = Reflect.has(values, key) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
value = handleInputNumberValue(schema?.component, value) |
|
|
|
value = handleInputNumberValue(schema?.component, value) |
|
|
|
const { componentProps } = schema || {} |
|
|
|
const { componentProps } = schema || {} |
|
|
@ -157,6 +156,7 @@ export function useFormEvents({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
validateFields(validKeys).catch((_) => {}) |
|
|
|
validateFields(validKeys).catch((_) => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @description: Delete based on field name |
|
|
|
* @description: Delete based on field name |
|
|
|
*/ |
|
|
|
*/ |
|
|
|