tuqin
6 天以前 b681ee4ca75d50d09eb6344131c42194b37f6876
fix(bpm): 修复流程模型第三步流程设计页面空白

现象:新建模型进入第三步「流程设计」时页面空白。

根因:process-design.vue 里 showDesigner 判定为
Boolean(modelData.key && modelData.name),
即必须同时填写流程标识 key 和流程名称 name 才显示设计器。
而简易设计器(Simple 类型)其实只需要流程名称,不需要 key,
一旦 key 未填,整块设计器区域直接空白。

修复:
- showDesigner 改为:简易设计器只需流程名称;BPMN 设计器仍要求 key+name。
- 未填写流程名称时显示提示文案,避免出现纯空白页。
已修改1个文件
19 ■■■■■ 文件已修改
src/views/bpm/model/form/modules/process-design.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/bpm/model/form/modules/process-design.vue
@@ -4,6 +4,7 @@
import { computed, inject, nextTick, ref } from 'vue';
import { BpmModelType } from '@vben/constants';
import { IconifyIcon } from '@vben/icons';
import BpmModelEditor from './bpm-model-editor.vue';
import SimpleModelDesign from './simple-model-design.vue';
@@ -47,7 +48,15 @@
/** 是否显示设计器 */
const showDesigner = computed(() => {
  return Boolean(modelData.value?.key && modelData.value?.name);
  const data = modelData.value;
  if (!data?.name) {
    return false;
  }
  // BPMN 设计器需要流程标识 key;简易设计器只需要流程名称
  if (data.type === BpmModelType.BPMN) {
    return Boolean(data.key);
  }
  return true;
});
defineExpose({ validate });
@@ -77,5 +86,13 @@
        ref="simpleDesign"
      />
    </template>
    <!-- 未填写流程名称时给出提示,避免页面空白 -->
    <div
      v-if="!showDesigner"
      class="flex h-64 flex-col items-center justify-center gap-2 text-gray-400"
    >
      <IconifyIcon icon="lucide:info" class="size-8" />
      <span>请先在「基本信息」中填写流程名称,再进行流程设计</span>
    </div>
  </div>
</template>