新增按版本获取价格设置明细的接口,优化产品下拉选项查询,更新相关服务和前端调用逻辑。
This commit is contained in:
@@ -123,9 +123,21 @@ function toEffMs(v) {
|
||||
return Number.isNaN(t) ? NaN : t
|
||||
}
|
||||
|
||||
/** Sort by effective time descending; drafts without time last. */
|
||||
function sortByEffectiveTime(list) {
|
||||
/** draft / pending first, then effect, then expired; within group by effective time desc. */
|
||||
function statusRank(v) {
|
||||
const s = String(v && v.status != null ? v.status : '')
|
||||
if (s === '0') return 0
|
||||
if (s === '3') return 1
|
||||
if (s === '1') return 2
|
||||
if (s === '2') return 3
|
||||
return 9
|
||||
}
|
||||
|
||||
function sortVersions(list) {
|
||||
return (list || []).slice().sort((a, b) => {
|
||||
const ra = statusRank(a)
|
||||
const rb = statusRank(b)
|
||||
if (ra !== rb) return ra - rb
|
||||
const ta = toEffMs(a)
|
||||
const tb = toEffMs(b)
|
||||
const aNull = Number.isNaN(ta)
|
||||
@@ -143,7 +155,7 @@ const filteredVersions = computed(() => {
|
||||
const filtered = statusTab.value === 'all'
|
||||
? list
|
||||
: list.filter(v => String(v.status) === statusTab.value)
|
||||
return sortByEffectiveTime(filtered)
|
||||
return sortVersions(filtered)
|
||||
})
|
||||
|
||||
function detailCount(row) {
|
||||
|
||||
Reference in New Issue
Block a user