diff --git a/src/views/flow/admin/Defs.vue b/src/views/flow/admin/Defs.vue
index 717571d..55b2f31 100644
--- a/src/views/flow/admin/Defs.vue
+++ b/src/views/flow/admin/Defs.vue
@@ -34,7 +34,13 @@ const columns = [
{ title: "序号", type: "index", width: 70, align: "center" },
{ title: "流程", key: "name", minWidth: 180 },
{ title: "编码", key: "code", width: 160 },
- { title: "应用", key: "appKey", width: 130, align: "center", render: (h: any, p: any) => h("span", p.row.appKey ? (appMap.value[p.row.appKey] || p.row.appKey) : "-") },
+ { title: "应用", key: "appKey", width: 130, align: "center", render: (h: any, p: any) => {
+ // 未归属标记(2026-10-12 appKey 必填化):存量 NULL 线在此醒目,随编辑/升版本收敛
+ if (!p.row.appKey) {
+ return h(Tag, { color: "warning" }, () => "未归属");
+ }
+ return h("span", appMap.value[p.row.appKey] || p.row.appKey);
+ } },
{ title: "版本", key: "version", width: 70, align: "center" },
{ title: "状态", width: 90, align: "center", render: (h: any, p: any) => {
const c = p.row.status === 1 ? "green" : p.row.status === 0 ? "orange" : "gray";
@@ -197,12 +203,17 @@ async function onMetaSave() {
Message.warning("流程名称不能为空");
return;
}
+ // 归属应用必填(2026-10-12 拍板):存量未归属行在此原地补填
+ if (!metaForm.value.appKey) {
+ Message.warning("请选择归属应用(应用需先在 流程管理 > 应用设置 中开启)");
+ return;
+ }
metaSaving.value = true;
try {
await flowApi.defUpdateMeta({
id: metaForm.value.id,
name: metaForm.value.name.trim(),
- appKey: metaForm.value.appKey || undefined,
+ appKey: metaForm.value.appKey,
}).send();
Message.success("已更新(版本不变)");
metaVisible.value = false;
@@ -259,7 +270,7 @@ onMounted(() => {
-
diff --git a/src/views/flow/admin/def-editor/index.vue b/src/views/flow/admin/def-editor/index.vue
index 476c848..3f322a7 100644
--- a/src/views/flow/admin/def-editor/index.vue
+++ b/src/views/flow/admin/def-editor/index.vue
@@ -369,6 +369,12 @@ async function onSave(): Promise {
Message.warning("请填写流程编码");
return;
}
+ // 归属应用必填(2026-10-12 拍板):新建必须选;升版本继承源线(baseGuid 载入时已带回),
+ // 源线未归属(存量 NULL)时必须在此补选
+ if (!(appKey.value || "").trim()) {
+ Message.warning("请选择归属应用(应用需先在 流程管理 > 应用设置 中开启)");
+ return;
+ }
const errors = countErrors(issues.value);
if (errors.length) {
Message.error(`校验未通过:${errors[0].text}`);
@@ -487,8 +493,8 @@ onUnmounted(() => window.removeEventListener("beforeunload", onBeforeUnload));
/>