diff --git a/src/components/FormViewer/index.vue b/src/components/FormViewer/index.vue
index aaecbc11..def7216e 100644
--- a/src/components/FormViewer/index.vue
+++ b/src/components/FormViewer/index.vue
@@ -3,7 +3,7 @@
@@ -91,7 +91,8 @@
const { proxy } = getCurrentInstance();
const emit = defineEmits(['getFormSuccess']);
const subTableDataStore = subTableStore();
-
+ const tabsFormRef = ref()
+ const formRef = ref()
let formColumns: FormSchema[] = [];
const props = defineProps({
formConfig: Object,
@@ -315,8 +316,7 @@
}, 10);
}
}
- async function tabsChange(e) {
- clearValidate();
+ function tabsChange(e) {
tabsKey.value = e;
formColumns.forEach((element) => {
element.show = false;
@@ -341,6 +341,7 @@
}
setTimeout(() => {
setFieldsValue(FieldsValue.value);
+ clearValidate()
}, 10);
}
@@ -425,8 +426,19 @@
}
}
console.log(subTableDataStore.getGroupData);
+ let resultObj = {}
+ tabsFormRef.value.forEach((item,index) => {
+ console.log(item.getFieldsValue(),index)
+ let data = item.getFieldsValue()
+ Object.keys(data).forEach(key => {
+ if(!resultObj[key]){
+ resultObj[key] = data[key]
+ }
+ })
+ })
//卡片组的值赋值给form,优化卡片组必填验证不通过
setFieldsValue({
+ ...resultObj,
...subTableDataStore.getGroupData,
});
@@ -491,7 +503,8 @@
if (props.formVerison) {
getFormHistory();
}
- clearValidate();
+ tabsFormRef.value && tabsFormRef.value.clearValidate();
+ formRef.value && formRef.value.clearValidate();
});
function radioVal() {
console.log('radioVal');