未验证 提交 af54b0fb 编写于 作者: O oooplz 提交者: GitHub

feat: 多路径字段获取值 (#2664)

上级 4418eccf
...@@ -14,7 +14,7 @@ import { ...@@ -14,7 +14,7 @@ import {
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 {
...@@ -112,9 +112,8 @@ export function useFormEvents({ ...@@ -112,9 +112,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 || {};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册