...
|
...
|
@@ -4,7 +4,6 @@ |
4
|
4
|
import { BasicForm, FormActionType, FormProps, FormSchema } from '/@/components/Form';
|
5
|
5
|
import { computed, ref, unref, watch } from 'vue';
|
6
|
6
|
import { buildShortUUID } from '/@/utils/uuid';
|
7
|
|
- import { isNullOrUnDef } from '/@/utils/is';
|
8
|
7
|
import { ComponentType } from '/@/components/Form/src/types';
|
9
|
8
|
|
10
|
9
|
enum FormFieldEnum {
|
...
|
...
|
@@ -40,8 +39,6 @@ |
40
|
39
|
}
|
41
|
40
|
);
|
42
|
41
|
|
43
|
|
- const emit = defineEmits(['update:value']);
|
44
|
|
-
|
45
|
42
|
const getPlaceholder = (label = '') => `请输入${label}`;
|
46
|
43
|
|
47
|
44
|
const getRules = (label = '') => {
|
...
|
...
|
@@ -51,7 +48,6 @@ |
51
|
48
|
const mergeComponentProps = (label = '') => {
|
52
|
49
|
return {
|
53
|
50
|
placeholder: getPlaceholder(label),
|
54
|
|
- onBlur: handleOnBlur,
|
55
|
51
|
};
|
56
|
52
|
};
|
57
|
53
|
|
...
|
...
|
@@ -77,17 +73,6 @@ |
77
|
73
|
] as FormSchema[];
|
78
|
74
|
});
|
79
|
75
|
|
80
|
|
- const handleOnBlur = () => {
|
81
|
|
- const value = getFieldsValue();
|
82
|
|
-
|
83
|
|
- if (
|
84
|
|
- unref(list).length === Object.keys(value).length &&
|
85
|
|
- Object.values(value).some((item) => isNullOrUnDef(item))
|
86
|
|
- )
|
87
|
|
- return;
|
88
|
|
- emit('update:value', value);
|
89
|
|
- };
|
90
|
|
-
|
91
|
76
|
const list = ref<ListItemType[]>([{ uuid: buildShortUUID() }]);
|
92
|
77
|
|
93
|
78
|
const formListElRef = ref<Nullable<FormActionType>[]>([]);
|
...
|
...
|
|