|
|
@ -112,7 +112,7 @@ export function useFormEvents({ |
|
|
/** |
|
|
/** |
|
|
* @description: Delete based on field name |
|
|
* @description: Delete based on field name |
|
|
*/ |
|
|
*/ |
|
|
async function removeSchemaByFiled(fields: string | string[]): Promise<void> { |
|
|
async function removeSchemaByFeild(fields: string | string[]): Promise<void> { |
|
|
const schemaList: FormSchema[] = cloneDeep(unref(getSchema)); |
|
|
const schemaList: FormSchema[] = cloneDeep(unref(getSchema)); |
|
|
if (!fields) { |
|
|
if (!fields) { |
|
|
return; |
|
|
return; |
|
|
@ -123,7 +123,7 @@ export function useFormEvents({ |
|
|
fieldList = [fields]; |
|
|
fieldList = [fields]; |
|
|
} |
|
|
} |
|
|
for (const field of fieldList) { |
|
|
for (const field of fieldList) { |
|
|
_removeSchemaByFiled(field, schemaList); |
|
|
_removeSchemaByFeild(field, schemaList); |
|
|
} |
|
|
} |
|
|
schemaRef.value = schemaList; |
|
|
schemaRef.value = schemaList; |
|
|
} |
|
|
} |
|
|
@ -131,7 +131,7 @@ export function useFormEvents({ |
|
|
/** |
|
|
/** |
|
|
* @description: Delete based on field name |
|
|
* @description: Delete based on field name |
|
|
*/ |
|
|
*/ |
|
|
function _removeSchemaByFiled(field: string, schemaList: FormSchema[]): void { |
|
|
function _removeSchemaByFeild(field: string, schemaList: FormSchema[]): void { |
|
|
if (isString(field)) { |
|
|
if (isString(field)) { |
|
|
const index = schemaList.findIndex((schema) => schema.field === field); |
|
|
const index = schemaList.findIndex((schema) => schema.field === field); |
|
|
if (index !== -1) { |
|
|
if (index !== -1) { |
|
|
@ -306,7 +306,7 @@ export function useFormEvents({ |
|
|
updateSchema, |
|
|
updateSchema, |
|
|
resetSchema, |
|
|
resetSchema, |
|
|
appendSchemaByField, |
|
|
appendSchemaByField, |
|
|
removeSchemaByFiled, |
|
|
removeSchemaByFeild, |
|
|
resetFields, |
|
|
resetFields, |
|
|
setFieldsValue, |
|
|
setFieldsValue, |
|
|
scrollToField, |
|
|
scrollToField, |
|
|
|