From 0514ea05085d5e5504400ee44b8395ce2973cc3d Mon Sep 17 00:00:00 2001 From: lijiahang Date: Mon, 2 Oct 2023 22:56:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=A6=BB=E5=8D=A1=E7=89=87=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=BB=84=E4=BB=B6.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/card-list/index.vue | 368 +++++++++++++++++ .../src/components/card-list/types.ts | 35 ++ orion-ops-ui/src/components/index.ts | 2 + .../src/components/menu/tree/index.vue | 6 +- orion-ops-ui/src/types/table.ts | 21 +- .../asset/host/components/host-card-list.vue | 389 +++--------------- orion-ops-ui/src/views/asset/host/index.vue | 37 +- 7 files changed, 478 insertions(+), 380 deletions(-) create mode 100644 orion-ops-ui/src/components/card-list/index.vue create mode 100644 orion-ops-ui/src/components/card-list/types.ts diff --git a/orion-ops-ui/src/components/card-list/index.vue b/orion-ops-ui/src/components/card-list/index.vue new file mode 100644 index 00000000..46981ef3 --- /dev/null +++ b/orion-ops-ui/src/components/card-list/index.vue @@ -0,0 +1,368 @@ + + + + + + + diff --git a/orion-ops-ui/src/components/card-list/types.ts b/orion-ops-ui/src/components/card-list/types.ts new file mode 100644 index 00000000..a7949a5e --- /dev/null +++ b/orion-ops-ui/src/components/card-list/types.ts @@ -0,0 +1,35 @@ +import { ResponsiveValue } from '@arco-design/web-vue'; + +/** + * 创建卡片位置 + */ +export type Position = 'head' | 'tail' | false + +/** + * 卡片字段 + */ +export interface CardRecord { + disabled?: boolean; + + [name: string]: any; +} + +/** + * col 响应式值 + */ +export interface ColResponsiveValue extends ResponsiveValue { + span?: number; + offset?: number; + order?: number; +} + +/** + * 显示的操作 + */ +export interface HandleVisible { + disableAdd?: boolean; + disableSearchInput?: boolean; + disableFilter?: boolean; + disableSearch?: boolean; + disableReset?: boolean; +} diff --git a/orion-ops-ui/src/components/index.ts b/orion-ops-ui/src/components/index.ts index ef2c7d7a..3be71b6e 100644 --- a/orion-ops-ui/src/components/index.ts +++ b/orion-ops-ui/src/components/index.ts @@ -12,6 +12,7 @@ import { } from 'echarts/components'; import Chart from './chart/index.vue'; import Breadcrumb from './breadcrumb/index.vue'; +import CardList from './card-list/index.vue'; use([ CanvasRenderer, @@ -31,5 +32,6 @@ export default { Vue.component('Chart', Chart); Vue.component('Breadcrumb', Breadcrumb); Vue.component('a-query-header', AQueryHeader); + Vue.component('card-list', CardList); }, }; diff --git a/orion-ops-ui/src/components/menu/tree/index.vue b/orion-ops-ui/src/components/menu/tree/index.vue index 692b69eb..006208cf 100644 --- a/orion-ops-ui/src/components/menu/tree/index.vue +++ b/orion-ops-ui/src/components/menu/tree/index.vue @@ -1,8 +1,7 @@ diff --git a/orion-ops-ui/src/views/asset/host/index.vue b/orion-ops-ui/src/views/asset/host/index.vue index 6d239ab5..57a2482a 100644 --- a/orion-ops-ui/src/views/asset/host/index.vue +++ b/orion-ops-ui/src/views/asset/host/index.vue @@ -8,25 +8,10 @@ @openUpdateConfig="(e) => config.open(e)" /> - - - - - + ref="card" /> + + + >([]); - - for (let i = 0; i < 270; i++) { - list.value.push({ - id: i + 1, - name: `名称 ${i + 1}`, - host: `192.168.1.${i}`, - disabled: i === 0 - }); - } - pagination.total = 270; const table = ref(); const card = ref();