diff --git a/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue b/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue index 7056403f..e3dba33d 100644 --- a/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue +++ b/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue @@ -245,10 +245,3 @@ watch( } ) - diff --git a/src/views/bpm/model/CreateUpdate.vue b/src/views/bpm/model/CreateUpdate.vue index 849be1ed..9dc4e6a0 100644 --- a/src/views/bpm/model/CreateUpdate.vue +++ b/src/views/bpm/model/CreateUpdate.vue @@ -550,34 +550,33 @@ const handleDesignSuccess = (bpmnXml?: string) => { const handleStepClick = async (index: number) => { // 如果是切换到第三步(流程设计),需要校验key和name if (index === 2) { - if (!formData.value.id) { - // 新增时才校验 - try { - await formRef.value?.validateField(['key', 'name']) - // 确保数据已经准备好 - await nextTick() - } catch (error) { - message.warning('请先填写流程标识和流程名称') - return - } + if (!formData.value.key || !formData.value.name) { + message.warning('请先填写流程标识和流程名称') + return } - // 确保数据已经准备好再切换 - await nextTick() } + currentStep.value = index } // 添加一个计算属性来判断是否显示设计器 const showDesigner = computed(() => { - return currentStep.value === 2 && Boolean(formData.value.id || (formData.value.key && formData.value.name)) + return ( + currentStep.value === 2 && + Boolean(formData.value.id || (formData.value.key && formData.value.name)) + ) }) // 监听步骤变化,确保数据准备完成 -watch(() => currentStep.value, async (newStep) => { - if (newStep === 2) { - await nextTick() - } -}, { immediate: false }) +watch( + () => currentStep.value, + async (newStep) => { + if (newStep === 2) { + await nextTick() + } + }, + { immediate: false } +) // 在组件卸载时清理 onBeforeUnmount(() => {