fix: retain pending Toast and Table fidelity corrections

This commit is contained in:
maoyingjie
2026-10-25 21:24:09 +08:00
parent 2ce80b17da
commit a2ca6ed0b8
42 changed files with 2153 additions and 260 deletions
+11 -1
View File
@@ -51,6 +51,9 @@ const selectedKeys = ref<TableKey[]>([]);
const allChecked = computed(
() => users.length > 0 && selectedKeys.value.length === users.length,
);
const someChecked = computed(
() => selectedKeys.value.length > 0 && !allChecked.value,
);
function toggleAll() {
selectedKeys.value = allChecked.value ? [] : users.map((u) => u.id);
}
@@ -77,6 +80,7 @@ function toggleOne(id: string) {
<Checkbox
aria-label="全选"
:is-selected="allChecked"
:is-indeterminate="someChecked"
@update:checked="toggleAll"
>
<CheckboxContent>
@@ -119,7 +123,13 @@ function toggleOne(id: string) {
<p class="text-sm text-muted">
已选:
<span class="font-medium">
{{ selectedKeys.length > 0 ? selectedKeys.join(", ") : "无" }}
{{
allChecked
? "全部"
: selectedKeys.length > 0
? selectedKeys.join(", ")
: "无"
}}
</span>
</p>
</div>