fix: retain pending Toast and Table fidelity corrections
This commit is contained in:
@@ -122,6 +122,23 @@ function initials(name: string) {
|
||||
.map((n) => n[0])
|
||||
.join("");
|
||||
}
|
||||
|
||||
const selectableIds = computed(() =>
|
||||
sortedUsers.value.map((u) => String(u.id)),
|
||||
);
|
||||
const allChecked = computed(
|
||||
() =>
|
||||
selectableIds.value.length > 0 &&
|
||||
selectableIds.value.every((id) => selectedKeys.value.includes(id)),
|
||||
);
|
||||
const someChecked = computed(
|
||||
() =>
|
||||
!allChecked.value &&
|
||||
selectableIds.value.some((id) => selectedKeys.value.includes(id)),
|
||||
);
|
||||
function toggleAll() {
|
||||
selectedKeys.value = allChecked.value ? [] : [...selectableIds.value];
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -138,7 +155,12 @@ function initials(name: string) {
|
||||
>
|
||||
<TableHeader>
|
||||
<TableColumn class="pe-0">
|
||||
<Checkbox aria-label="全选">
|
||||
<Checkbox
|
||||
aria-label="全选"
|
||||
:is-selected="allChecked"
|
||||
:is-indeterminate="someChecked"
|
||||
@update:checked="toggleAll"
|
||||
>
|
||||
<CheckboxContent>
|
||||
<CheckboxControl>
|
||||
<CheckboxIndicator />
|
||||
|
||||
Reference in New Issue
Block a user