Commit ab11818c by GoldenZqqqq

feat: 优化切换步骤时的必填校验,限制往后切换时才触发必填校验优化用户体验

parent a6461da0
...@@ -228,7 +228,9 @@ const handleStepClick = async (index: number) => { ...@@ -228,7 +228,9 @@ const handleStepClick = async (index: number) => {
return return
} }
} }
// 校验当前步骤
// 只有在向后切换时才进行校验
if (index > currentStep.value) {
try { try {
if (typeof steps[currentStep.value].validator === 'function') { if (typeof steps[currentStep.value].validator === 'function') {
await steps[currentStep.value].validator() await steps[currentStep.value].validator()
...@@ -237,6 +239,10 @@ const handleStepClick = async (index: number) => { ...@@ -237,6 +239,10 @@ const handleStepClick = async (index: number) => {
} catch (error) { } catch (error) {
message.warning('请先完善当前步骤必填信息') message.warning('请先完善当前步骤必填信息')
} }
} else {
// 向前切换时直接切换
currentStep.value = index
}
} }
/** 处理设计器保存成功 */ /** 处理设计器保存成功 */
...@@ -244,6 +250,7 @@ const handleDesignSuccess = (bpmnXml?: string) => { ...@@ -244,6 +250,7 @@ const handleDesignSuccess = (bpmnXml?: string) => {
if (bpmnXml) { if (bpmnXml) {
formData.value.bpmnXml = bpmnXml formData.value.bpmnXml = bpmnXml
} }
handleSave() // 自动保存
message.success('保存成功') message.success('保存成功')
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment