修改套餐价格
This commit is contained in:
@@ -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 '已过期'
|
||||
|
||||
Reference in New Issue
Block a user