forked from verdnatura/salix-front
perf: remove onMounted and reload
This commit is contained in:
parent
4be559bbe8
commit
f46b78131c
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -11,10 +11,6 @@ const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const customerContactsRef = ref(null);
|
const customerContactsRef = ref(null);
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (customerContactsRef.value) customerContactsRef.value.reload();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="full-width flex justify-center">
|
<div class="full-width flex justify-center">
|
||||||
|
@ -30,6 +26,7 @@ onMounted(() => {
|
||||||
model="CustomerContacts"
|
model="CustomerContacts"
|
||||||
ref="customerContactsRef"
|
ref="customerContactsRef"
|
||||||
url="ClientContacts"
|
url="ClientContacts"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard class="q-pl-lg q-py-md">
|
<QCard class="q-pl-lg q-py-md">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, onMounted } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -21,10 +21,6 @@ const sortEntryObservationOptions = (data) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (entryObservationsRef.value) entryObservationsRef.value.reload();
|
|
||||||
});
|
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
name: 'observationType',
|
name: 'observationType',
|
||||||
|
@ -65,6 +61,7 @@ const columns = computed(() => [
|
||||||
ref="entryObservationsRef"
|
ref="entryObservationsRef"
|
||||||
:data-required="{ entryFk: params.id }"
|
:data-required="{ entryFk: params.id }"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows, validate }">
|
<template #body="{ rows, validate }">
|
||||||
<QTable
|
<QTable
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, nextTick } from 'vue';
|
import { ref, nextTick } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -23,10 +23,6 @@ const focusLastInput = () => {
|
||||||
if (lastInput) lastInput.focus();
|
if (lastInput) lastInput.focus();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
if (itemBarcodeRef.value) itemBarcodeRef.value.reload();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="full-width flex justify-center">
|
<div class="full-width flex justify-center">
|
||||||
|
@ -42,6 +38,7 @@ onMounted(async () => {
|
||||||
model="ItemBarcodes"
|
model="ItemBarcodes"
|
||||||
ref="itemBarcodeRef"
|
ref="itemBarcodeRef"
|
||||||
url="ItemBarcodes"
|
url="ItemBarcodes"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard class="q-px-lg q-py-md">
|
<QCard class="q-px-lg q-py-md">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -44,10 +44,6 @@ const submitTaxes = async (data) => {
|
||||||
console.error('Error saving taxes', err);
|
console.error('Error saving taxes', err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
if (ItemTaxRef.value) ItemTaxRef.value.reload();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -66,6 +62,7 @@ onMounted(async () => {
|
||||||
data-key="ItemTax"
|
data-key="ItemTax"
|
||||||
model="ItemTax"
|
model="ItemTax"
|
||||||
ref="ItemTaxRef"
|
ref="ItemTaxRef"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard class="q-px-lg q-py-md">
|
<QCard class="q-px-lg q-py-md">
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import { onMounted, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import CrudModel from 'components/CrudModel.vue';
|
import CrudModel from 'components/CrudModel.vue';
|
||||||
import RoadmapAddStopForm from "pages/Route/Roadmap/RoadmapAddStopForm.vue";
|
import RoadmapAddStopForm from 'pages/Route/Roadmap/RoadmapAddStopForm.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -21,10 +21,6 @@ const updateDefaultStop = (data) => {
|
||||||
eta.setDate(eta.getDate() + 1);
|
eta.setDate(eta.getDate() + 1);
|
||||||
defaultStop.value.eta = eta.toISOString();
|
defaultStop.value.eta = eta.toISOString();
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (roadmapStopsCrudRef.value) roadmapStopsCrudRef.value.reload();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnSubToolbar />
|
<VnSubToolbar />
|
||||||
|
@ -43,6 +39,7 @@ onMounted(() => {
|
||||||
:filter="{ where: { roadmapFk: route.params?.id } }"
|
:filter="{ where: { roadmapFk: route.params?.id } }"
|
||||||
:default-remove="false"
|
:default-remove="false"
|
||||||
:data-required="defaultStop"
|
:data-required="defaultStop"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard class="q-pa-md">
|
<QCard class="q-pa-md">
|
||||||
|
@ -51,7 +48,10 @@ onMounted(() => {
|
||||||
:key="index"
|
:key="index"
|
||||||
class="row no-wrap"
|
class="row no-wrap"
|
||||||
>
|
>
|
||||||
<RoadmapAddStopForm :roadmap-fk="route.params?.id" :form-data="row" />
|
<RoadmapAddStopForm
|
||||||
|
:roadmap-fk="route.params?.id"
|
||||||
|
:form-data="row"
|
||||||
|
/>
|
||||||
<div class="col-1 row justify-center items-center">
|
<div class="col-1 row justify-center items-center">
|
||||||
<QIcon
|
<QIcon
|
||||||
name="delete"
|
name="delete"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -59,10 +59,6 @@ const setWireTransfer = async () => {
|
||||||
console.error('Error setting wire transfer', err);
|
console.error('Error setting wire transfer', err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (supplierAccountRef.value) supplierAccountRef.value.reload();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -94,6 +90,7 @@ onMounted(() => {
|
||||||
:default-remove="false"
|
:default-remove="false"
|
||||||
:data-required="{ supplierFk: route.params.id }"
|
:data-required="{ supplierFk: route.params.id }"
|
||||||
@save-changes="onChangesSaved()"
|
@save-changes="onChangesSaved()"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard class="q-pa-md">
|
<QCard class="q-pa-md">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRouter, useRoute } from 'vue-router';
|
import { useRouter, useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -26,10 +26,6 @@ const supplierAgencyFilter = {
|
||||||
const redirectToCreateView = () => {
|
const redirectToCreateView = () => {
|
||||||
router.push({ name: 'SupplierAgencyTermCreate' });
|
router.push({ name: 'SupplierAgencyTermCreate' });
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (supplierAgencyTermRef.value) supplierAgencyTermRef.value.reload();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<FetchData
|
||||||
|
@ -49,6 +45,7 @@ onMounted(() => {
|
||||||
:data-required="{
|
:data-required="{
|
||||||
supplierFk: route.params.id,
|
supplierFk: route.params.id,
|
||||||
}"
|
}"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard class="q-pa-md">
|
<QCard class="q-pa-md">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted, nextTick } from 'vue';
|
import { ref, nextTick } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
@ -19,10 +19,6 @@ const insertRow = () => {
|
||||||
if (lastInput) lastInput.focus();
|
if (lastInput) lastInput.focus();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (supplierContactRef.value) supplierContactRef.value.reload();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -36,6 +32,7 @@ onMounted(() => {
|
||||||
ref="supplierContactRef"
|
ref="supplierContactRef"
|
||||||
:default-remove="false"
|
:default-remove="false"
|
||||||
:data-required="{ supplierFk: route.params.id }"
|
:data-required="{ supplierFk: route.params.id }"
|
||||||
|
auto-load
|
||||||
>
|
>
|
||||||
<template #body="{ rows }">
|
<template #body="{ rows }">
|
||||||
<QCard class="q-pa-md">
|
<QCard class="q-pa-md">
|
||||||
|
|
Loading…
Reference in New Issue