From b77257c746f6858dbf5a75ee78ccb12750e7be4c Mon Sep 17 00:00:00 2001 From: lijiahang Date: Fri, 29 Sep 2023 23:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BA=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- orion-ops-ui/src/assets/style/layout.less | 12 +- orion-ops-ui/src/types/table.ts | 41 +++ .../asset/host/components/host-card-list.vue | 255 ++++++++++-------- 3 files changed, 197 insertions(+), 111 deletions(-) diff --git a/orion-ops-ui/src/assets/style/layout.less b/orion-ops-ui/src/assets/style/layout.less index 1ca7cf25..ff62d46e 100644 --- a/orion-ops-ui/src/assets/style/layout.less +++ b/orion-ops-ui/src/assets/style/layout.less @@ -1,7 +1,6 @@ .layout-container { background-color: var(--color-fill-2); - // fixme - // padding: 16px 16px 0 16px; + padding: 16px 16px 0 16px; display: flex; flex-direction: column; } @@ -67,6 +66,15 @@ } } +.card-list-item { + transition-property: all; +} + +.card-list-item:hover { + transform: translateY(-4px); + box-shadow: 2px 2px 12px rgba(0, 0, 0, .15); +} + .usn { user-select: none; } diff --git a/orion-ops-ui/src/types/table.ts b/orion-ops-ui/src/types/table.ts index 840c20e4..22811fd7 100644 --- a/orion-ops-ui/src/types/table.ts +++ b/orion-ops-ui/src/types/table.ts @@ -1,4 +1,5 @@ import { PaginationProps, TableRowSelection } from '@arco-design/web-vue'; +import { reactive } from 'vue'; /** * 默认分页 @@ -23,3 +24,43 @@ export const defaultRowSelection = (): TableRowSelection => { onlyCurrent: true, }; }; + +/** + * 创建列表分页 + */ +export const usePagination = (): PaginationProps => { + return reactive({ + total: 0, + current: 1, + pageSize: 10, + showTotal: true, + showPageSize: true, + pageSizeOptions: [10, 20, 30, 50, 100] + }); +}; + +/** + * 创建卡片列表分页 + */ +export const useCardPagination = (): PaginationProps => { + return reactive({ + total: 0, + current: 1, + pageSize: 18, + showTotal: true, + showPageSize: true, + pageSizeOptions: [12, 18, 36, 48, 96] + }); +}; + + +/** + * 创建行选择器 + */ +export const useRowSelection = (type = 'checkbox'): TableRowSelection => { + return { + type: type as any, + showCheckedAll: true, + onlyCurrent: true, + }; +}; diff --git a/orion-ops-ui/src/views/asset/host/components/host-card-list.vue b/orion-ops-ui/src/views/asset/host/components/host-card-list.vue index 549e5338..7c1a08a2 100644 --- a/orion-ops-ui/src/views/asset/host/components/host-card-list.vue +++ b/orion-ops-ui/src/views/asset/host/components/host-card-list.vue @@ -1,53 +1,73 @@