|
@@ -4,7 +4,7 @@ import type { NamePath } from 'ant-design-vue/lib/form/interface';
|
|
import { unref, toRaw, nextTick } from 'vue';
|
|
import { unref, toRaw, nextTick } from 'vue';
|
|
import { isArray, isFunction, isObject, isString } from '/@/utils/is';
|
|
import { isArray, isFunction, isObject, isString } from '/@/utils/is';
|
|
import { deepMerge } from '/@/utils';
|
|
import { deepMerge } from '/@/utils';
|
|
-import { dateItemType, handleInputNumberValue } from '../helper';
|
|
|
|
|
|
+import { dateItemType, handleInputNumberValue, defaultValueComponents } from '../helper';
|
|
import { dateUtil } from '/@/utils/dateUtil';
|
|
import { dateUtil } from '/@/utils/dateUtil';
|
|
import { cloneDeep, uniqBy } from 'lodash-es';
|
|
import { cloneDeep, uniqBy } from 'lodash-es';
|
|
import { error } from '/@/utils/log';
|
|
import { error } from '/@/utils/log';
|
|
@@ -37,7 +37,9 @@ export function useFormEvents({
|
|
if (!formEl) return;
|
|
if (!formEl) return;
|
|
|
|
|
|
Object.keys(formModel).forEach((key) => {
|
|
Object.keys(formModel).forEach((key) => {
|
|
- formModel[key] = defaultValueRef.value[key];
|
|
|
|
|
|
+ const schema = unref(getSchema).find((item) => item.field === key);
|
|
|
|
+ const isInput = schema?.component && defaultValueComponents.includes(schema.component);
|
|
|
|
+ formModel[key] = isInput ? defaultValueRef.value[key] || '' : defaultValueRef.value[key];
|
|
});
|
|
});
|
|
nextTick(() => clearValidate());
|
|
nextTick(() => clearValidate());
|
|
|
|
|