B2 议题二前端:版本历史补全 + 升版本改动说明 + 列表分组 + 在途可见
- Defs.vue 版本历史弹窗 640→820,补 创建人/创建时间/改动说明 三列(存量说明显示「(未填写)」) - def-editor 升版本保存弹「本次改动说明(可跳过)」:doSave 入口设闸(!editId&&baseGuid 或 editId&&sourceStatus!==0),主体抽成 submitSave(changeLog) 防递归;常用类型 chips 分号追加, 500 字上限;跳过与填写两条路径都放行并按说明有无区分 toast;草稿直改不弹不传 - Defs.vue 列表默认分组态(同 flowGuid 折叠一行,代表行=已发布最高版,无已发布标「无生效版」), 展开行复用 rowActions;可切「显示全部版本」回现状平铺 - 在途(议题二④):defList 落位后批量取 distinct flowGuid → 新接口 defInflight, 分组行/平铺 GUID 旁展示「在途 N 件」(0 也展示,接口失败降级「—」);停用确认 N>0 追加在途文案 - flow.ts:defSave 加 changeLog 入参、新增 defInflight(未跑 api:gen,按方案手工改) 验证:npm run build 通过;vue-tsc 1.8.27 与 TS 5.9.3 不兼容无法作门禁(另记)
This commit is contained in:
@@ -100,6 +100,10 @@ const conditionDrawer = ref(false);
|
||||
const settingsDrawer = ref(false);
|
||||
const jsonDrawer = ref(false);
|
||||
const editingUid = ref("");
|
||||
// 议题二③:升版本改动说明弹窗(仅「本次保存将创建新版本」时出现,可跳过)
|
||||
const logModal = ref(false);
|
||||
const logText = ref("");
|
||||
const LOG_CHIPS = ["修复审批人缺失", "调整审批链", "新增抄送对象", "修改条件表达式", "调整流程设置"];
|
||||
|
||||
const editingNode = computed<ApprovalNode | null>(() => {
|
||||
const item = editingUid.value ? findItem(model, editingUid.value) : null;
|
||||
@@ -399,6 +403,28 @@ async function onSave(): Promise<void> {
|
||||
}
|
||||
|
||||
async function doSave(): Promise<void> {
|
||||
// 议题二③:本次保存将复制出新版本行时先问改动说明(挂在 doSave 入口,onSave 与同编码软确认两条路径都经过)
|
||||
if (willCreateVersion()) {
|
||||
logText.value = "";
|
||||
logModal.value = true;
|
||||
return;
|
||||
}
|
||||
await submitSave();
|
||||
}
|
||||
|
||||
/** 升版本判据:baseGuid 入口(列表「升版本」)必带 baseGuid;编辑已发布/停用版会走后端复制升版分支 */
|
||||
function willCreateVersion(): boolean {
|
||||
return (!editId.value && !!baseGuid.value) || (!!editId.value && sourceStatus.value !== 0);
|
||||
}
|
||||
|
||||
/** 常用改动类型点选:追加到说明文本(分号连接),可再手工补充 */
|
||||
function appendLogChip(text: string): void {
|
||||
const cur = logText.value.trim();
|
||||
logText.value = cur ? `${cur};${text}` : text;
|
||||
}
|
||||
|
||||
async function submitSave(changeLog?: string): Promise<void> {
|
||||
logModal.value = false;
|
||||
const content = JSON.stringify(toContentJson(model));
|
||||
saving.value = true;
|
||||
try {
|
||||
@@ -410,9 +436,12 @@ async function doSave(): Promise<void> {
|
||||
contentJson: content,
|
||||
baseGuid: baseGuid.value || undefined,
|
||||
appKey: (appKey.value || "").trim() || undefined,
|
||||
changeLog: changeLog || undefined,
|
||||
}).send();
|
||||
savedSnapshot.value = currentSnapshot.value;
|
||||
Message.success("已保存草稿");
|
||||
Message.success(willCreateVersion()
|
||||
? (changeLog ? "已保存草稿 · 改动说明已留存" : "已保存草稿(未填写改动说明)")
|
||||
: "已保存草稿");
|
||||
router.push("/admin/defs");
|
||||
} finally {
|
||||
saving.value = false;
|
||||
@@ -534,6 +563,25 @@ onUnmounted(() => window.removeEventListener("beforeunload", onBeforeUnload));
|
||||
<ConditionDrawer v-model="conditionDrawer" :node="editingCondition" @removed="conditionDrawer = false" />
|
||||
<SettingsDrawer v-model="settingsDrawer" :settings="model.settings" @save="onUrgeSave" />
|
||||
<JsonDrawer v-model="jsonDrawer" :def="defJson" @applied="onJsonApplied" />
|
||||
|
||||
<!-- 议题二③:升版本改动说明(仅「本次保存将创建新版本」时出现,跳过也放行) -->
|
||||
<Modal v-model="logModal" title="保存为新版本草稿" :mask-closable="false" width="520">
|
||||
<p class="cl-note">
|
||||
当前为「升版本 · 基于 v{{ sourceVersion }}({{ DEF_STATUS[sourceStatus] }})」,
|
||||
保存将创建新版本草稿(flowGuid 不变,版本号自动 +1)。
|
||||
</p>
|
||||
<div class="cl-label">本次改动说明<span class="cl-skip">可跳过</span></div>
|
||||
<div class="cl-chips">
|
||||
<span v-for="c in LOG_CHIPS" :key="c" class="cl-chip" @click="appendLogChip(c)">{{ c }}</span>
|
||||
</div>
|
||||
<Input v-model="logText" type="textarea" :rows="3" :maxlength="500" show-word-limit
|
||||
placeholder="一句话说清本版改了什么,如:教务处节点补充审批人配置;版本历史与列表可见" />
|
||||
<template #footer>
|
||||
<span class="cl-hint">跳过也允许保存——但「多一条记录」的区分度就没了</span>
|
||||
<Button :disabled="saving" @click="submitSave()">跳过</Button>
|
||||
<Button type="primary" :loading="saving" @click="submitSave(logText.trim())">保存草稿</Button>
|
||||
</template>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -660,4 +708,52 @@ onUnmounted(() => window.removeEventListener("beforeunload", onBeforeUnload));
|
||||
color: #b0b6c1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
/* 升版本改动说明弹窗(议题二③,规格对齐原型 V2) */
|
||||
.cl-note {
|
||||
background: #fff7e6;
|
||||
border: 1px solid #ffd77a;
|
||||
border-radius: 6px;
|
||||
padding: 9px 12px;
|
||||
font-size: 12px;
|
||||
color: #8a5a17;
|
||||
line-height: 1.7;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.cl-label {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #17233d;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.cl-skip {
|
||||
font-weight: 400;
|
||||
color: #808695;
|
||||
font-size: 12px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
.cl-chips {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.cl-chip {
|
||||
border: 1px solid #e3e6eb;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 3px 11px;
|
||||
font-size: 12px;
|
||||
color: #515a6e;
|
||||
cursor: pointer;
|
||||
}
|
||||
.cl-chip:hover {
|
||||
border-color: var(--brand);
|
||||
color: var(--brand);
|
||||
}
|
||||
.cl-hint {
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
color: #b0b6c1;
|
||||
line-height: 32px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user