0
0
Fork 0

fix: quasar build warnings

This commit is contained in:
Javier Segarra 2024-08-19 11:36:12 +02:00
parent 74f335b22e
commit c19585fb1b
9 changed files with 6 additions and 116 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { watch, computed } from 'vue'; import { computed } from 'vue';
import { date } from 'quasar'; import { date } from 'quasar';
import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnPaginate from 'src/components/ui/VnPaginate.vue';
import VnAvatar from '../ui/VnAvatar.vue'; import VnAvatar from '../ui/VnAvatar.vue';

View File

@ -6,7 +6,6 @@ import axios from 'axios';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import FetchData from 'components/FetchData.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import VnConfirm from 'components/ui/VnConfirm.vue'; import VnConfirm from 'components/ui/VnConfirm.vue';
@ -24,7 +23,6 @@ const stateStore = useStateStore();
const quasar = useQuasar(); const quasar = useQuasar();
const tableRef = ref(); const tableRef = ref();
const rolesOptions = ref([]);
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
switch (param) { switch (param) {

View File

@ -1,15 +1,12 @@
<script setup> <script setup>
import axios from 'axios'; import axios from 'axios';
import { computed, ref, toRefs } from 'vue'; import { computed, ref, toRefs } from 'vue';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useVnConfirm } from 'composables/useVnConfirm'; import { useVnConfirm } from 'composables/useVnConfirm';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import CustomerChangePassword from 'src/pages/Customer/components/CustomerChangePassword.vue';
import VnConfirm from 'src/components/ui/VnConfirm.vue'; import VnConfirm from 'src/components/ui/VnConfirm.vue';
import useNotify from 'src/composables/useNotify.js'; import useNotify from 'src/composables/useNotify.js';
const quasar = useQuasar();
const $props = defineProps({ const $props = defineProps({
hasAccount: { hasAccount: {
type: Boolean, type: Boolean,
@ -35,7 +32,7 @@ async function updateStatusAccount(active) {
account.value.hasAccount = active; account.value.hasAccount = active;
const status = active ? 'enable' : 'disable'; const status = active ? 'enable' : 'disable';
quasar.notify({ notify({
message: t(`account.card.${status}Account.success`), message: t(`account.card.${status}Account.success`),
type: 'positive', type: 'positive',
}); });
@ -44,19 +41,11 @@ async function updateStatusUser(active) {
await axios.patch(`VnUsers/${entityId.value}`, { active }); await axios.patch(`VnUsers/${entityId.value}`, { active });
account.value.active = active; account.value.active = active;
const status = active ? 'activate' : 'deactivate'; const status = active ? 'activate' : 'deactivate';
quasar.notify({ notify({
message: t(`account.card.actions.${status}User.success`), message: t(`account.card.actions.${status}User.success`),
type: 'positive', type: 'positive',
}); });
} }
function setPassword() {
quasar.dialog({
component: CustomerChangePassword,
componentProps: {
id: entityId.value,
},
});
}
const showSyncDialog = ref(false); const showSyncDialog = ref(false);
const syncPassword = ref(null); const syncPassword = ref(null);
const shouldSyncPassword = ref(false); const shouldSyncPassword = ref(false);
@ -66,20 +55,11 @@ async function sync() {
await axios.patch(`Accounts/${account.value.name}/sync`, { await axios.patch(`Accounts/${account.value.name}/sync`, {
params, params,
}); });
quasar.notify({ notify({
message: t('account.card.actions.sync.success'), message: t('account.card.actions.sync.success'),
type: 'positive', type: 'positive',
}); });
} }
const removeAccount = async () => {
try {
await axios.delete(`VnUsers/${account.value.id}`);
notify(t('Account removed'), 'positive');
} catch (error) {
console.error('Error deleting user', error);
}
};
</script> </script>
<template> <template>
<VnConfirm <VnConfirm
@ -112,24 +92,6 @@ const removeAccount = async () => {
/> />
</template> </template>
</VnConfirm> </VnConfirm>
<!-- <QItem v-ripple clickable @click="setPassword">
<QItemSection>{{ t('account.card.actions.setPassword') }}</QItemSection>
</QItem>
<QItem
v-if="!account.hasAccount"
v-ripple
clickable
@click="
openConfirmationModal(
t('account.card.actions.enableAccount.title'),
t('account.card.actions.enableAccount.subtitle'),
() => updateStatusAccount(true)
)
"
>
<QItemSection>{{ t('account.card.actions.enableAccount.name') }}</QItemSection>
</QItem> -->
<QItem <QItem
v-if="account.hasAccount" v-if="account.hasAccount"
v-ripple v-ripple
@ -178,10 +140,4 @@ const removeAccount = async () => {
</QItem> </QItem>
<QSeparator /> <QSeparator />
<!-- <QItem @click="removeAccount(id)" v-ripple clickable>
<QItemSection avatar>
<QIcon name="delete" />
</QItemSection>
<QItemSection>{{ t('account.card.actions.delete.name') }}</QItemSection>
</QItem> -->
</template> </template>

View File

@ -4,11 +4,9 @@ import { computed, ref } from 'vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RoleSummary from './Card/RoleSummary.vue'; import RoleSummary from './Card/RoleSummary.vue';
const route = useRoute(); const route = useRoute();
const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
const $props = defineProps({ const $props = defineProps({
id: { id: {

View File

@ -1,8 +1,6 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n';
import CustomerConsumptionFilter from './CustomerConsumptionFilter.vue'; import CustomerConsumptionFilter from './CustomerConsumptionFilter.vue';
import { useStateStore } from 'src/stores/useStateStore'; import { useStateStore } from 'src/stores/useStateStore';
const { t } = useI18n();
</script> </script>
<template> <template>

View File

@ -16,7 +16,6 @@ const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const itemTypesOptions = ref([]); const itemTypesOptions = ref([]);
const itemsWithNameOptions = ref([]);
const intrastatsOptions = ref([]); const intrastatsOptions = ref([]);
const expensesOptions = ref([]); const expensesOptions = ref([]);

View File

@ -1,8 +1,6 @@
<script setup> <script setup>
import { ref, computed, onMounted, reactive } from 'vue'; import { ref, computed, reactive } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue'; import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
@ -11,18 +9,14 @@ import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.v
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue'; import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue'; import TicketSummary from 'src/pages/Ticket/Card/TicketSummary.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { toDateFormat, toTimeFormat } from 'src/filters/date.js'; import { toDateFormat, toTimeFormat } from 'src/filters/date.js';
import { toCurrency, dateRange } from 'src/filters'; import { toCurrency, dateRange } from 'src/filters';
const DEFAULT_AUTO_REFRESH = 1000; const DEFAULT_AUTO_REFRESH = 1000;
const { t } = useI18n(); const { t } = useI18n();
const autoRefresh = ref(false); const autoRefresh = ref(false);
const router = useRouter();
const paginateRef = ref(null); const paginateRef = ref(null);
const workersActiveOptions = ref([]); const workersActiveOptions = ref([]);
const provincesOptions = ref([]); const provincesOptions = ref([]);
@ -57,46 +51,6 @@ function exprBuilder(param, value) {
const filter = { order: ['totalProblems DESC'] }; const filter = { order: ['totalProblems DESC'] };
let params = reactive({}); let params = reactive({});
const applyColumnFilter = async (col) => {
try {
const paramKey = col.columnFilter?.filterParamKey || col.field;
params[paramKey] = col.columnFilter.filterValue;
await paginateRef.value.addFilter(null, params);
} catch (err) {
console.error('Error applying column filter', err);
}
};
const getInputEvents = (col) => {
return col.columnFilter.type === 'select' || col.columnFilter.type === 'date'
? { 'update:modelValue': () => applyColumnFilter(col) }
: {
'keyup.enter': () => applyColumnFilter(col),
};
};
const fetchParams = ($params = {}) => {
const excludedParams = ['search', 'clientFk', 'orderFk', 'refFk', 'scopeDays'];
const hasExcludedParams = excludedParams.some((param) => {
return $params && $params[param] != undefined;
});
const hasParams = Object.entries($params).length;
if (!hasParams || !hasExcludedParams) $params.scopeDays = 1;
if (typeof $params.scopeDays === 'number') {
const from = Date.vnNew();
from.setHours(0, 0, 0, 0);
const to = new Date(from.getTime());
to.setDate(to.getDate() + $params.scopeDays);
to.setHours(23, 59, 59, 999);
Object.assign($params, { from, to });
}
return { tableOrder: 'totalProblems DESC', ...$params };
};
const columns = computed(() => [ const columns = computed(() => [
{ {
label: t('salesTicketsTable.problems'), label: t('salesTicketsTable.problems'),
@ -379,13 +333,6 @@ const redirectToSales = (id) => {
const url = `#/ticket/${id}/sale`; const url = `#/ticket/${id}/sale`;
window.open(url, '_blank'); window.open(url, '_blank');
}; };
// onMounted(async () => {
// const filteredColumns = columns.value.filter((col) => col.name !== 'rowActions');
// allColumnNames.value = filteredColumns.map((col) => col.name);
// params = fetchParams();
// await paginateRef.value.addFilter(null, params);
// });
</script> </script>
<template> <template>

View File

@ -11,7 +11,6 @@ import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import TicketEditManaProxy from './TicketEditMana.vue'; import TicketEditManaProxy from './TicketEditMana.vue';
import VnImg from 'src/components/ui/VnImg.vue'; import VnImg from 'src/components/ui/VnImg.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import TicketSaleMoreActions from './TicketSaleMoreActions.vue'; import TicketSaleMoreActions from './TicketSaleMoreActions.vue';
import TicketTransfer from './TicketTransfer.vue'; import TicketTransfer from './TicketTransfer.vue';

View File

@ -10,11 +10,6 @@ const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const routeName = computed(() => route.name); const routeName = computed(() => route.name);
const customRouteRedirectName = computed(() => {
if (routeName.value === 'ZoneLocations') return null;
return routeName.value;
});
const searchbarMakeFetch = computed(() => routeName.value !== 'ZoneEvents');
const searchBarDataKeys = { const searchBarDataKeys = {
ZoneWarehouses: 'ZoneWarehouses', ZoneWarehouses: 'ZoneWarehouses',
ZoneSummary: 'ZoneSummary', ZoneSummary: 'ZoneSummary',