From e0931dbddf0eed09a77f30b8437d9294a02a3036 Mon Sep 17 00:00:00 2001 From: zxj176381 Date: Wed, 11 Sep 2024 15:13:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=20tree=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/table-tree/table-tree.vue | 122 +++++++++++------- .../src/components/table/table-tree/types.ts | 15 +++ .../effects/common-ui/src/ui/table/table.vue | 21 ++- .../effects/common-ui/src/ui/table/types.ts | 15 ++- packages/styles/src/antd/index.css | 18 +++ playground/src/views/examples/table/helper.ts | 61 +++++++++ 6 files changed, 203 insertions(+), 49 deletions(-) create mode 100644 packages/effects/common-ui/src/components/table/table-tree/types.ts diff --git a/packages/effects/common-ui/src/components/table/table-tree/table-tree.vue b/packages/effects/common-ui/src/components/table/table-tree/table-tree.vue index 8c77579a..77378eb1 100644 --- a/packages/effects/common-ui/src/components/table/table-tree/table-tree.vue +++ b/packages/effects/common-ui/src/components/table/table-tree/table-tree.vue @@ -1,55 +1,87 @@ - + diff --git a/packages/effects/common-ui/src/components/table/table-tree/types.ts b/packages/effects/common-ui/src/components/table/table-tree/types.ts new file mode 100644 index 00000000..209f3482 --- /dev/null +++ b/packages/effects/common-ui/src/components/table/table-tree/types.ts @@ -0,0 +1,15 @@ +import type { TreeProps } from 'ant-design-vue'; + +interface NodeContextMenuItem { + title: string; + type: string; +} + +export interface TableTreeProps extends Omit { + treeData?: any[]; + nodeContextMenu?: NodeContextMenuItem[]; +} + +export interface TableTreeMethods { + onContextMenu?: (treeKey: string, menuKey: number | string) => void; +} diff --git a/packages/effects/common-ui/src/ui/table/table.vue b/packages/effects/common-ui/src/ui/table/table.vue index 4c512ec4..0277456d 100644 --- a/packages/effects/common-ui/src/ui/table/table.vue +++ b/packages/effects/common-ui/src/ui/table/table.vue @@ -1,4 +1,6 @@