From bcb44b892d54d7ecac908d5d445cfa31d2c3a3a8 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Sun, 29 May 2022 21:22:37 +0800 Subject: [PATCH] perf: improve sheets management page ui Signed-off-by: Ryan Wang --- src/core/icons.ts | 5 +- src/views/contents/posts/PostList.vue | 2 +- src/views/contents/sheets/SheetList.vue | 345 +++++++++++++++++------- src/views/system/users/UserList.vue | 21 +- 4 files changed, 265 insertions(+), 108 deletions(-) diff --git a/src/core/icons.ts b/src/core/icons.ts index b7b9f517..50f659a9 100644 --- a/src/core/icons.ts +++ b/src/core/icons.ts @@ -65,6 +65,8 @@ import IconComputer from "~icons/ri/computer-line"; import IconPhone from "~icons/ri/smartphone-line"; // @ts-ignore import IconTablet from "~icons/ri/tablet-line"; +// @ts-ignore +import IconUserFollow from "~icons/ri/user-follow-line"; export { IconDashboard, @@ -99,5 +101,6 @@ export { IconSearch, IconComputer, IconPhone, - IconTablet + IconTablet, + IconUserFollow, }; diff --git a/src/views/contents/posts/PostList.vue b/src/views/contents/posts/PostList.vue index 386a89fb..1594db97 100644 --- a/src/views/contents/posts/PostList.vue +++ b/src/views/contents/posts/PostList.vue @@ -522,7 +522,7 @@ const handleRouteToEditor = (post: any) => {
阅读 {{ post.visits }}访问量 {{ post.visits }} 评论 {{ post.commentCount }} { - return { - ...item, - checked: false, - }; - }) -); +const sheetsRef = ref([ + { + title: "关于我们", + url: "/about", + views: "31231", + commentCount: "32", + }, + { + title: "案例中心", + url: "/case", + views: "11431", + commentCount: "35", + }, + { + title: "我们的产品", + url: "/products", + views: "11431", + commentCount: "35", + }, +]); + +const advancedSheets = ref([ + { + name: "友情链接", + author: "halo-dev", + logo: halo, + url: "/links", + }, + { + name: "图库", + author: "halo-dev", + logo: halo, + url: "/photos", + }, + { + name: "社区", + author: "halo-dev", + logo: halo, + url: "/community", + }, +]); const checkAll = ref(false); const activeId = ref("advanced"); - -const handleCheckAll = () => { - postsRef.value.forEach((item) => { - item.checked = checkAll.value; - }); -}; -handleCheckAll(); diff --git a/src/views/system/users/UserList.vue b/src/views/system/users/UserList.vue index 4b696ee1..b372d019 100644 --- a/src/views/system/users/UserList.vue +++ b/src/views/system/users/UserList.vue @@ -11,6 +11,7 @@ import { IconAddCircle, IconArrowDown, IconSettings, + IconUserFollow, IconUserSettings, } from "@/core/icons"; import { ref } from "vue"; @@ -29,12 +30,20 @@ const handleRouteToDetail = (username: string) => {