fix(table): sort tasks by index instead of id
This commit is contained in:
parent
c2dd18edaa
commit
b98d9fb7ec
@ -15,7 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #content="{isOpen}">
|
<template #content="{isOpen}">
|
||||||
<card class="columns-filter" :class="{'is-open': isOpen}">
|
<card class="columns-filter" :class="{'is-open': isOpen}">
|
||||||
<fancycheckbox v-model="activeColumns.id">#</fancycheckbox>
|
<fancycheckbox v-model="activeColumns.index">#</fancycheckbox>
|
||||||
<fancycheckbox v-model="activeColumns.done">
|
<fancycheckbox v-model="activeColumns.done">
|
||||||
{{ $t('task.attributes.done') }}
|
{{ $t('task.attributes.done') }}
|
||||||
</fancycheckbox>
|
</fancycheckbox>
|
||||||
@ -67,9 +67,9 @@
|
|||||||
<table class="table has-actions is-hoverable is-fullwidth mb-0">
|
<table class="table has-actions is-hoverable is-fullwidth mb-0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th v-if="activeColumns.id">
|
<th v-if="activeColumns.index">
|
||||||
#
|
#
|
||||||
<Sort :order="sortBy.id" @click="sort('id')"/>
|
<Sort :order="sortBy.index" @click="sort('index')"/>
|
||||||
</th>
|
</th>
|
||||||
<th v-if="activeColumns.done">
|
<th v-if="activeColumns.done">
|
||||||
{{ $t('task.attributes.done') }}
|
{{ $t('task.attributes.done') }}
|
||||||
@ -120,7 +120,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr :key="t.id" v-for="t in tasks">
|
<tr :key="t.id" v-for="t in tasks">
|
||||||
<td v-if="activeColumns.id">
|
<td v-if="activeColumns.index">
|
||||||
<router-link :to="taskDetailRoutes[t.id]">
|
<router-link :to="taskDetailRoutes[t.id]">
|
||||||
<template v-if="t.identifier === ''">
|
<template v-if="t.identifier === ''">
|
||||||
#{{ t.index }}
|
#{{ t.index }}
|
||||||
@ -200,7 +200,7 @@ import {useTaskList} from '@/composables/useTaskList'
|
|||||||
import type {ITask} from '@/modelTypes/ITask'
|
import type {ITask} from '@/modelTypes/ITask'
|
||||||
|
|
||||||
const ACTIVE_COLUMNS_DEFAULT = {
|
const ACTIVE_COLUMNS_DEFAULT = {
|
||||||
id: true,
|
index: true,
|
||||||
done: true,
|
done: true,
|
||||||
title: true,
|
title: true,
|
||||||
priority: false,
|
priority: false,
|
||||||
@ -225,7 +225,7 @@ const props = defineProps({
|
|||||||
type Order = 'asc' | 'desc' | 'none'
|
type Order = 'asc' | 'desc' | 'none'
|
||||||
|
|
||||||
interface SortBy {
|
interface SortBy {
|
||||||
id: Order
|
index: Order
|
||||||
done?: Order
|
done?: Order
|
||||||
title?: Order
|
title?: Order
|
||||||
priority?: Order
|
priority?: Order
|
||||||
@ -238,7 +238,7 @@ interface SortBy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SORT_BY_DEFAULT: SortBy = {
|
const SORT_BY_DEFAULT: SortBy = {
|
||||||
id: 'desc',
|
index: 'desc',
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeColumns = useStorage('tableViewColumns', {...ACTIVE_COLUMNS_DEFAULT})
|
const activeColumns = useStorage('tableViewColumns', {...ACTIVE_COLUMNS_DEFAULT})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user