修复歌曲排序描述

pull/733/head
lyswhut 2021-12-10 20:28:04 +08:00
parent cb5e1bd795
commit 650edc1b1e
1 changed files with 9 additions and 9 deletions

View File

@ -32,14 +32,14 @@
<section> <section>
<h3 :class="$style.title">{{$t('list_sort_modal_by_type')}}</h3> <h3 :class="$style.title">{{$t('list_sort_modal_by_type')}}</h3>
<ul :class="$style.list"> <ul :class="$style.list">
<li :class="$style.listItem">
<base-checkbox id="list_sort_modal_type_down" name="list_sort_modal_type" need="need"
v-model="sortType" value="down" :label="$t('list_sort_modal_by_down')" />
</li>
<li :class="$style.listItem"> <li :class="$style.listItem">
<base-checkbox id="list_sort_modal_type_up" name="list_sort_modal_type" need="need" <base-checkbox id="list_sort_modal_type_up" name="list_sort_modal_type" need="need"
v-model="sortType" value="up" :label="$t('list_sort_modal_by_up')" /> v-model="sortType" value="up" :label="$t('list_sort_modal_by_up')" />
</li> </li>
<li :class="$style.listItem">
<base-checkbox id="list_sort_modal_type_down" name="list_sort_modal_type" need="need"
v-model="sortType" value="down" :label="$t('list_sort_modal_by_down')" />
</li>
</ul> </ul>
</section> </section>
<div :class="$style.footer"> <div :class="$style.footer">
@ -122,12 +122,12 @@ export default {
break break
} }
console.log(sortType.value, sortField.value) console.log(sortType.value, sortField.value)
if (sortType.value == 'down') { if (sortType.value == 'up') {
if (fieldName == 'interval') { if (fieldName == 'interval') {
list.sort((a, b) => { list.sort((a, b) => {
if (a.interval == null) { if (a.interval == null) {
return b.interval == null ? 0 : 1 return b.interval == null ? 0 : -1
} else return b.interval == null ? -1 : getIntv(b) - getIntv(a) } else return b.interval == null ? 1 : getIntv(a) - getIntv(b)
}) })
} else { } else {
list.sort((a, b) => { list.sort((a, b) => {
@ -140,8 +140,8 @@ export default {
if (fieldName == 'interval') { if (fieldName == 'interval') {
list.sort((a, b) => { list.sort((a, b) => {
if (a.interval == null) { if (a.interval == null) {
return b.interval == null ? 0 : -1 return b.interval == null ? 0 : 1
} else return b.interval == null ? 1 : getIntv(a) - getIntv(b) } else return b.interval == null ? -1 : getIntv(b) - getIntv(a)
}) })
} else { } else {
list.sort((a, b) => { list.sort((a, b) => {