Skip to content

Commit d516361

Browse files
authored
fix: Modify search issue after select all blocks (#1526)
1 parent 6984f49 commit d516361

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/common/component/SelectAll.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,22 @@ const emit = defineEmits(['selectAll'])
2727
2828
const filterList = computed(() => props.allItems.filter((item) => props.selected.some((i) => item.id === i.id)))
2929
30+
const selectNotSearchList = computed(() =>
31+
props.selected.filter((item) => !props.allItems.some((i) => item.id === i.id))
32+
)
33+
3034
const selectedAll = computed({
3135
get() {
3236
return props.allItems.length > 0 && props.allItems.length === filterList.value.length
3337
},
3438
set(value) {
3539
if (value) {
36-
emit('selectAll', props.allItems)
40+
emit('selectAll', props.allItems.concat(selectNotSearchList.value))
3741
} else {
42+
if (selectNotSearchList.value.length) {
43+
emit('selectAll', selectNotSearchList.value)
44+
return
45+
}
3846
emit('selectAll', null)
3947
}
4048
}

0 commit comments

Comments
 (0)