fix: 创建/修改流程页面-恢复填写流程标识与流程名称才可以切换到第三步逻辑
parent
21c28c3665
commit
746aeaff35
|
@ -245,10 +245,3 @@ watch(
|
|||
}
|
||||
)
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.process-panel__container {
|
||||
position: absolute;
|
||||
top: 90px;
|
||||
right: 60px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
Loading…
Reference in New Issue