feat(def): 归属应用必填化——编辑器保存校验+必选标记,列表未归属标记
build / build (push) Successful in 2m33s

配合后端 save 必填化(2026-10-12 拍板):
- def-editor:保存前校验归属应用非空(新建必选;升版本/存量草稿继承源行,
  源行未归属必须补选),头部 Select 改必选样式
- Defs.vue:应用列存量 NULL 行显示「未归属」橙色 Tag;「编辑信息」弹窗
  归属应用改必填(原地补填通道)
This commit is contained in:
chenxing
2026-10-12 10:44:17 +08:00
parent 9f80630db3
commit 955c1e55f6
2 changed files with 22 additions and 5 deletions
+14 -3
View File
@@ -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(() => {
<Input v-model="metaForm.name" placeholder="流程名称" :maxlength="30" />
</FormItem>
<FormItem label="归属应用">
<Select v-model="metaForm.appKey" clearable filterable placeholder="归属应用,可空">
<Select v-model="metaForm.appKey" filterable placeholder="归属应用(必选)">
<Option v-for="o in metaAppOptions" :key="o.value" :value="o.value">{{ o.label }}</Option>
</Select>
</FormItem>
+8 -2
View File
@@ -369,6 +369,12 @@ async function onSave(): Promise<void> {
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));
/>
</label>
<label>
应用
<Select v-model="appKey" placeholder="归属应用,可空" style="width: 170px" clearable filterable>
应用 <span style="color: #ed4014">*</span>
<Select v-model="appKey" placeholder="归属应用(必选)" style="width: 170px" filterable>
<Option v-for="a in appOptions" :key="a.appKey" :value="a.appKey">{{ a.appName }}</Option>
</Select>
</label>