Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
577271e7
Commit
577271e7
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
Make table virtual for list systems
parent
b3e5bae3
No related branches found
No related tags found
1 merge request
!13
Resolve "Add refseq table results"
Pipeline
#112352
failed with stages
in 3 minutes and 14 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/content/ListSystems.vue
+60
-35
60 additions, 35 deletions
components/content/ListSystems.vue
with
60 additions
and
35 deletions
components/content/ListSystems.vue
+
60
−
35
View file @
577271e7
<
script
setup
lang=
"ts"
>
const
props
=
defineProps
<
{
headers
:
Array
<
Object
>
systems
:
Array
<
Object
>
headers
:
Array
<
Object
>
;
systems
:
Array
<
Object
>
;
}
>
();
const
itemsPerParge
=
ref
(
25
)
const
search
=
ref
(
''
)
const
sortBy
=
ref
([{
key
:
'
system
'
,
order
:
'
asc
'
}])
const
itemsPerParge
=
ref
(
25
)
;
const
search
=
ref
(
""
);
const
sortBy
=
ref
([{
key
:
"
system
"
,
order
:
"
asc
"
}])
;
function
filterOnlyCapsText
(
value
,
query
,
item
)
{
if
(
value
!=
null
&&
query
!=
null
)
{
if
(
typeof
value
===
'
string
'
)
{
return
value
.
toString
().
toLowerCase
().
indexOf
(
query
.
toLowerCase
())
!==
-
1
}
if
(
typeof
value
==
'
object
'
)
{
if
(
value
?.
name
)
{
return
value
.
name
.
toString
().
toLowerCase
().
indexOf
(
query
.
toLowerCase
())
!==
-
1
}
}
if
(
value
!=
null
&&
query
!=
null
)
{
if
(
typeof
value
===
"
string
"
)
{
return
value
.
toString
().
toLowerCase
().
indexOf
(
query
.
toLowerCase
())
!==
-
1
;
}
if
(
typeof
value
==
"
object
"
)
{
if
(
value
?.
name
)
{
return
(
value
.
name
.
toString
().
toLowerCase
().
indexOf
(
query
.
toLowerCase
())
!==
-
1
);
}
}
return
false
}
return
false
;
}
</
script
>
<
template
>
<v-card
flat
color=
"transparent"
class=
"my-5"
>
<v-toolbar>
<v-toolbar-title>
Defense Systems
</v-toolbar-title>
<v-card
flat
color=
"transparent"
class=
"my-5"
>
<v-toolbar>
<v-toolbar-title>
Defense Systems
</v-toolbar-title>
<v-text-field
v-model=
"search"
density=
"compact"
variant=
"underlined"
prepend-inner-icon=
"mdi-magnify"
label=
"Search for defense systems"
single-line
hide-details
class=
"mx-2"
clearable
></v-text-field>
</v-toolbar>
<v-data-table
:items-per-page=
"itemsPerParge"
v-model:sort-by=
"sortBy"
:headers=
"props.headers"
density=
"compact"
:custom-filter=
"filterOnlyCapsText"
:items=
"props.systems"
:search=
"search"
>
<template
#
[`
item.system
`
]=
"
{ item }">
<v-chip
variant=
"text"
link
:to=
"`$
{item.columns.system.path}`">
{{
item
.
columns
.
system
.
name
}}
</v-chip>
</
template
>
<
template
#
[`
item.article
`
]=
"{ item }"
>
<ArticleDoi
v-if=
"item.columns?.article"
:doi=
"item.columns.article.doi"
:title=
"item.columns.article?.title"
:abstract=
"item.columns.article?.abstract"
:divider=
"false"
:enumerate=
"false"
/>
</
template
>
</v-data-table>
</v-card>
<v-text-field
v-model=
"search"
density=
"compact"
variant=
"underlined"
prepend-inner-icon=
"mdi-magnify"
label=
"Search for defense systems"
single-line
hide-details
class=
"mx-2"
clearable
></v-text-field>
</v-toolbar>
<v-data-table-virtual
height=
"800"
:items-per-page=
"itemsPerParge"
v-model:sort-by=
"sortBy"
:headers=
"props.headers"
density=
"compact"
:custom-filter=
"filterOnlyCapsText"
:items=
"props.systems"
:search=
"search"
>
<template
#
[`
item.system
`
]=
"
{ item }">
<v-chip
variant=
"text"
link
:to=
"`$
{item.columns.system.path}`">
{{
item
.
columns
.
system
.
name
}}
</v-chip>
</
template
>
<
template
#
[`
item.article
`
]=
"{ item }"
>
<ArticleDoi
v-if=
"item.columns?.article"
:doi=
"item.columns.article.doi"
:title=
"item.columns.article?.title"
:abstract=
"item.columns.article?.abstract"
:divider=
"false"
:enumerate=
"false"
/>
</
template
>
</v-data-table-virtual>
</v-card>
</template>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment