This commit is contained in:
parent
c72fa52851
commit
50fbf64cf9
|
@ -64,7 +64,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetch({ append = false, updateRouter = true }) {
|
async function fetch({ append = false, updateRouter = true, totalRows = null }) {
|
||||||
if (!store.url) return;
|
if (!store.url) return;
|
||||||
|
|
||||||
cancelRequest();
|
cancelRequest();
|
||||||
|
@ -107,6 +107,10 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
|
||||||
|
|
||||||
if (params.filter.where || exprFilter)
|
if (params.filter.where || exprFilter)
|
||||||
params.filter.where = { ...params.filter.where, ...exprFilter };
|
params.filter.where = { ...params.filter.where, ...exprFilter };
|
||||||
|
if (totalRows) {
|
||||||
|
params.filter.limit = totalRows;
|
||||||
|
params.filter.skip = 0;
|
||||||
|
}
|
||||||
params.filter = JSON.stringify(params.filter);
|
params.filter = JSON.stringify(params.filter);
|
||||||
|
|
||||||
store.isLoading = true;
|
store.isLoading = true;
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { toCurrency, dateRange, dashIfEmpty } from 'src/filters';
|
||||||
import RightMenu from 'src/components/common/RightMenu.vue';
|
import RightMenu from 'src/components/common/RightMenu.vue';
|
||||||
import MonitorTicketSearchbar from './MonitorTicketSearchbar.vue';
|
import MonitorTicketSearchbar from './MonitorTicketSearchbar.vue';
|
||||||
import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
||||||
|
import { useArrayData } from 'src/composables/useArrayData';
|
||||||
|
|
||||||
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000; // 2min in ms
|
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000; // 2min in ms
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -30,6 +31,7 @@ from.setHours(0, 0, 0, 0);
|
||||||
const to = new Date(from.getTime());
|
const to = new Date(from.getTime());
|
||||||
to.setDate(to.getDate() + 1);
|
to.setDate(to.getDate() + 1);
|
||||||
to.setHours(23, 59, 59, 999);
|
to.setHours(23, 59, 59, 999);
|
||||||
|
const arrayData = useArrayData('saleMonitorTickets');
|
||||||
|
|
||||||
function exprBuilder(param, value) {
|
function exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
|
@ -352,7 +354,13 @@ const openTab = (id) =>
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
@click="$refs.tableRef.reload()"
|
@click="
|
||||||
|
() => {
|
||||||
|
const { limit, skip } = arrayData.store;
|
||||||
|
const nlimit = limit + skip;
|
||||||
|
arrayData.fetch({ totalRows: nlimit });
|
||||||
|
}
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
<QTooltip>{{ $t('globals.refresh') }}</QTooltip>
|
||||||
</QBtn>
|
</QBtn>
|
||||||
|
|
Loading…
Reference in New Issue