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