Skip to content

Commit 54e3814

Browse files
committed
feat(info): 增加搜索框,对文本列进行搜索
1 parent 32b8e84 commit 54e3814

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

os-checks/pages/info.vue

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
<template>
22
<div>
33
<DataTable :value="summaryTable" tableStyle="min-width: 50rem; margin: 10px 10px;" scrollable scrollHeight="800px"
4-
showGridlines selectionMode="single" v-model:selection="selectedPkg">
5-
<!-- <template #header> -->
6-
<!-- <div style="text-align:left"> -->
7-
<!-- <MultiSelect :modelValue="selectedColumns" :options="columns" optionLabel="header" @update:modelValue="onToggle" -->
8-
<!-- display="chip" placeholder="Select Columns" /> -->
9-
<!-- </div> -->
10-
<!-- </template> -->
4+
showGridlines selectionMode="single" v-model:selection="selectedPkg" v-model:filters="filters"
5+
:globalFilterFields="['user', 'repo', 'pkg', 'description', 'categories', 'os_categories']">
6+
7+
<template #header>
8+
<div style="display: flex; justify-content: center">
9+
<div style="width: 50%">
10+
<IconField>
11+
<InputIcon>
12+
<i class="pi pi-search" />
13+
</InputIcon>
14+
<InputText style="width: 100%" v-model="filters['global'].value" placeholder="Global Search" />
15+
</IconField>
16+
</div>
17+
</div>
18+
</template>
19+
1120
<Column frozen field="idx" header="Idx" />
1221
<Column frozen field="user" header="User" style="min-width: 150px;" />
1322
<Column frozen field="repo" header="Repo" style="min-width: 180px;" />
@@ -92,6 +101,12 @@
92101

93102
<script setup lang="ts">
94103
import type { Pkg, PkgInfo, Test } from '~/shared/info';
104+
import { FilterMatchMode } from '@primevue/core/api';
105+
106+
// interactive filter/search inputs
107+
const filters = ref<any>({
108+
global: { value: null, matchMode: FilterMatchMode.CONTAINS },
109+
});
95110
96111
const summaries = ref<PkgInfo[]>([]);
97112
@@ -167,6 +182,8 @@ const summaryTable = computed(() => {
167182
});
168183
});
169184
185+
186+
170187
const dialogShow = ref(false);
171188
const dialogHeader = ref<{ repo: string, repo_url: string, pkg_name: string, pkg: Pkg } | null>();
172189
const testCases = ref<Test[]>([]);

0 commit comments

Comments
 (0)