[fix] set rowsNumber after load side
This commit is contained in:
parent
f5c6bcff6f
commit
ed0c74b031
|
@ -169,7 +169,7 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import DrinkPriceVolumes from '../components/CalculationTable/DrinkPriceVolumes.vue';
|
import DrinkPriceVolumes from '../components/CalculationTable/DrinkPriceVolumes.vue';
|
||||||
import { defineComponent, onMounted, ComputedRef, computed, ref } from 'vue';
|
import { defineComponent, onBeforeMount, ComputedRef, computed, ref } from 'vue';
|
||||||
import { Drink, usePricelistStore, DrinkPriceVolume } from '../store';
|
import { Drink, usePricelistStore, DrinkPriceVolume } from '../store';
|
||||||
import MinPriceSetting from '../components/MinPriceSetting.vue';
|
import MinPriceSetting from '../components/MinPriceSetting.vue';
|
||||||
import { api, hasPermission } from '@flaschengeist/api';
|
import { api, hasPermission } from '@flaschengeist/api';
|
||||||
|
@ -206,7 +206,7 @@ export default defineComponent({
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const store = usePricelistStore();
|
const store = usePricelistStore();
|
||||||
|
|
||||||
onMounted(() => {
|
onBeforeMount(() => {
|
||||||
//void store.getDrinks();
|
//void store.getDrinks();
|
||||||
onRequest({
|
onRequest({
|
||||||
pagination: pagination.value,
|
pagination: pagination.value,
|
||||||
|
@ -404,16 +404,17 @@ export default defineComponent({
|
||||||
offset: startRow,
|
offset: startRow,
|
||||||
limit: fetchCount,
|
limit: fetchCount,
|
||||||
descending,
|
descending,
|
||||||
search_name: props.filter.value,
|
search_name: props.filter?.value,
|
||||||
search_key: props.filter.key,
|
search_key: props.filter?.key,
|
||||||
});
|
});
|
||||||
pagination.value.page = page;
|
pagination.value.page = page;
|
||||||
pagination.value.rowsPerPage = rowsPerPage;
|
pagination.value.rowsPerPage = rowsPerPage;
|
||||||
pagination.value.sortBy = sortBy;
|
pagination.value.sortBy = sortBy;
|
||||||
pagination.value.descending = descending;
|
pagination.value.descending = descending;
|
||||||
|
console.log('result', result.count);
|
||||||
if (result.count) pagination.value.rowsNumber = result.count;
|
if (result.count) pagination.value.rowsNumber = result.count;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//..
|
console.warn(error)
|
||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue