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 8b0f1381
authored
Nov 24, 2025
by
Jin Mao
Committed by
GitHub
Nov 24, 2025
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'main' into deps
2 parents
9a4f0f6a
a810cd0b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
18 deletions
packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue
packages/effects/common-ui/src/components/icon-picker/icon-picker.vue
packages/effects/hooks/src/use-pagination.ts
playground/src/views/system/menu/modules/form.vue
packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue
View file @
8b0f138
...
@@ -380,7 +380,7 @@ defineExpose({
...
@@ -380,7 +380,7 @@ defineExpose({
<div
class=
"flex items-center gap-1"
>
<div
class=
"flex items-center gap-1"
>
<Checkbox
<Checkbox
v-if=
"multiple"
v-if=
"multiple"
:
checked
=
"isSelected && !isNodeDisabled(item)"
:
model-value
=
"isSelected && !isNodeDisabled(item)"
:disabled=
"isNodeDisabled(item)"
:disabled=
"isNodeDisabled(item)"
:indeterminate=
"isIndeterminate && !isNodeDisabled(item)"
:indeterminate=
"isIndeterminate && !isNodeDisabled(item)"
@
click=
"
@
click=
"
...
...
packages/effects/common-ui/src/components/icon-picker/icon-picker.vue
View file @
8b0f138
...
@@ -71,17 +71,10 @@ const modelValue = defineModel({ default: '', type: String });
...
@@ -71,17 +71,10 @@ const modelValue = defineModel({ default: '', type: String });
const
visible
=
ref
(
false
);
const
visible
=
ref
(
false
);
const
currentSelect
=
ref
(
''
);
const
currentSelect
=
ref
(
''
);
const
currentPage
=
ref
(
1
);
const
keyword
=
ref
(
''
);
const
keyword
=
ref
(
''
);
const
keywordDebounce
=
refDebounced
(
keyword
,
300
);
const
keywordDebounce
=
refDebounced
(
keyword
,
300
);
const
innerIcons
=
ref
<
string
[]
>
([]);
const
innerIcons
=
ref
<
string
[]
>
([]);
/* 当检索关键词变化时,重置分页 */
watch
(
keywordDebounce
,
()
=>
{
currentPage
.
value
=
1
;
setCurrentPage
(
1
);
});
watchDebounced
(
watchDebounced
(
()
=>
props
.
prefix
,
()
=>
props
.
prefix
,
async
(
prefix
)
=>
{
async
(
prefix
)
=>
{
...
@@ -122,7 +115,7 @@ const showList = computed(() => {
...
@@ -122,7 +115,7 @@ const showList = computed(() => {
);
);
});
});
const
{
paginationList
,
total
,
setCurrentPage
}
=
usePagination
(
const
{
paginationList
,
total
,
setCurrentPage
,
currentPage
}
=
usePagination
(
showList
,
showList
,
props
.
pageSize
,
props
.
pageSize
,
);
);
...
@@ -145,7 +138,6 @@ const handleClick = (icon: string) => {
...
@@ -145,7 +138,6 @@ const handleClick = (icon: string) => {
};
};
const
handlePageChange
=
(
page
:
number
)
=>
{
const
handlePageChange
=
(
page
:
number
)
=>
{
currentPage
.
value
=
page
;
setCurrentPage
(
page
);
setCurrentPage
(
page
);
};
};
...
...
packages/effects/hooks/src/use-pagination.ts
View file @
8b0f138
import
type
{
Ref
}
from
'vue'
;
import
type
{
Ref
}
from
'vue'
;
import
{
computed
,
ref
,
unref
}
from
'vue'
;
import
{
computed
,
ref
,
unref
,
watch
}
from
'vue'
;
/**
/**
* Paginates an array of items
* Paginates an array of items
...
@@ -22,7 +22,11 @@ function pagination<T = any>(list: T[], pageNo: number, pageSize: number): T[] {
...
@@ -22,7 +22,11 @@ function pagination<T = any>(list: T[], pageNo: number, pageSize: number): T[] {
return
ret
;
return
ret
;
}
}
export
function
usePagination
<
T
=
any
>
(
list
:
Ref
<
T
[]
>
,
pageSize
:
number
)
{
export
function
usePagination
<
T
=
any
>
(
list
:
Ref
<
T
[]
>
,
pageSize
:
number
,
totalChangeToFirstPage
=
true
,
)
{
const
currentPage
=
ref
(
1
);
const
currentPage
=
ref
(
1
);
const
pageSizeRef
=
ref
(
pageSize
);
const
pageSizeRef
=
ref
(
pageSize
);
...
@@ -38,11 +42,21 @@ export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
...
@@ -38,11 +42,21 @@ export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
return
unref
(
list
).
length
;
return
unref
(
list
).
length
;
});
});
if
(
totalChangeToFirstPage
)
{
watch
(
total
,
()
=>
{
setCurrentPage
(
1
);
});
}
function
setCurrentPage
(
page
:
number
)
{
function
setCurrentPage
(
page
:
number
)
{
if
(
page
<
1
||
page
>
unref
(
totalPages
))
{
if
(
page
===
1
&&
unref
(
totalPages
)
===
0
)
{
throw
new
Error
(
'Invalid page number'
);
currentPage
.
value
=
1
;
}
else
{
if
(
page
<
1
||
page
>
unref
(
totalPages
))
{
throw
new
Error
(
'Invalid page number'
);
}
currentPage
.
value
=
page
;
}
}
currentPage
.
value
=
page
;
}
}
function
setPageSize
(
pageSize
:
number
)
{
function
setPageSize
(
pageSize
:
number
)
{
...
@@ -54,5 +68,5 @@ export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
...
@@ -54,5 +68,5 @@ export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
currentPage
.
value
=
1
;
currentPage
.
value
=
1
;
}
}
return
{
setCurrentPage
,
total
,
setPageSize
,
paginationList
};
return
{
setCurrentPage
,
total
,
setPageSize
,
paginationList
,
currentPage
};
}
}
playground/src/views/system/menu/modules/form.vue
View file @
8b0f138
...
@@ -107,7 +107,7 @@ const schema: VbenFormSchema[] = [
...
@@ -107,7 +107,7 @@ const schema: VbenFormSchema[] = [
componentProps
()
{
componentProps
()
{
// 不需要处理多语言时就无需这么做
// 不需要处理多语言时就无需这么做
return
{
return
{
addonAfter
:
titleSuffix
.
value
,
...(
titleSuffix
.
value
&&
{
addonAfter
:
titleSuffix
.
value
})
,
onChange
({
target
:
{
value
}
}:
ChangeEvent
)
{
onChange
({
target
:
{
value
}
}:
ChangeEvent
)
{
titleSuffix
.
value
=
value
&&
$te
(
value
)
?
$t
(
value
)
:
undefined
;
titleSuffix
.
value
=
value
&&
$te
(
value
)
?
$t
(
value
)
:
undefined
;
},
},
...
@@ -442,7 +442,6 @@ const [Form, formApi] = useVbenForm({
...
@@ -442,7 +442,6 @@ const [Form, formApi] = useVbenForm({
showDefaultActions
:
false
,
showDefaultActions
:
false
,
wrapperClass
:
'grid-cols-2 gap-x-4'
,
wrapperClass
:
'grid-cols-2 gap-x-4'
,
});
});
const
[
Drawer
,
drawerApi
]
=
useVbenDrawer
({
const
[
Drawer
,
drawerApi
]
=
useVbenDrawer
({
onConfirm
:
onSubmit
,
onConfirm
:
onSubmit
,
onOpenChange
(
isOpen
)
{
onOpenChange
(
isOpen
)
{
...
...
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