diff --git a/src/views/dashboard/List.vue b/src/views/dashboard/List.vue
index a2fc85b7..dd84e4bd 100644
--- a/src/views/dashboard/List.vue
+++ b/src/views/dashboard/List.vue
@@ -117,6 +117,17 @@ limitations under the License. -->
{{ t("import") }}
+
@@ -137,6 +148,7 @@ import { EntityType } from "./data";
const { t } = useI18n();
const appStore = useAppStoreWithOut();
const dashboardStore = useDashboardStore();
+const pageSize = 18;
const dashboards = ref([]);
const searchText = ref("");
const loading = ref(false);
@@ -151,7 +163,7 @@ const handleSelectionChange = (val: DashboardItem[]) => {
setList();
async function setList() {
await dashboardStore.setDashboards();
- dashboards.value = dashboardStore.dashboards;
+ searchDashboards();
}
async function importTemplates(event: any) {
const arr: any = await readFile(event);
@@ -361,16 +373,20 @@ async function handleDelete(row: DashboardItem) {
sessionStorage.setItem("dashboards", JSON.stringify(dashboards.value));
sessionStorage.removeItem(`${row.layer}_${row.entity}_${row.name}`);
}
-function searchDashboards() {
+function searchDashboards(pageIndex?: number) {
const list = JSON.parse(sessionStorage.getItem("dashboards") || "[]");
- dashboards.value = list.filter((d: { name: string }) =>
+ const arr = list.filter((d: { name: string }) =>
d.name.includes(searchText.value)
);
+ dashboards.value = arr.splice(pageIndex || 0, pageSize);
}
function reloadTemplates() {
dashboardStore.resetTemplates();
}
+function changePage(pageIndex: number) {
+ searchDashboards(pageIndex);
+}