forked from verdnatura/salix-front
refactor: #6993 set default QTable pagination
This commit is contained in:
parent
63f00c24d7
commit
37a2c33f9f
|
@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) {
|
|||
// app boot file (/src/boot)
|
||||
// --> boot files are part of "main.js"
|
||||
// https://v2.quasar.dev/quasar-cli/boot-files
|
||||
boot: ['i18n', 'axios', 'vnDate', 'validations'],
|
||||
boot: ['i18n', 'axios', 'vnDate', 'validations', 'setDefaults'],
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
|
||||
css: ['app.scss'],
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,4 @@
|
|||
[ZoneTransfer]
|
||||
ZoneId=3
|
||||
ReferrerUrl=https://chat.verdnatura.es/direct/4MYAaHTayrgLirGvuFzY9RyDvyg99NzPu5
|
||||
HostUrl=https://chat.verdnatura.es/file-upload/9whFtRhkNT95CdJud/quasar.patch?download
|
|
@ -0,0 +1,22 @@
|
|||
import { QTable } from 'quasar';
|
||||
|
||||
const setDefault = (component, key, value) => {
|
||||
const prop = component.props[key];
|
||||
switch (typeof prop) {
|
||||
case 'object':
|
||||
prop.default = value;
|
||||
break;
|
||||
case 'function':
|
||||
component.props[key] = {
|
||||
type: prop,
|
||||
default: value,
|
||||
};
|
||||
break;
|
||||
case 'undefined':
|
||||
throw new Error('unknown prop: ' + key);
|
||||
default:
|
||||
throw new Error('unhandled type: ' + typeof prop);
|
||||
}
|
||||
};
|
||||
setDefault(QTable, 'pagination', { rowsPerPage: 25 });
|
||||
setDefault(QTable, 'hidePagination', true);
|
|
@ -202,7 +202,6 @@ const selectItem = ({ id }) => {
|
|||
<QTable
|
||||
:columns="tableColumns"
|
||||
:rows="tableRows"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:loading="loading"
|
||||
:hide-header="!tableRows || !tableRows.length > 0"
|
||||
:no-data-label="t('Enter a new search')"
|
||||
|
|
|
@ -200,7 +200,6 @@ const selectTravel = ({ id }) => {
|
|||
<QTable
|
||||
:columns="tableColumns"
|
||||
:rows="tableRows"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:loading="loading"
|
||||
:hide-header="!tableRows || !tableRows.length > 0"
|
||||
:no-data-label="t('Enter a new search')"
|
||||
|
|
|
@ -247,7 +247,6 @@ function openDialog(dmsId) {
|
|||
flat
|
||||
dense
|
||||
:rows-per-page-options="[0]"
|
||||
hide-bottom
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props">
|
||||
|
@ -290,7 +289,6 @@ function openDialog(dmsId) {
|
|||
flat
|
||||
dense
|
||||
:rows-per-page-options="[0]"
|
||||
hide-bottom
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props">
|
||||
|
|
|
@ -224,10 +224,8 @@ const refreshData = () => {
|
|||
<QPage class="column items-center q-pa-md">
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
hide-bottom
|
||||
row-key="clientFk"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
|
|
|
@ -108,10 +108,8 @@ const selectCustomerId = (id) => {
|
|||
<QPage class="column items-center q-pa-md">
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
hide-bottom
|
||||
row-key="id"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
|
|
|
@ -151,10 +151,8 @@ function stateColor(row) {
|
|||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="id"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:grid="grid || $q.screen.lt.sm"
|
||||
class="q-mt-xs custom-table"
|
||||
hide-pagination
|
||||
>
|
||||
<template #body-cell-actions="{ row }">
|
||||
<QTd auto-width class="text-center">
|
||||
|
|
|
@ -320,7 +320,6 @@ const showLockIcon = (groupingMode, mode) => {
|
|||
:columns="entriesTableColumns"
|
||||
selection="multiple"
|
||||
row-key="id"
|
||||
hide-bottom
|
||||
class="full-width q-mt-md"
|
||||
:grid="$q.screen.lt.md"
|
||||
v-model:selected="rowsSelected"
|
||||
|
|
|
@ -238,12 +238,7 @@ const redirectToBuysView = () => {
|
|||
</div>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:rows="importData.buys"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
hide-pagination
|
||||
>
|
||||
<QTable :columns="columns" :rows="importData.buys">
|
||||
<template #body-cell-item="{ row, col }">
|
||||
<QTd auto-width>
|
||||
<VnSelectDialog
|
||||
|
|
|
@ -277,7 +277,6 @@ const fetchEntryBuys = async () => {
|
|||
<QTable
|
||||
:rows="entryBuys"
|
||||
:columns="entriesTableColumns"
|
||||
hide-bottom
|
||||
row-key="index"
|
||||
class="full-width q-mt-md"
|
||||
>
|
||||
|
|
|
@ -659,7 +659,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
:columns="columns"
|
||||
selection="multiple"
|
||||
row-key="id"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
class="full-width q-mt-md"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:selected="rowsSelected"
|
||||
|
|
|
@ -111,7 +111,6 @@ const onSave = (data) => data.deletes && router.push(`/invoice-in/${invoiceId}/s
|
|||
:rows="rows"
|
||||
row-key="$index"
|
||||
selection="single"
|
||||
hide-pagination
|
||||
:grid="$q.screen.lt.sm"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
>
|
||||
|
|
|
@ -99,7 +99,6 @@ async function insert() {
|
|||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="$index"
|
||||
hide-pagination
|
||||
:grid="$q.screen.lt.sm"
|
||||
>
|
||||
<template #body-cell-duedate="{ row }">
|
||||
|
|
|
@ -134,7 +134,6 @@ function getTotal(type) {
|
|||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="$index"
|
||||
hide-pagination
|
||||
:grid="$q.screen.lt.sm"
|
||||
>
|
||||
<template #body-cell="{ row, col }">
|
||||
|
|
|
@ -327,7 +327,7 @@ function getLink(param) {
|
|||
:columns="vatColumns"
|
||||
:rows="invoiceIn.invoiceInTax"
|
||||
flat
|
||||
hide-pagination
|
||||
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props" class="bg">
|
||||
|
@ -361,7 +361,7 @@ function getLink(param) {
|
|||
:columns="dueDayColumns"
|
||||
:rows="invoiceIn.invoiceInDueDay"
|
||||
flat
|
||||
hide-pagination
|
||||
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props" class="bg">
|
||||
|
@ -390,7 +390,6 @@ function getLink(param) {
|
|||
:columns="intrastatColumns"
|
||||
:rows="invoiceIn.invoiceInIntrastat"
|
||||
flat
|
||||
hide-pagination
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props" class="bg">
|
||||
|
|
|
@ -184,10 +184,8 @@ async function addExpense() {
|
|||
selection="multiple"
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
row-key="$index"
|
||||
hide-pagination
|
||||
row-key="$index"
|
||||
:grid="$q.screen.lt.sm"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
>
|
||||
<template #body-cell-expense="{ row, col }">
|
||||
<QTd auto-width>
|
||||
|
|
|
@ -124,9 +124,7 @@ onUnmounted(() => {
|
|||
v-if="rows.length > 0"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
hide-bottom
|
||||
row-key="id"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
class="full-width q-mt-md"
|
||||
>
|
||||
<template #body-cell="props">
|
||||
|
|
|
@ -231,7 +231,6 @@ const selectWorkerId = (id) => {
|
|||
<QTable
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
hide-bottom
|
||||
row-key="clientId"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
class="full-width q-mt-md"
|
||||
|
|
|
@ -162,7 +162,6 @@ const detailsColumns = ref([
|
|||
:columns="detailsColumns"
|
||||
:rows="entity?.rows"
|
||||
flat
|
||||
hide-pagination
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props">
|
||||
|
|
|
@ -213,10 +213,8 @@ const openBuscaman = async (route, ticket) => {
|
|||
<QTable
|
||||
:columns="ticketColumns"
|
||||
:rows="entity?.tickets"
|
||||
:rows-per-page-options="[0]"
|
||||
row-key="id"
|
||||
flat
|
||||
hide-pagination
|
||||
>
|
||||
<template #body-cell-city="{ value, row }">
|
||||
<QTd auto-width>
|
||||
|
|
|
@ -105,8 +105,6 @@ function downloadPdfs() {
|
|||
:columns="columns"
|
||||
:rows="rows"
|
||||
:dense="$q.screen.lt.md"
|
||||
:pagination="{ rowsPerPage: null }"
|
||||
hide-pagination
|
||||
row-key="cmrFk"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
|
|
|
@ -275,8 +275,6 @@ const markAsServed = () => {
|
|||
flat
|
||||
row-key="id"
|
||||
selection="multiple"
|
||||
:rows-per-page-options="[0]"
|
||||
hide-pagination
|
||||
:pagination="{ sortBy: 'ID', descending: true }"
|
||||
>
|
||||
<template #body-cell-worker="props">
|
||||
|
|
|
@ -300,7 +300,7 @@ async function setTravelData(travelData) {
|
|||
<QTable
|
||||
:rows="entriesTableRows"
|
||||
:columns="entriesTableColumns"
|
||||
hide-bottom
|
||||
|
||||
row-key="id"
|
||||
class="full-width q-mt-md"
|
||||
>
|
||||
|
@ -365,7 +365,6 @@ async function setTravelData(travelData) {
|
|||
<QTable
|
||||
:rows="thermographs"
|
||||
:columns="thermographsTableColumns"
|
||||
hide-bottom
|
||||
row-key="id"
|
||||
class="full-width q-mt-md"
|
||||
/>
|
||||
|
|
|
@ -453,9 +453,7 @@ const handleDragScroll = (event) => {
|
|||
<QTable
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
hide-bottom
|
||||
row-key="clientId"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
class="full-width"
|
||||
table-style="user-select: none;"
|
||||
@drag="handleDragScroll($event)"
|
||||
|
|
Loading…
Reference in New Issue