diff --git a/src/components/ui/VnImg.vue b/src/components/ui/VnImg.vue
index 37072a69e..3996e9ddc 100644
--- a/src/components/ui/VnImg.vue
+++ b/src/components/ui/VnImg.vue
@@ -3,10 +3,14 @@ import { ref, computed, onMounted } from 'vue';
import { useSession } from 'src/composables/useSession';
const $props = defineProps({
- collection: {
+ storage: {
type: [String, Number],
default: 'Images',
},
+ collection: {
+ type: String,
+ default: 'catalog',
+ },
size: {
type: String,
default: '200x200',
@@ -26,9 +30,8 @@ const token = useSession().getTokenMultimedia();
const timeStamp = ref(`timestamp=${Date.now()}`);
const url = computed(
() =>
- `/api/${$props.collection}/catalog/${$props.size}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
+ `/api/${$props.storage}/${$props.collection}/${$props.size}/${$props.id}/download?access_token=${token}&${timeStamp.value}`
);
-const emits = defineEmits(['refresh']);
const reload = (emit = false) => {
timeStamp.value = `timestamp=${Date.now()}`;
};
diff --git a/src/pages/Account/Card/AccountDescriptor.vue b/src/pages/Account/Card/AccountDescriptor.vue
index 2ff8afa33..ddc7c077f 100644
--- a/src/pages/Account/Card/AccountDescriptor.vue
+++ b/src/pages/Account/Card/AccountDescriptor.vue
@@ -6,8 +6,8 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import useCardDescription from 'src/composables/useCardDescription';
import AccountDescriptorMenu from './AccountDescriptorMenu.vue';
-import { useSession } from 'src/composables/useSession';
import FetchData from 'src/components/FetchData.vue';
+import VnImg from 'src/components/ui/VnImg.vue';
const $props = defineProps({
id: {
@@ -19,7 +19,6 @@ const $props = defineProps({
const route = useRoute();
const { t } = useI18n();
-const { getTokenMultimedia } = useSession();
const entityId = computed(() => {
return $props.id || route.params.id;
});
@@ -31,10 +30,6 @@ const filter = {
fields: ['id', 'nickname', 'name', 'role'],
include: { relation: 'role', scope: { fields: ['id', 'name'] } },
};
-function getAccountAvatar() {
- const token = getTokenMultimedia();
- return `/api/Images/user/160x160/${entityId.value}/download?access_token=${token}`;
-}
const hasAccount = ref(false);
@@ -72,7 +67,8 @@ const hasAccount = ref(false);
-
+
+
-
+
diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue
index 50c9502d2..f1f6ada22 100644
--- a/src/pages/Claim/Card/ClaimBasicData.vue
+++ b/src/pages/Claim/Card/ClaimBasicData.vue
@@ -10,12 +10,13 @@ import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import axios from 'axios';
-import { useSession } from 'src/composables/useSession';
+// import { useSession } from 'src/composables/useSession';
+import VnImg from 'src/components/ui/VnImg.vue';
const route = useRoute();
const { t } = useI18n();
-const { getTokenMultimedia } = useSession();
-const token = getTokenMultimedia();
+// const { getTokenMultimedia } = useSession();
+// const token = getTokenMultimedia();
const claimFilter = {
fields: [
@@ -118,9 +119,11 @@ const statesFilter = {
>
-
diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue
index b0c2d60e3..805795522 100644
--- a/src/pages/Customer/Card/CustomerBasicData.vue
+++ b/src/pages/Customer/Card/CustomerBasicData.vue
@@ -3,16 +3,14 @@ import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
-import { useSession } from 'src/composables/useSession';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
+import VnImg from 'src/components/ui/VnImg.vue';
const route = useRoute();
const { t } = useI18n();
-const { getTokenMultimedia } = useSession();
-const token = getTokenMultimedia();
const workers = ref([]);
const workersCopy = ref([]);
@@ -143,10 +141,11 @@ const filterOptions = {
>
-
diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue
index 291b828c9..5da3309d8 100644
--- a/src/pages/Entry/EntryLatestBuys.vue
+++ b/src/pages/Entry/EntryLatestBuys.vue
@@ -16,14 +16,15 @@ import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import { useStateStore } from 'stores/useStateStore';
import { toDate, toCurrency } from 'src/filters';
-import { useSession } from 'composables/useSession';
+// import { useSession } from 'composables/useSession';
import { dashIfEmpty } from 'src/filters';
import { useArrayData } from 'composables/useArrayData';
import RightMenu from 'src/components/common/RightMenu.vue';
+import VnImg from 'src/components/ui/VnImg.vue';
const router = useRouter();
-const { getTokenMultimedia } = useSession();
-const token = getTokenMultimedia();
+// const { getTokenMultimedia } = useSession();
+// const token = getTokenMultimedia();
const stateStore = useStateStore();
const { t } = useI18n();
@@ -695,14 +696,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
-
+
diff --git a/src/pages/Item/Card/ItemDescriptor.vue b/src/pages/Item/Card/ItemDescriptor.vue
index 155c9eb4c..f3eba8c82 100644
--- a/src/pages/Item/Card/ItemDescriptor.vue
+++ b/src/pages/Item/Card/ItemDescriptor.vue
@@ -13,7 +13,6 @@ import ItemDescriptorImage from 'src/pages/Item/Card/ItemDescriptorImage.vue';
import { useState } from 'src/composables/useState';
import useCardDescription from 'src/composables/useCardDescription';
-import { useSession } from 'src/composables/useSession';
import { getUrl } from 'src/composables/getUrl';
import axios from 'axios';
import { dashIfEmpty } from 'src/filters';
@@ -42,14 +41,12 @@ const quasar = useQuasar();
const route = useRoute();
const router = useRouter();
const { t } = useI18n();
-const { getTokenMultimedia } = useSession();
const state = useState();
const user = state.getUser();
const entityId = computed(() => {
return $props.id || route.params.id;
});
-const image = ref(null);
const regularizeStockFormDialog = ref(null);
const item = ref(null);
const available = ref(null);
@@ -67,17 +64,10 @@ const warehouseFk = computed({
});
onMounted(async () => {
- await getItemAvatar();
warehouseFk.value = user.value.warehouseFk;
salixUrl.value = await getUrl('');
});
-const getItemAvatar = async () => {
- const token = getTokenMultimedia();
- const timeStamp = `timestamp=${Date.now()}`;
- image.value = `/api/Images/catalog/200x200/${entityId.value}/download?access_token=${token}&${timeStamp}`;
-};
-
const data = ref(useCardDescription());
const setData = (entity) => {
if (!entity) return;
diff --git a/src/pages/Item/ItemList.vue b/src/pages/Item/ItemList.vue
index 0e40740b9..f1e3629cd 100644
--- a/src/pages/Item/ItemList.vue
+++ b/src/pages/Item/ItemList.vue
@@ -16,17 +16,15 @@ import ItemListFilter from './ItemListFilter.vue';
import { useStateStore } from 'stores/useStateStore';
import { toDateFormat } from 'src/filters/date.js';
-import { useSession } from 'composables/useSession';
import { dashIfEmpty } from 'src/filters';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useVnConfirm } from 'composables/useVnConfirm';
import axios from 'axios';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
+import VnImg from 'src/components/ui/VnImg.vue';
const router = useRouter();
-const { getTokenMultimedia } = useSession();
-const token = getTokenMultimedia();
const stateStore = useStateStore();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
@@ -491,10 +489,9 @@ onUnmounted(() => (stateStore.rightDrawer = false));
-
import { ref, onMounted } from 'vue';
-import { useSession } from 'src/composables/useSession';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
import VnConfirm from 'components/ui/VnConfirm.vue';
+import VnImg from 'src/components/ui/VnImg.vue';
const quasar = useQuasar();
const { t } = useI18n();
-const { getTokenMultimedia } = useSession();
-const token = getTokenMultimedia();
const counters = ref({
alquilerBandeja: { count: 0, id: 96001, title: 'CC Bandeja', isTray: true },
@@ -35,10 +33,6 @@ onMounted(() => {
}
});
-function getUrl(id) {
- return `/api/Images/catalog/200x200/${id}/download?access_token=${token}`;
-}
-
async function handleEvent(type, action, amount) {
const counter = counters.value[type].count;
let isOk = true;
@@ -70,11 +64,7 @@ function confirm() {
-
+
{{ props.title }}
diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue
index 86c846aca..6739b3356 100644
--- a/src/pages/Worker/Card/WorkerDescriptor.vue
+++ b/src/pages/Worker/Card/WorkerDescriptor.vue
@@ -2,7 +2,6 @@
import { computed, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
-import { useSession } from 'src/composables/useSession';
import CardDescriptor from 'src/components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
@@ -10,6 +9,7 @@ import WorkerChangePasswordForm from 'src/pages/Worker/Card/WorkerChangePassword
import useCardDescription from 'src/composables/useCardDescription';
import { useState } from 'src/composables/useState';
import axios from 'axios';
+import VnImg from 'src/components/ui/VnImg.vue';
const $props = defineProps({
id: {
@@ -25,7 +25,6 @@ const $props = defineProps({
const route = useRoute();
const { t } = useI18n();
-const { getTokenMultimedia } = useSession();
const state = useState();
const user = state.getUser();
const changePasswordFormDialog = ref(null);
@@ -73,11 +72,6 @@ watch(
}
);
-function getWorkerAvatar() {
- const token = getTokenMultimedia();
- return `/api/Images/user/160x160/${entityId.value}/download?access_token=${token}`;
-}
-
const data = ref(useCardDescription());
const setData = (entity) => {
if (!entity) return;
@@ -155,7 +149,7 @@ const refetch = async () => await cardDescriptorRef.value.getData();
-
+
await cardDescriptorRef.value.getData();