|
|
@ -3,13 +3,15 @@ |
|
|
|
:value="value" |
|
|
|
:headers="headers" |
|
|
|
:items="items" |
|
|
|
:options.sync="options" |
|
|
|
:server-items-length="total" |
|
|
|
:search="search" |
|
|
|
:loading="isLoading" |
|
|
|
:loading-text="$t('generic.loading')" |
|
|
|
:no-data-text="$t('vuetify.noDataAvailable')" |
|
|
|
:footer-props="{ |
|
|
|
'showFirstLastPage': true, |
|
|
|
'items-per-page-options': [5, 10, 15, 100], |
|
|
|
'items-per-page-options': [10, 50, 100], |
|
|
|
'items-per-page-text': $t('vuetify.itemsPerPageText'), |
|
|
|
'page-text': $t('dataset.pageText') |
|
|
|
}" |
|
|
@ -30,6 +32,8 @@ |
|
|
|
filled |
|
|
|
/> |
|
|
|
</template> |
|
|
|
<!-- |
|
|
|
Tempolary removing due to the performance |
|
|
|
<template #[`item.action`]="{ item }"> |
|
|
|
<v-btn |
|
|
|
small |
|
|
@ -38,17 +42,17 @@ |
|
|
|
> |
|
|
|
{{ $t('dataset.annotate') }} |
|
|
|
</v-btn> |
|
|
|
</template> |
|
|
|
</template> --> |
|
|
|
</v-data-table> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
import Vue, { PropType } from 'vue' |
|
|
|
import { mdiMagnify } from '@mdi/js' |
|
|
|
import { DataOptions } from 'vuetify/types' |
|
|
|
import VueFilterDateFormat from '@vuejs-community/vue-filter-date-format' |
|
|
|
import VueFilterDateParse from '@vuejs-community/vue-filter-date-parse' |
|
|
|
import { CommentReadDTO } from '~/services/application/comment/commentData' |
|
|
|
import { ExampleDTO } from '~/services/application/example/exampleData' |
|
|
|
Vue.use(VueFilterDateFormat) |
|
|
|
Vue.use(VueFilterDateParse) |
|
|
|
|
|
|
@ -59,11 +63,6 @@ export default Vue.extend({ |
|
|
|
default: false, |
|
|
|
required: true |
|
|
|
}, |
|
|
|
examples: { |
|
|
|
type: Array as PropType<ExampleDTO[]>, |
|
|
|
default: () => [], |
|
|
|
required: true |
|
|
|
}, |
|
|
|
items: { |
|
|
|
type: Array as PropType<CommentReadDTO[]>, |
|
|
|
default: () => [], |
|
|
@ -73,12 +72,18 @@ export default Vue.extend({ |
|
|
|
type: Array as PropType<CommentReadDTO[]>, |
|
|
|
default: () => [], |
|
|
|
required: true |
|
|
|
}, |
|
|
|
total: { |
|
|
|
type: Number, |
|
|
|
default: 0, |
|
|
|
required: true |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
data() { |
|
|
|
return { |
|
|
|
search: '', |
|
|
|
options: {} as DataOptions, |
|
|
|
headers: [ |
|
|
|
{ text: this.$t('dataset.text'), value: 'text' }, |
|
|
|
{ text: this.$t('user.username'), value: 'username' }, |
|
|
@ -89,12 +94,37 @@ export default Vue.extend({ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
toLabeling(item: CommentReadDTO) { |
|
|
|
const index = this.examples.findIndex((example: ExampleDTO) => example.id === item.example) |
|
|
|
const page = (index + 1).toString() |
|
|
|
this.$emit('click:labeling', { page, q: this.search }) |
|
|
|
watch: { |
|
|
|
options: { |
|
|
|
handler() { |
|
|
|
this.$emit('update:query', { |
|
|
|
query: { |
|
|
|
limit: this.options.itemsPerPage.toString(), |
|
|
|
offset: ((this.options.page - 1) * this.options.itemsPerPage).toString(), |
|
|
|
q: this.search |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
deep: true |
|
|
|
}, |
|
|
|
search() { |
|
|
|
this.$emit('update:query', { |
|
|
|
query: { |
|
|
|
limit: this.options.itemsPerPage.toString(), |
|
|
|
offset: '0', |
|
|
|
q: this.search |
|
|
|
} |
|
|
|
}) |
|
|
|
this.options.page = 1 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// methods: { |
|
|
|
// toLabeling(item: CommentReadDTO) { |
|
|
|
// const index = this.examples.findIndex((example: ExampleDTO) => example.id === item.example) |
|
|
|
// const page = (index + 1).toString() |
|
|
|
// this.$emit('click:labeling', { page, q: this.search }) |
|
|
|
// } |
|
|
|
// } |
|
|
|
}) |
|
|
|
</script> |