|
@@ -210,7 +210,13 @@ export function useFormEvents({
|
|
|
first = false,
|
|
|
) {
|
|
|
const schemaList: FormSchema[] = cloneDeep(unref(getSchema));
|
|
|
-
|
|
|
+ const addSchemaIds: string[] = Array.isArray(schema)
|
|
|
+ ? schema.map((item) => item.field)
|
|
|
+ : [schema.field];
|
|
|
+ if (schemaList.find((item) => addSchemaIds.includes(item.field))) {
|
|
|
+ error('There are schemas that have already been added');
|
|
|
+ return;
|
|
|
+ }
|
|
|
const index = schemaList.findIndex((schema) => schema.field === prefixField);
|
|
|
const _schemaList = isObject(schema) ? [schema as FormSchema] : (schema as FormSchema[]);
|
|
|
if (!prefixField || index === -1 || first) {
|