mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-06-19 23:02:00 +08:00
fix: 创建/修改流程页面-恢复填写流程标识与流程名称才可以切换到第三步逻辑
This commit is contained in:
parent
21c28c3665
commit
746aeaff35
@ -245,10 +245,3 @@ watch(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
</script>
|
</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) => {
|
const handleStepClick = async (index: number) => {
|
||||||
// 如果是切换到第三步(流程设计),需要校验key和name
|
// 如果是切换到第三步(流程设计),需要校验key和name
|
||||||
if (index === 2) {
|
if (index === 2) {
|
||||||
if (!formData.value.id) {
|
if (!formData.value.key || !formData.value.name) {
|
||||||
// 新增时才校验
|
|
||||||
try {
|
|
||||||
await formRef.value?.validateField(['key', 'name'])
|
|
||||||
// 确保数据已经准备好
|
|
||||||
await nextTick()
|
|
||||||
} catch (error) {
|
|
||||||
message.warning('请先填写流程标识和流程名称')
|
message.warning('请先填写流程标识和流程名称')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 确保数据已经准备好再切换
|
|
||||||
await nextTick()
|
|
||||||
}
|
|
||||||
currentStep.value = index
|
currentStep.value = index
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加一个计算属性来判断是否显示设计器
|
// 添加一个计算属性来判断是否显示设计器
|
||||||
const showDesigner = computed(() => {
|
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) => {
|
watch(
|
||||||
|
() => currentStep.value,
|
||||||
|
async (newStep) => {
|
||||||
if (newStep === 2) {
|
if (newStep === 2) {
|
||||||
await nextTick()
|
await nextTick()
|
||||||
}
|
}
|
||||||
}, { immediate: false })
|
},
|
||||||
|
{ immediate: false }
|
||||||
|
)
|
||||||
|
|
||||||
// 在组件卸载时清理
|
// 在组件卸载时清理
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user