From 98de713341c48069e0d691bef30e2482e52bb90c Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 17 Oct 2023 12:30:37 +0200 Subject: [PATCH] ref #5876 spinner wihout counter --- src/pages/Claim/Card/ClaimPhoto.vue | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/pages/Claim/Card/ClaimPhoto.vue b/src/pages/Claim/Card/ClaimPhoto.vue index dbcaeb80b..0b4fb0a0b 100644 --- a/src/pages/Claim/Card/ClaimPhoto.vue +++ b/src/pages/Claim/Card/ClaimPhoto.vue @@ -25,8 +25,8 @@ const client = ref({}); const inputFile = ref(); const files = ref({}); + const spinnerRef = ref(); -const progress = ref(0); const claimDmsRef = ref(); const dmsType = ref({}); const config = ref({}); @@ -99,8 +99,13 @@ function setClaimDms(data) { } async function create() { + const formData = new FormData(); const inputFiles = files.value; + for (let i = 0; i < inputFiles.length; i++) + formData.append(inputFiles[i].name, inputFiles[i]); + const query = `claims/${claimId.value}/uploadFile`; + const dms = { hasFile: false, hasFileAttached: false, @@ -114,18 +119,11 @@ async function create() { clientId: client.value.id, }).toUpperCase(), }; - spinnerRef.value.show(); - for (let i = 0; i < inputFiles.length; i++) { - const formData = new FormData(); - formData.append(inputFiles[i].name, inputFiles[i]); - await axios.post(query, formData, { - params: dms, - }); - progress.value = i; - } + await axios.post(query, formData, { + params: dms, + }); spinnerRef.value.hide(); - quasar.notify({ message: t('globals.dataSaved'), type: 'positive', @@ -238,14 +236,7 @@ function onDrag() { - - - - - -

{{ `${progress} de ${files.length} archivos subidos` }}

-
-
+