fix: 引入 normalizeRateBound 标准化倍率空输入,解决输入清空后过滤失效的问题
This commit is contained in:
@@ -1296,6 +1296,12 @@ const upstreamCounts = computed(() => {
|
|||||||
return counts
|
return counts
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function normalizeRateBound(value: unknown): number | null {
|
||||||
|
if (value === null || value === undefined || value === '') return null
|
||||||
|
const parsed = Number(value)
|
||||||
|
return Number.isFinite(parsed) ? parsed : null
|
||||||
|
}
|
||||||
|
|
||||||
const filteredGroupsForModal = computed(() => {
|
const filteredGroupsForModal = computed(() => {
|
||||||
const query = groupSearchQuery.value.trim().toLowerCase()
|
const query = groupSearchQuery.value.trim().toLowerCase()
|
||||||
return upstreamGroupOptions.value.filter(item => {
|
return upstreamGroupOptions.value.filter(item => {
|
||||||
@@ -1314,8 +1320,8 @@ const filteredGroupsForModal = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 倍率范围过滤
|
// 3. 倍率范围过滤
|
||||||
const min = groupRateMin.value
|
const min = normalizeRateBound(groupRateMin.value)
|
||||||
const max = groupRateMax.value
|
const max = normalizeRateBound(groupRateMax.value)
|
||||||
if (min !== null || max !== null) {
|
if (min !== null || max !== null) {
|
||||||
const rateVal = parseFloat(String(item.rate))
|
const rateVal = parseFloat(String(item.rate))
|
||||||
if (isNaN(rateVal)) {
|
if (isNaN(rateVal)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user