From d8997bbaddce54dcd825fae9f12eae7ed2b91c81 Mon Sep 17 00:00:00 2001 From: shimingxy Date: Mon, 2 Sep 2024 11:44:36 +0800 Subject: [PATCH] =?UTF-8?q?appCategoryService=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routes/dashboard/home/home.component.html | 35 +++++++++---------- .../routes/dashboard/home/home.component.ts | 9 +++-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.html b/maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.html index eeb089572..fca28c4f8 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.html +++ b/maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.html @@ -1,31 +1,28 @@
- + -
-
- +
+
+ +
+
{{ 'mxk.menu.applist' | i18n }}
-
{{ 'mxk.menu.applist' | i18n }}
-
- - - + + + - + @@ -72,4 +69,4 @@
-
+
\ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.ts b/maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.ts index 57c3c67e3..ba2abd4de 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.ts +++ b/maxkey-web-frontend/maxkey-web-app/src/app/routes/dashboard/home/home.component.ts @@ -118,12 +118,15 @@ export class HomeComponent implements OnInit { }); } - changeCategory(): void { - if (this.appCategoryService.list() === null || this.appCategoryService.list() === '') { + changeCategory(category: String): void { + //console.log(category); + if (this.appCategoryService.list() === null || this.appCategoryService.list() === '' || category === 'All') { this.appList = this.staticAppList; } else { + this.appList = []; for (let i = 0; i < this.staticAppList.length; i++) { - if (this.staticAppList[i].category === this.appCategoryService.list()) { + //console.log(this.staticAppList[i]); + if (this.staticAppList[i].category === this.appsCategory) { this.appList.push(this.staticAppList[i]); } }