luoyali 1 рік тому
батько
коміт
431ee24425

+ 8 - 8
src/views/flow/create/components/FormDesign.vue

@@ -23,14 +23,14 @@ const validate = () => {
 	// 根据后续的业务需求 调整 validate 的功能
 	exportJsonEv()
 	return new Promise((resolve, reject) => {
-		// const finallyFormData = JSON.parse(processForm.value)
-		// const fields = finallyFormData.map(item => item.field)
-		// const bool = fields.length === [...new Set(fields)].length
-		// if (bool) {
-		resolve(true)
-		// } else {
-		//   reject(false)
-		// }
+		const formStructure = EReditorRef.value.getData()
+		const fields = formStructure?.fields || []
+		const bool = fields.length
+		if (bool) {
+			resolve(true)
+		} else {
+			reject(false)
+		}
 	})
 }
 

+ 0 - 4
src/views/flow/create/index.vue

@@ -139,10 +139,6 @@ const validateTabs = async () => {
 			}
 		await _validate().catch(e => {
 			activeTab.value = componentsArr[i].label
-			/*// 表单设计 额外 弹窗
-			if (activeTab.value === '表单设计') {
-				ElMessage.error(`表单设计中字段ID不能重复,请确认唯一值`)
-			}*/
 			bool = false
 		})
 		if (!bool) return false