forked from verdnatura/salix-front
feat: refs #8078 add shortcut multi selection
This commit is contained in:
parent
0537213a58
commit
0cc0e82aaa
|
@ -331,6 +331,16 @@ function handleScroll() {
|
|||
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
|
||||
if (isAtBottom) CrudModelRef.value.vnPaginateRef.paginate();
|
||||
}
|
||||
|
||||
function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||
if (evt?.shiftKey && added) {
|
||||
const rowIndex = selectedRows[0].$index;
|
||||
for (const row of rows) {
|
||||
if (row.$index > rowIndex) break;
|
||||
selected.value.push(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<QDrawer
|
||||
|
@ -431,6 +441,7 @@ function handleScroll() {
|
|||
@virtual-scroll="handleScroll"
|
||||
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
|
||||
@update:selected="emit('update:selected', $event)"
|
||||
@selection="(details) => handleSelection(details, rows)"
|
||||
>
|
||||
<template #top-left v-if="!$props.withoutHeader">
|
||||
<slot name="top-left"></slot>
|
||||
|
|
Loading…
Reference in New Issue