fix: FilterPanel when is multiline and VnTable vh on n toolbar #1657

Merged
jsegarra merged 15 commits from fix_itemFilter_multiLine into dev 2025-04-08 10:17:25 +00:00
2 changed files with 22 additions and 2 deletions
Showing only changes of commit 4caf496bd6 - Show all commits

View File

@ -19,6 +19,7 @@ import { useQuasar, date } from 'quasar';
import { useStateStore } from 'stores/useStateStore';
import { useFilterParams } from 'src/composables/useFilterParams';
import { dashIfEmpty, toDate } from 'src/filters';
import { useTableHeight } from './filters/useTableHeight';
import CrudModel from 'src/components/CrudModel.vue';
import FormModelPopup from 'components/FormModelPopup.vue';
@ -118,7 +119,7 @@ const $props = defineProps({
},
tableHeight: {

Al hacer F5 se calcula mal la altura de de la tabla,
La prueba la he hecho ticketSale he metido muchos registros para que supere el tamaño de la pagina y tenga que hacer scroll y después f5

Al hacer F5 se calcula mal la altura de de la tabla, La prueba la he hecho ticketSale he metido muchos registros para que supere el tamaño de la pagina y tenga que hacer scroll y después f5
type: String,
default: calcTableHeight,
default: undefined,
},
footer: {
type: Boolean,
@ -167,6 +168,7 @@ const tableRef = ref();
const params = ref(useFilterParams($attrs['data-key']).params);
const orders = ref(useFilterParams($attrs['data-key']).orders);
const app = inject('app');
const tableHeight = useTableHeight();
const editingRow = ref(null);
const editingField = ref(null);
@ -679,7 +681,7 @@ const rowCtrlClickFunction = computed(() => {
table-header-class="bg-header"
card-container-class="grid-three"
flat
:style="isTableMode && `max-height: ${tableHeight}`"
:style="isTableMode && `max-height: ${$props.tableHeight || tableHeight}`"
:virtual-scroll="isTableMode"
@virtual-scroll="handleScroll"
@row-click="(event, row) => handleRowClick(event, row)"

View File

@ -0,0 +1,18 @@
import { onMounted, nextTick, ref } from 'vue';
export function useTableHeight() {
const tableHeight = ref('100vh');
onMounted(async () => {
await nextTick();
let height = 100;
Array.from(document.querySelectorAll('[role="toolbar"]'))
.filter((element) => window.getComputedStyle(element).display !== 'none')
.forEach(() => {
height -= 10;
});
tableHeight.value = `${height}vh`;
});
return tableHeight;
}