审批流保存数据检验

This commit is contained in:
ChenXinXin committed 2024-05-07 11:48:10 +08:00
1 parent 7e094cd83e
commit 9bec3c6de0
8 files changed
+233 -94

No files matched your search

@@ -63,7 +63,7 @@
v-model="formItem.answer"
></v-text-field>
</template>
<v-date-picker no-title scrollable></v-date-picker>
<v-date-picker no-title scrollable v-model="formItem.answer"></v-date-picker>
</v-menu>
</v-list-item-content>
@@ -260,6 +260,17 @@ Vue.component("form-item-list-generator", {
return this.formItemList;
},
dataValidate(){
console.log('formItemListGenerator-dataValidate', this.formItemList);
// 检查单选多选是否还有选项
this.formItemList.forEach(async element => {
if(['single', 'multiple'].includes(element.type) && !(element.optionList && element.optionList.length)){
await window.vtoast.fail("存在选择题没有选项!");
throw new Error("存在选择题没有选项!")
}
});
}
},
})
</script>
+13 -8
View File
@@ -38,19 +38,24 @@
}
},
watch: {
// 每个属性值发生变化就会调用这个函数
form(newVal, oldVal) {
this.saveData(newVal)
},
// 深度监听 属性的变化
deep: true
},
async created() {
},
mounted() {},
methods: {
saveData(newVal) {
// this.$emit('change-structure', this.form);
async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) {
case 'dataValidate':
await this.dataValidate();
break;
default:
console.error("[doUiAction] uiActionId not find", {uiActionId});
break;
}
},
dataValidate(){
this.$refs.formItemListGenerator.dataValidate()
}
}
})