mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 18:34:50 +08:00
改进排序
This commit is contained in:
@@ -56,9 +56,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
sort-by="['group', 'name']"
|
||||
sortable
|
||||
:sort-method="sortByGroup"
|
||||
:sort-method="(a , b) => sortByLocaleCompare(a.group, b.group)"
|
||||
prop="group"
|
||||
label="分组"
|
||||
:filters="getFilters"
|
||||
@@ -185,8 +184,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
|
||||
sortByGroup (a, b) {
|
||||
return a.group.localeCompare(b.group, 'zh')
|
||||
sortByLocaleCompare (a, b) {
|
||||
return a.localeCompare(b, 'zh')
|
||||
},
|
||||
selectionCellClick (selection, row) {
|
||||
if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
@sort-change="handleSortChange">
|
||||
<el-table-column
|
||||
sortable
|
||||
:sort-method="sortByName"
|
||||
:sort-method="(a , b) => sortByLocaleCompare(a.name, b.name)"
|
||||
prop="name"
|
||||
label="片名">
|
||||
</el-table-column>
|
||||
@@ -30,9 +30,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:sort-by="['detail.type', 'name']"
|
||||
sortable
|
||||
:sort-method="sortByType"
|
||||
:sort-method="(a , b) => sortByLocaleCompare(a.detail.type, b.detail.type)"
|
||||
prop="detail.type"
|
||||
label="类型"
|
||||
width="100">
|
||||
@@ -51,6 +50,8 @@
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="list.some(e => e.rate)"
|
||||
sortable
|
||||
sort-by="rate"
|
||||
prop="rate"
|
||||
width="120"
|
||||
label="豆瓣评分">
|
||||
@@ -206,11 +207,8 @@ export default {
|
||||
handleSortChange (column, prop, order) {
|
||||
this.updateDatabase()
|
||||
},
|
||||
sortByName (a, b) {
|
||||
return a.name.localeCompare(b.name, 'zh')
|
||||
},
|
||||
sortByType (a, b) {
|
||||
return a.type.localeCompare(b.type)
|
||||
sortByLocaleCompare (a, b) {
|
||||
return a.localeCompare(b, 'zh')
|
||||
},
|
||||
detailEvent (e) {
|
||||
this.detail = {
|
||||
|
||||
Reference in New Issue
Block a user