From 570ffd3ebc95aca418844754886d1327cffbf6cf Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Sun, 12 Nov 2023 22:15:16 +0800 Subject: [PATCH] =?UTF-8?q?review:=20=E4=BF=AE=E6=94=B9=E4=B8=BB=E6=9C=BA?= =?UTF-8?q?=E5=88=86=E7=BB=84=E9=85=8D=E7=BD=AE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- orion-ops-ui/src/components/index.ts | 2 + .../src/components/view/tab-router/index.vue | 94 ++++++++++++ .../src/components/view/tab-router/types.ts | 9 ++ orion-ops-ui/src/types/arco.d.ts | 9 ++ orion-ops-ui/src/types/global.ts | 4 + .../host-group/components/host-group-tree.vue | 122 ++++++++------- .../components/host-group-view-role-grant.vue | 19 +++ .../components/host-group-view-setting.vue | 81 ++++++++++ .../components/host-group-view-user-grant.vue | 19 +++ .../host-group/components/host-group-view.vue | 140 +++++------------- .../src/views/asset/host-group/types/const.ts | 24 +++ 11 files changed, 362 insertions(+), 161 deletions(-) create mode 100644 orion-ops-ui/src/components/view/tab-router/index.vue create mode 100644 orion-ops-ui/src/components/view/tab-router/types.ts create mode 100644 orion-ops-ui/src/types/arco.d.ts create mode 100644 orion-ops-ui/src/views/asset/host-group/components/host-group-view-role-grant.vue create mode 100644 orion-ops-ui/src/views/asset/host-group/components/host-group-view-setting.vue create mode 100644 orion-ops-ui/src/views/asset/host-group/components/host-group-view-user-grant.vue create mode 100644 orion-ops-ui/src/views/asset/host-group/types/const.ts diff --git a/orion-ops-ui/src/components/index.ts b/orion-ops-ui/src/components/index.ts index c61bd8e7..b23143c5 100644 --- a/orion-ops-ui/src/components/index.ts +++ b/orion-ops-ui/src/components/index.ts @@ -14,6 +14,7 @@ import Breadcrumb from './app/breadcrumb/index.vue'; import Chart from './view/chart/index.vue'; import CardList from './view/card-list/index.vue'; import Editor from './view/editor/index.vue'; +import TabRouter from './view/tab-router/index.vue'; use([ CanvasRenderer, @@ -35,5 +36,6 @@ export default { Vue.component('a-query-header', AQueryHeader); Vue.component('card-list', CardList); Vue.component('editor', Editor); + Vue.component('tab-router', TabRouter); }, }; diff --git a/orion-ops-ui/src/components/view/tab-router/index.vue b/orion-ops-ui/src/components/view/tab-router/index.vue new file mode 100644 index 00000000..83dbdfbf --- /dev/null +++ b/orion-ops-ui/src/components/view/tab-router/index.vue @@ -0,0 +1,94 @@ + + + + + + + diff --git a/orion-ops-ui/src/components/view/tab-router/types.ts b/orion-ops-ui/src/components/view/tab-router/types.ts new file mode 100644 index 00000000..b4c9c3e1 --- /dev/null +++ b/orion-ops-ui/src/components/view/tab-router/types.ts @@ -0,0 +1,9 @@ +/** + * tab 元素 + */ +export interface TabRouterItem { + key: string | number, + text: string, + icon?: string; + permission?: string[] +} diff --git a/orion-ops-ui/src/types/arco.d.ts b/orion-ops-ui/src/types/arco.d.ts new file mode 100644 index 00000000..8363c000 --- /dev/null +++ b/orion-ops-ui/src/types/arco.d.ts @@ -0,0 +1,9 @@ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +import type { TreeNodeData } from '@arco-design/web-vue'; +import type { NodeData } from './global'; + +declare module '@arco-design/web-vue' { + interface TreeNodeData extends NodeData { + [key: string]: any; + } +} diff --git a/orion-ops-ui/src/types/global.ts b/orion-ops-ui/src/types/global.ts index d336fff2..c50f80d7 100644 --- a/orion-ops-ui/src/types/global.ts +++ b/orion-ops-ui/src/types/global.ts @@ -30,6 +30,10 @@ export interface Pagination { limit?: number; } +export interface NodeData { + [key: string]: any; +} + export interface DataGrid { page: number; limit: number; diff --git a/orion-ops-ui/src/views/asset/host-group/components/host-group-tree.vue b/orion-ops-ui/src/views/asset/host-group/components/host-group-tree.vue index c6b1e750..7668e247 100644 --- a/orion-ops-ui/src/views/asset/host-group/components/host-group-tree.vue +++ b/orion-ops-ui/src/views/asset/host-group/components/host-group-tree.vue @@ -1,50 +1,50 @@