From 5aa6907820740aca0d8aa262a0daead0d66ff71d Mon Sep 17 00:00:00 2001 From: lijiahang Date: Fri, 1 Dec 2023 19:14:31 +0800 Subject: [PATCH] review code. --- .../view/card-list/components/card-header.vue | 215 ++++++++++++++++++ .../view/card-list/components/create-card.vue | 49 ++++ .../components/view/card-list/types/props.ts | 54 +++++ 3 files changed, 318 insertions(+) create mode 100644 orion-ops-ui/src/components/view/card-list/components/card-header.vue create mode 100644 orion-ops-ui/src/components/view/card-list/components/create-card.vue create mode 100644 orion-ops-ui/src/components/view/card-list/types/props.ts diff --git a/orion-ops-ui/src/components/view/card-list/components/card-header.vue b/orion-ops-ui/src/components/view/card-list/components/card-header.vue new file mode 100644 index 00000000..195fe9e2 --- /dev/null +++ b/orion-ops-ui/src/components/view/card-list/components/card-header.vue @@ -0,0 +1,215 @@ + + + + + + + diff --git a/orion-ops-ui/src/components/view/card-list/components/create-card.vue b/orion-ops-ui/src/components/view/card-list/components/create-card.vue new file mode 100644 index 00000000..b34f61b4 --- /dev/null +++ b/orion-ops-ui/src/components/view/card-list/components/create-card.vue @@ -0,0 +1,49 @@ + + + + + + + diff --git a/orion-ops-ui/src/components/view/card-list/types/props.ts b/orion-ops-ui/src/components/view/card-list/types/props.ts new file mode 100644 index 00000000..44547009 --- /dev/null +++ b/orion-ops-ui/src/components/view/card-list/types/props.ts @@ -0,0 +1,54 @@ +import type { CSSProperties } from 'vue'; +import type { PaginationProps, ResponsiveValue } from '@arco-design/web-vue'; +import type { CardFieldConfig, CardPosition, CardRecord, ColResponsiveValue, HandleVisible } from '@/types/card'; + +// 卡片属性 +export interface CardProps { + key?: string; + pagination?: PaginationProps | boolean; + loading?: boolean; + fieldConfig?: CardFieldConfig; + cardHeight: string; + cardClass?: string; + cardBodyStyle?: CSSProperties; + contextMenu?: boolean; + filterCount?: number; + searchInputPlaceholder?: string; + searchInputWidth?: string; + searchValue?: string; + createCardDescription?: string; + createCardPosition?: CardPosition | boolean; + addPermission?: Array; + cardLayoutGutter?: Number | ResponsiveValue | Array | Array; + cardLayoutCols?: ColResponsiveValue; + handleVisible?: HandleVisible; + list?: Array; +} + +// 定义默认 props +export const cardDefaultProps = () => { + return { + key: 'id', + pagination: false, + loading: false, + cardHeight: '100%', + contextMenu: true, + filterCount: 0, + searchInputWidth: '200px', + searchValue: '', + createCardDescription: '点击此处进行创建', + createCardPosition: false, + addPermission: () => [], + cardLayoutGutter: () => [16, 16], + cardLayoutCols: () => { + return { + span: 6 + }; + }, + handleVisible: () => { + return {}; + }, + list: () => [] + }; +}; +