|
@@ -4,7 +4,6 @@ |
|
@@ -4,7 +4,6 @@ |
4
|
import { BasicForm, FormActionType, FormProps, FormSchema } from '/@/components/Form';
|
4
|
import { BasicForm, FormActionType, FormProps, FormSchema } from '/@/components/Form';
|
5
|
import { computed, ref, unref, watch } from 'vue';
|
5
|
import { computed, ref, unref, watch } from 'vue';
|
6
|
import { buildShortUUID } from '/@/utils/uuid';
|
6
|
import { buildShortUUID } from '/@/utils/uuid';
|
7
|
- import { isNullOrUnDef } from '/@/utils/is';
|
|
|
8
|
import { ComponentType } from '/@/components/Form/src/types';
|
7
|
import { ComponentType } from '/@/components/Form/src/types';
|
9
|
|
8
|
|
10
|
enum FormFieldEnum {
|
9
|
enum FormFieldEnum {
|
|
@@ -40,8 +39,6 @@ |
|
@@ -40,8 +39,6 @@ |
40
|
}
|
39
|
}
|
41
|
);
|
40
|
);
|
42
|
|
41
|
|
43
|
- const emit = defineEmits(['update:value']);
|
|
|
44
|
-
|
|
|
45
|
const getPlaceholder = (label = '') => `请输入${label}`;
|
42
|
const getPlaceholder = (label = '') => `请输入${label}`;
|
46
|
|
43
|
|
47
|
const getRules = (label = '') => {
|
44
|
const getRules = (label = '') => {
|
|
@@ -51,7 +48,6 @@ |
|
@@ -51,7 +48,6 @@ |
51
|
const mergeComponentProps = (label = '') => {
|
48
|
const mergeComponentProps = (label = '') => {
|
52
|
return {
|
49
|
return {
|
53
|
placeholder: getPlaceholder(label),
|
50
|
placeholder: getPlaceholder(label),
|
54
|
- onBlur: handleOnBlur,
|
|
|
55
|
};
|
51
|
};
|
56
|
};
|
52
|
};
|
57
|
|
53
|
|
|
@@ -77,17 +73,6 @@ |
|
@@ -77,17 +73,6 @@ |
77
|
] as FormSchema[];
|
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
|
const list = ref<ListItemType[]>([{ uuid: buildShortUUID() }]);
|
76
|
const list = ref<ListItemType[]>([{ uuid: buildShortUUID() }]);
|
92
|
|
77
|
|
93
|
const formListElRef = ref<Nullable<FormActionType>[]>([]);
|
78
|
const formListElRef = ref<Nullable<FormActionType>[]>([]);
|