// 检查每个表单的校验规则
const checkForm = (formName: any) => {
return new Promise((resolve, reject) => {
formName.validate((valid: boolean) => {
if (valid) {
resolve(true);
} else {
reject(false);
}
});
});
};
function configSubmit() {
let refList: any = [checkForm(routerFormRef.value), checkForm(sourceFormRef.value)]
targetFormRefs.value && targetFormRefs.value.forEach((childRef: any) => {
refList.push(checkForm(childRef))
});
Promise.all(refList).then(async (res: any) => {
resetForms();
emit('submit')
}).catch((err: any) => {})
}