Skip to content

Commit 746aeaf

Browse files
committed
fix: 创建/修改流程页面-恢复填写流程标识与流程名称才可以切换到第三步逻辑
1 parent 21c28c3 commit 746aeaf

File tree

2 files changed

+17
-25
lines changed

2 files changed

+17
-25
lines changed

src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,3 @@ watch(
245245
}
246246
)
247247
</script>
248-
<style lang="scss">
249-
.process-panel__container {
250-
position: absolute;
251-
top: 90px;
252-
right: 60px;
253-
}
254-
</style>

src/views/bpm/model/CreateUpdate.vue

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -550,34 +550,33 @@ const handleDesignSuccess = (bpmnXml?: string) => {
550550
const handleStepClick = async (index: number) => {
551551
// 如果是切换到第三步(流程设计),需要校验key和name
552552
if (index === 2) {
553-
if (!formData.value.id) {
554-
// 新增时才校验
555-
try {
556-
await formRef.value?.validateField(['key', 'name'])
557-
// 确保数据已经准备好
558-
await nextTick()
559-
} catch (error) {
560-
message.warning('请先填写流程标识和流程名称')
561-
return
562-
}
553+
if (!formData.value.key || !formData.value.name) {
554+
message.warning('请先填写流程标识和流程名称')
555+
return
563556
}
564-
// 确保数据已经准备好再切换
565-
await nextTick()
566557
}
558+
567559
currentStep.value = index
568560
}
569561
570562
// 添加一个计算属性来判断是否显示设计器
571563
const showDesigner = computed(() => {
572-
return currentStep.value === 2 && Boolean(formData.value.id || (formData.value.key && formData.value.name))
564+
return (
565+
currentStep.value === 2 &&
566+
Boolean(formData.value.id || (formData.value.key && formData.value.name))
567+
)
573568
})
574569
575570
// 监听步骤变化,确保数据准备完成
576-
watch(() => currentStep.value, async (newStep) => {
577-
if (newStep === 2) {
578-
await nextTick()
579-
}
580-
}, { immediate: false })
571+
watch(
572+
() => currentStep.value,
573+
async (newStep) => {
574+
if (newStep === 2) {
575+
await nextTick()
576+
}
577+
},
578+
{ immediate: false }
579+
)
581580
582581
// 在组件卸载时清理
583582
onBeforeUnmount(() => {

0 commit comments

Comments
 (0)