Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 97ad93ab
authored
Sep 17, 2025
by
Jin Mao
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'zouawen-main'
2 parents
0f7731b6
319b7fcd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
7 deletions
packages/@core/base/icons/src/lucide.ts
packages/@core/ui-kit/shadcn-ui/src/ui/tree/index.ts
packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue
packages/@core/ui-kit/shadcn-ui/src/ui/tree/types.ts
packages/effects/common-ui/src/components/index.ts
packages/effects/common-ui/src/components/tree/index.ts
packages/effects/common-ui/src/components/tree/tree.vue
playground/src/views/system/role/modules/form.vue
packages/@core/base/icons/src/lucide.ts
View file @
97ad93a
...
@@ -32,6 +32,7 @@ export {
...
@@ -32,6 +32,7 @@ export {
Grip
,
Grip
,
GripVertical
,
GripVertical
,
Menu
as
IconDefault
,
Menu
as
IconDefault
,
Inbox
,
Info
,
Info
,
InspectionPanel
,
InspectionPanel
,
Languages
,
Languages
,
...
...
packages/@core/ui-kit/shadcn-ui/src/ui/tree/index.ts
View file @
97ad93a
export
{
default
as
VbenTree
}
from
'./tree.vue'
;
export
{
default
as
VbenTree
}
from
'./tree.vue'
;
export
type
{
TreeProps
}
from
'./types'
;
export
{
treePropsDefaults
}
from
'./types'
;
export
type
{
FlattenedItem
}
from
'radix-vue'
;
export
type
{
FlattenedItem
}
from
'radix-vue'
;
packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue
View file @
97ad93a
This diff is collapsed.
Click to expand it.
packages/@core/ui-kit/shadcn-ui/src/ui/tree/types.ts
View file @
97ad93a
...
@@ -40,3 +40,23 @@ export interface TreeProps {
...
@@ -40,3 +40,23 @@ export interface TreeProps {
/** 值字段 */
/** 值字段 */
valueField
?:
string
;
valueField
?:
string
;
}
}
export
function
treePropsDefaults
()
{
return
{
allowClear
:
false
,
autoCheckParent
:
true
,
bordered
:
false
,
checkStrictly
:
false
,
defaultExpandedKeys
:
()
=>
[],
defaultExpandedLevel
:
0
,
disabled
:
false
,
disabledField
:
'disabled'
,
iconField
:
'icon'
,
labelField
:
'label'
,
multiple
:
false
,
showIcon
:
true
,
transition
:
true
,
valueField
:
'value'
,
childrenField
:
'children'
,
};
}
packages/effects/common-ui/src/components/index.ts
View file @
97ad93a
...
@@ -9,6 +9,7 @@ export * from './loading';
...
@@ -9,6 +9,7 @@ export * from './loading';
export
*
from
'./page'
;
export
*
from
'./page'
;
export
*
from
'./resize'
;
export
*
from
'./resize'
;
export
*
from
'./tippy'
;
export
*
from
'./tippy'
;
export
*
from
'./tree'
;
export
*
from
'@vben-core/form-ui'
;
export
*
from
'@vben-core/form-ui'
;
export
*
from
'@vben-core/popup-ui'
;
export
*
from
'@vben-core/popup-ui'
;
...
@@ -27,7 +28,6 @@ export {
...
@@ -27,7 +28,6 @@ export {
VbenPinInput
,
VbenPinInput
,
VbenSelect
,
VbenSelect
,
VbenSpinner
,
VbenSpinner
,
VbenTree
,
}
from
'@vben-core/shadcn-ui'
;
}
from
'@vben-core/shadcn-ui'
;
export
type
{
FlattenedItem
}
from
'@vben-core/shadcn-ui'
;
export
type
{
FlattenedItem
}
from
'@vben-core/shadcn-ui'
;
...
...
packages/effects/common-ui/src/components/tree/index.ts
0 → 100644
View file @
97ad93a
export
{
default
as
Tree
}
from
'./tree.vue'
;
packages/effects/common-ui/src/components/tree/tree.vue
0 → 100644
View file @
97ad93a
<
script
setup
lang=
"ts"
>
import
type
{
TreeProps
}
from
'@vben-core/shadcn-ui'
;
import
{
Inbox
}
from
'@vben/icons'
;
import
{
$t
}
from
'@vben/locales'
;
import
{
treePropsDefaults
,
VbenTree
}
from
'@vben-core/shadcn-ui'
;
const
props
=
withDefaults
(
defineProps
<
TreeProps
>
(),
treePropsDefaults
());
</
script
>
<
template
>
<VbenTree
v-if=
"props.treeData?.length > 0"
v-bind=
"props"
>
<template
v-for=
"(_, key) in $slots"
:key=
"key"
#[
key
]="
slotProps
"
>
<slot
:name=
"key"
v-bind=
"slotProps"
>
</slot>
</
template
>
</VbenTree>
<div
v-else
class=
"flex-col-center text-muted-foreground cursor-pointer rounded-lg border p-10 text-sm font-medium"
>
<Inbox
class=
"size-10"
/>
<div
class=
"mt-1"
>
{{ $t('common.noData') }}
</div>
</div>
</template>
playground/src/views/system/role/modules/form.vue
View file @
97ad93a
...
@@ -7,7 +7,7 @@ import type { SystemRoleApi } from '#/api/system/role';
...
@@ -7,7 +7,7 @@ import type { SystemRoleApi } from '#/api/system/role';
import
{
computed
,
nextTick
,
ref
}
from
'vue'
;
import
{
computed
,
nextTick
,
ref
}
from
'vue'
;
import
{
useVbenDrawer
,
VbenTree
}
from
'@vben/common-ui'
;
import
{
Tree
,
useVbenDrawer
}
from
'@vben/common-ui'
;
import
{
IconifyIcon
}
from
'@vben/icons'
;
import
{
IconifyIcon
}
from
'@vben/icons'
;
import
{
Spin
}
from
'ant-design-vue'
;
import
{
Spin
}
from
'ant-design-vue'
;
...
@@ -92,9 +92,6 @@ function getNodeClass(node: Recordable<any>) {
...
@@ -92,9 +92,6 @@ function getNodeClass(node: Recordable<any>) {
const
classes
:
string
[]
=
[];
const
classes
:
string
[]
=
[];
if
(
node
.
value
?.
type
===
'button'
)
{
if
(
node
.
value
?.
type
===
'button'
)
{
classes
.
push
(
'inline-flex'
);
classes
.
push
(
'inline-flex'
);
if
(
node
.
index
%
3
>=
1
)
{
classes
.
push
(
'!pl-0'
);
}
}
}
return
classes
.
join
(
' '
);
return
classes
.
join
(
' '
);
...
@@ -105,7 +102,7 @@ function getNodeClass(node: Recordable<any>) {
...
@@ -105,7 +102,7 @@ function getNodeClass(node: Recordable<any>) {
<Form>
<Form>
<template
#
permissions=
"slotProps"
>
<template
#
permissions=
"slotProps"
>
<Spin
:spinning=
"loadingPermissions"
wrapper-class-name=
"w-full"
>
<Spin
:spinning=
"loadingPermissions"
wrapper-class-name=
"w-full"
>
<
Vben
Tree
<Tree
:tree-data=
"permissions"
:tree-data=
"permissions"
multiple
multiple
bordered
bordered
...
@@ -120,7 +117,7 @@ function getNodeClass(node: Recordable<any>) {
...
@@ -120,7 +117,7 @@ function getNodeClass(node: Recordable<any>) {
<IconifyIcon
v-if=
"value.meta.icon"
:icon=
"value.meta.icon"
/>
<IconifyIcon
v-if=
"value.meta.icon"
:icon=
"value.meta.icon"
/>
{{
$t
(
value
.
meta
.
title
)
}}
{{
$t
(
value
.
meta
.
title
)
}}
</
template
>
</
template
>
</
Vben
Tree>
</Tree>
</Spin>
</Spin>
</template>
</template>
</Form>
</Form>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment