perf: comments
This commit is contained in:
parent
c212b8e21c
commit
c0823b0f48
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, provide, inject, onMounted } from 'vue';
|
import { ref, computed, inject, onMounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import toDate from 'filters/toDate';
|
import toDate from 'filters/toDate';
|
||||||
|
@ -89,28 +89,30 @@ const store = arrayData.store;
|
||||||
const userParams = ref(useFilterParams($props.dataKey).params);
|
const userParams = ref(useFilterParams($props.dataKey).params);
|
||||||
const userOrders = ref(useFilterParams($props.dataKey).orders);
|
const userOrders = ref(useFilterParams($props.dataKey).orders);
|
||||||
const searchbar = ref(null);
|
const searchbar = ref(null);
|
||||||
defineExpose({ search, params: userParams, remove });
|
const isLoading = ref(false);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
searchbar.value = inject('searchbar');
|
searchbar.value = inject('searchbar');
|
||||||
});
|
});
|
||||||
const isLoading = ref(false);
|
|
||||||
|
defineExpose({ search, params: userParams, remove });
|
||||||
|
|
||||||
async function search(evt) {
|
async function search(evt) {
|
||||||
try {
|
try {
|
||||||
if ($props.useSearchbar) {
|
if ($props.useSearchbar) {
|
||||||
if (!searchbar.value) {
|
if (!searchbar.value) {
|
||||||
console.error('Searchbar not found');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof $props.useSearchbar === 'function') {
|
if (typeof $props.useSearchbar === 'function') {
|
||||||
$props.useSearchbar(userParams.value);
|
$props.useSearchbar(userParams.value);
|
||||||
|
|
||||||
if (Object.keys(userParams.value).length == 0) {
|
if (!Object.keys(userParams.value).length) {
|
||||||
searchbar.value();
|
searchbar.value();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (evt && $props.disableSubmitEvent) debugger;
|
if (evt && $props.disableSubmitEvent) return;
|
||||||
|
|
||||||
store.filter.where = {};
|
store.filter.where = {};
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { computed, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
|
@ -8,7 +8,6 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
import { Notify } from 'quasar';
|
|
||||||
import useNotify from 'src/composables/useNotify';
|
import useNotify from 'src/composables/useNotify';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
Loading…
Reference in New Issue