修改套餐价格

This commit is contained in:
wuweihua
2026-10-16 10:43:45 +08:00
parent 622d2a4c40
commit 2689138b6a
9 changed files with 572 additions and 277 deletions
@@ -108,6 +108,24 @@ export function nextVersionNo(versions) {
return 'V' + (max + 1)
}
/**
* Latest prior version for Excel build-price preload (exclude current draft).
* Prefer EFFECT, then PENDING, then highest versionSeq.
*/
export function pickLatestPriorVersion(versions, excludePsvId) {
const list = (versions || []).filter(v => {
if (!v || v.psvId == null) return false
if (excludePsvId != null && String(v.psvId) === String(excludePsvId)) return false
return true
})
if (!list.length) return null
const effect = list.find(v => String(v.status) === VER_STATUS.EFFECT)
if (effect) return effect
const pending = list.find(v => String(v.status) === VER_STATUS.PENDING)
if (pending) return pending
return list.slice().sort((a, b) => (Number(b.versionSeq) || 0) - (Number(a.versionSeq) || 0))[0]
}
/** Package status label */
export function setStatusLabel(set) {
if (set && set.expired) return '已过期'