Skip to content
Snippets Groups Projects
Commit 363df2aa authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

predicted structures use ServerDbTable

parent 34bcdd6e
No related branches found
No related tags found
2 merge requests!131Merge relevant Abstract and references,!123Resolve "Wizzard to create db filters"
Pipeline #117330 failed
...@@ -206,7 +206,8 @@ const operatorItems = ref([ ...@@ -206,7 +206,8 @@ const operatorItems = ref([
type: "operator", type: "operator",
deletable: false deletable: false
} }
} },
]) ])
const autocompleteItems = computed(() => { const autocompleteItems = computed(() => {
...@@ -314,8 +315,6 @@ function runTextSearch() { ...@@ -314,8 +315,6 @@ function runTextSearch() {
filterOrSearch.value = [item] filterOrSearch.value = [item]
} }
search.value = "" search.value = ""
console.log(filterOrSearch.value.length)
console.log(filterOrSearch.value)
searchOrFilter() searchOrFilter()
} }
} }
...@@ -323,32 +322,39 @@ function runTextSearch() { ...@@ -323,32 +322,39 @@ function runTextSearch() {
</script> </script>
<template> <template>
<v-card flat> <v-card flat>
<v-toolbar> <v-toolbar floating color="transparent">
<v-autocomplete ref="autocompleteInput" v-model:search="search" v-model:model-value="filterOrSearch"
auto-select-first chips clearable label="Search or filter results..." :items="autocompleteItems" <v-col cols="5">
item-value="value" item-title="title" multiple return-object append-inner-icon="md:search" <v-text-field label="Search..." hide-details prepend-inner-icon="mdi-magnify" single-line></v-text-field>
@click:appendInner="searchOrFilter" @click:clear="clearFilterOrSearch" </v-col>
@update:modelValue="() => clearSearch()"> <v-col>
<template #chip="{ props, item, index }"> <v-autocomplete ref="autocompleteInput" hide-details single-line v-model:search="search"
v-model:model-value="filterOrSearch" auto-select-first chips clearable label="Filter results..."
:items="autocompleteItems" item-value="value" item-title="title" multiple return-object
<v-chip v-bind="props" :text="item.raw.title" :closable="item.props.deletable" append-inner-icon="md:search" @click:appendInner="searchOrFilter" @click:clear="clearFilterOrSearch"
@click:close="item.props.type === 'text' ? deleteTextFilter(index) : deleteOneFilter(index)"></v-chip> @update:modelValue="() => clearSearch()">
<!-- <v-chip v-if="(index + 1) % 3 === 0" v-bind="props" :text="item.raw.title" closable <template #chip="{ props, item, index }">
<v-chip v-bind="props" :text="item.raw.title" :closable="item.props.deletable"
@click:close="item.props.type === 'text' ? deleteTextFilter(index) : deleteOneFilter(index)"></v-chip>
<!-- <v-chip v-if="(index + 1) % 3 === 0" v-bind="props" :text="item.raw.title" closable
@click:close="deleteOneFilter(index)"></v-chip> @click:close="deleteOneFilter(index)"></v-chip>
<v-chip v-else v-bind="props" :text="item.raw.title"></v-chip> --> <v-chip v-else v-bind="props" :text="item.raw.title"></v-chip> -->
</template> </template>
<template #item="{ props, item }"> <template #item="{ props, item }">
<v-list-item v-bind="{ ...props, active: false, onClick: () => selectItem(item) }" :title="item.title" <v-list-item v-bind="{ ...props, active: false, onClick: () => selectItem(item) }"
:subtitle="item.raw?.count ? item.raw.count : ''" :value="props.value"> :title="item.title" :subtitle="item.raw?.count ? item.raw.count : ''" :value="props.value">
</v-list-item> </v-list-item>
</template> </template>
<!-- <template #no-data></template> <!-- <template #no-data></template>
<template #prepend-item> <template #prepend-item>
<v-list-item v-if="canAddTextSearch" :title="`Text search: ${search}`" @click="runTextSearch"> </v-list-item> <v-list-item v-if="canAddTextSearch" :title="`Text search: ${search}`" @click="runTextSearch"> </v-list-item>
</template> --> </template> -->
</v-autocomplete> </v-autocomplete>
</v-col>
</v-toolbar> </v-toolbar>
<v-data-table-server v-if="!msError" v-model:page="reactiveParams.page" <v-data-table-server v-if="!msError" v-model:page="reactiveParams.page"
v-model:items-per-page="reactiveParams.hitsPerPage" v-model:sortBy="sortByRef" fixed-header :loading="loading" v-model:items-per-page="reactiveParams.hitsPerPage" v-model:sortBy="sortByRef" fixed-header :loading="loading"
......
<script setup lang="ts">
import { useFacetsStore } from '~~/stores/facets'
const sortBy: Ref<{ key: string, order: string }[]> = ref([{ key: 'system', order: "asc" }])
const itemValue = ref("id");
const facets = ref(["system", "completed",
"plddts",])
const headers: Ref<Object[]> = ref([
{ title: "System", key: "system" },
{ title: "Completed", key: "completed" },
{ title: "Predition type", key: "prediction_type" },
{ title: "Num of genes", key: "system_number_of_genes" },
{ title: "pLDDT", key: "plddts" },
{ title: "Type", key: "type" }
])
</script>
<template>
<ServerDbTable title="Predicted Strucutres" db="structure" :sortBy="sortBy" :headers="computedHeaders"
:item-value="itemValue" :facets="facets">
</ServerDbTable>
</template>
\ No newline at end of file
...@@ -3,3 +3,8 @@ layout: db ...@@ -3,3 +3,8 @@ layout: db
navigation: false navigation: false
--- ---
# Predicted Structures
::structure-db
::
\ No newline at end of file
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment