{"version":3,"sources":["webpack:///./src/helpers/firebaseDB.js","webpack:///./node_modules/firebase/storage/dist/index.esm.js","webpack:///./src/components/report/ReportListFiles.vue?0beb","webpack:///./src/components/report/ReportListFiles.vue?b794","webpack:///src/components/report/ReportListFiles.vue","webpack:///./src/components/report/ReportListFiles.vue?62a4","webpack:///./src/components/report/ReportListFiles.vue","webpack:///./src/models/UploadedFile.js","webpack:///./src/store/common/moduleCommonState.js","webpack:///./src/store/common/moduleCommonMutations.js","webpack:///./src/store/common/moduleCommonActions.js","webpack:///./src/store/common/moduleCommonGetters.js","webpack:///./src/store/common/moduleCommon.js","webpack:///./src/models/UploadFile.js","webpack:///./src/store/report/moduleReportState.js","webpack:///./src/store/report/moduleReportMutations.js","webpack:///./src/helpers/payloadGenerator.js","webpack:///./src/store/report/moduleReportActions.js","webpack:///./src/store/report/moduleReportGetters.js","webpack:///./src/store/report/moduleReport.js"],"names":["firebase","database","uploadFileToFirebase","filed","path","that","this","user","User","getUser","userInfo","Promise","resolve","reject","storageRef","storage","ref","file","metadata","contentType","type","uniqueId","Date","getTime","uploadTask","child","company_id","name","put","on","TaskEvent","STATE_CHANGED","snapshot","progress","bytesTransferred","totalBytes","progressPercent","state","TaskState","PAUSED","RUNNING","error","code","getDownloadURL","then","downloadURL","urls","bucketPath","downloadFileFromFirebase","starsRef","url","catch","updateFirebaseMessage","message","key","resource_id","set","deleteFireabseMessage","remove","sendFirebaseResourceNotifications","notification","resourceId","eventId","uploadCompanyLogo","deleteFileToFirebase","fileName","desertRef","delete","Error","removeFileFromFirebase","listAllFilesFromFirebaseFolder","folderName","listRef","listAll","listFiles","items","length","render","_vm","_h","$createElement","_c","_self","attrs","staticClass","_v","_s","$t","reportSelected","report_type","dataFiles","handleBack","itemsPerPage","scopedSlots","_u","fn","data","_l","tr","indextr","id","original_name","added_on","refInFor","$event","stopPropagation","download","openConfirm","model","value","callback","$$v","selected","expression","slot","currentPage","queriedItems","activeAlert","$route","params","staticRenderFns","component","UploadedFile","bucket_path","category_id","category_json_base","category_name","is_public","process_state","typology_id","typology_name","update_on","UploadFile","countries","countries_sitidata","cities","departments","dataSelectVisitPoint","config_list","role","status","category","typology","ADD_COMPANY","item","resources","unshift","SET_DATA_SELECTS","SET_CITIES","SET_COUNTRIES","SET_COUNTRIES_SITIDATA","SET_DEPARTMENTS","REMOVE_RESOURCE","itemId","ItemIndex","findIndex","p","splice","SET_CATEGORIES","categories","SET_ROLES_STATUS_CATEGORIES_TYPOLOGIES","fetchDataListResource","commit","Api","get","res","err","getCountries","payload","country","department","city","world_code","only","fields","post","getCountriesByTokenSitiData","getDepartments","getDepartmentsByCityCountry","getAllCities","getCitiesByDeparment","departament","fetchResourceById","fetchDataSelectVisitPoint","fetchDataRoleStatusCategoryTypology","isRegistered","namespaced","mutations","actions","getters","role_id","job_id","upload_type","object_type","url_file","uploadFile","IndexedDB","save","getAll","filename","text","element","document","createElement","setAttribute","encodeURIComponent","style","display","body","appendChild","click","removeChild","fetch","resp","blob","window","URL","createObjectURL","a","href","revokeObjectURL","downloads","files","ADD_DOWNLOAD_REPORT","downloadReport","SET_DOWNLOAD_REPORTS","downloadReports","DELETE_DOWNLOAD_REPORT","process_id","REMOVE_FILE_DOWNLOAD_REPORT","ItemIndexFile","numFile","num_files","CLEAN_DOWNLOAD_REPORTS","SET_FILES_REPORT","payloadGenerator","page","quantity","sort","filters","order_by","resolveFields","match_filter","Object","keys","forEach","createReport","reportType","response","createVisitPointReport","getHistoryReport","group_by_process","processData","push","deleteHistoryReport","getHistoryReportsFilter","records","getProcessFilter","getItem","processId","find","getReportByProcessId","getFiles"],"mappings":"2mCAIiBA,IAASC,WAA1B,IAoBMC,EAAoB,yDAAG,WAAgBC,EAAOC,GAAvB,kGACtBC,EAAOC,KACPC,EAAO,IAAIC,OAFW,SAGLD,EAAKE,UAHA,cAGtBC,EAHsB,yBAIrB,IAAIC,SAAQ,SAAUC,EAASC,GAErC,IAAMC,EAAad,IAASe,UAAUC,MAEhCC,EAAOd,E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OAAIY,KAAK,kBAAmBP,GAzEtC,UAyEPgF,EAzEO,QA0ETA,EAASxJ,KAAKgK,QA1EL,wBA2EZ9F,EAAO,uBAAwBsF,EAASxJ,KAAKgK,SA3EjC,kBA4ELR,GA5EK,iCA8ELA,GA9EK,wGCXA,G,UAAA,CACdU,QAAS,SAAC7N,GAAD,OAAW,SAAC8N,GAAD,OAAe9N,EAAMwL,UAAUuC,MAAK,SAAC1J,GAAD,OAAcA,EAAS0H,aAAe+B,OAC9FE,qBAAsB,SAAChO,GAAD,OAAW,SAAC8N,GAAD,OAAe9N,EAAMwL,UAAUuC,MAAK,SAAC1J,GAAD,OAAcA,EAASN,KAAO+J,OACnGG,SAAU,SAACjO,GAAD,OAAWA,EAAMyL,SCWb,QACdpC,YAAY,EACZrJ,QACAsJ,YACAC,UACAC","file":"js/chunk-156afa6c.e1f60094.js","sourcesContent":["import firebase from \"firebase/app\";\nimport \"firebase/storage\";\nimport User from \"@/models/User.js\";\n\nconst database = firebase.database();\nconst settings = {\n\ttimestampsInSnapshots: true,\n};\nconst loadFirestore = () => {\n\tvar db = firebase.firestore();\n\treturn db.collection(\"cerberus_PositionRecord\").get();\n};\nconst getResourceTracking = async (positionrecordId, companyId) => {\n\tconst starCountRef = database.ref(\"tracking/\" + companyId + \"/\" + positionrecordId);\n\tstarCountRef.on(\"value\", (snapshot) => {\n\t\tconst data = snapshot.val();\n\t});\n};\n/**\n *\n * @param {File} filed is file to got forn input type file\n * @param {*} path is the directory path of the firebase\n * @returns\n */\nconst uploadFileToFirebase = async function (filed, path) {\n\tconst that = this;\n\tconst user = new User();\n\tconst userInfo = await user.getUser();\n\treturn new Promise(function (resolve, reject) {\n\t\t// Create a root reference\n\t\tconst storageRef = firebase.storage().ref();\n\t\t// File or Blob named mountains.jpg\n\t\tconst file = filed;\n\t\t// Create the file metadata\n\t\tconst metadata = {\n\t\t\tcontentType: file.type,\n\t\t};\n\t\t// create unique identify date\n\t\tconst uniqueId = new Date().getTime();\n\t\t// Upload file and metadata to the object 'images/mountains.jpg'\n\t\tconst uploadTask = storageRef\n\t\t\t.child(`${userInfo.company_id}${path}${uniqueId}-${file.name}`)\n\t\t\t.put(file, metadata);\n\t\t// Listen for state changes, errors, and completion of the upload.\n\t\tuploadTask.on(\n\t\t\tfirebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n\t\t\tfunction (snapshot) {\n\t\t\t\t// Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n\t\t\t\tlet progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n\t\t\t\tthat.progressPercent = progress;\n\t\t\t\tswitch (snapshot.state) {\n\t\t\t\t\tcase firebase.storage.TaskState.PAUSED: // or 'paused'\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase firebase.storage.TaskState.RUNNING: // or 'running'\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction (error) {\n\t\t\t\t// A full list of error codes is available at\n\t\t\t\t// https://firebase.google.com/docs/storage/web/handle-errors\n\t\t\t\tswitch (error.code) {\n\t\t\t\t\tcase \"storage/unauthorized\":\n\t\t\t\t\t\t// User doesn't have permission to access the object\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/canceled\":\n\t\t\t\t\t\t// User canceled the upload\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/unknown\":\n\t\t\t\t\t\t// Unknown error occurred, inspect error.serverResponse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treject(error);\n\t\t\t},\n\t\t\tfunction () {\n\t\t\t\t// Upload completed successfully, now we can get the download URL\n\t\t\t\tuploadTask.snapshot.ref.getDownloadURL().then(function (downloadURL) {\n\t\t\t\t\tconst urls = {\n\t\t\t\t\t\tdownloadURL,\n\t\t\t\t\t\tbucketPath: `${userInfo.company_id}${path}${uniqueId}-${file.name}`,\n\t\t\t\t\t};\n\t\t\t\t\tresolve(urls);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t});\n};\nconst downloadFileFromFirebase = async function (path) {\n\tconst user = new User();\n\tconst userInfo = await user.getUser();\n\treturn new Promise(function (resolve, reject) {\n\t\t// Create a root reference\n\t\tconst storageRef = firebase.storage().ref();\n\t\t// Create a reference to the file we want to download\n\t\tconst starsRef = storageRef.child(path);\n\t\t// Get the download URL\n\t\tstarsRef\n\t\t\t.getDownloadURL()\n\t\t\t.then(function (url) {\n\t\t\t\t// Insert url into an tag to \"download\"\n\t\t\t\tresolve(url);\n\t\t\t})\n\t\t\t.catch(function (error) {\n\t\t\t\t// A full list of error codes is available at\n\t\t\t\t// https://firebase.google.com/docs/storage/web/handle-errors\n\t\t\t\tswitch (error.code) {\n\t\t\t\t\tcase \"storage/object-not-found\":\n\t\t\t\t\t\t// File doesn't exist\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/unauthorized\":\n\t\t\t\t\t\t// User doesn't have permission to access the object\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/canceled\":\n\t\t\t\t\t\t// User canceled the upload\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/unknown\":\n\t\t\t\t\t\t// Unknown error occurred, inspect the server response\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treject(error);\n\t\t\t});\n\t});\n};\nconst downloadFileFromStorage = function (gsPath) {\n\treturn new Promise(function (resolve, reject) {\n\t\t// Create a root reference\n\t\tvar storage = firebase.storage();\n\t\t// Create a reference from a Google Cloud Storage URI\n\t\tvar gsReference = storage.refFromURL(gsPath);\n\t\t// Get the download URL\n\t\tgsReference\n\t\t\t.getDownloadURL()\n\t\t\t.then(function (url) {\n\t\t\t\t// Insert url into an tag to \"download\"\n\t\t\t\tresolve(url);\n\t\t\t})\n\t\t\t.catch(function (error) {\n\t\t\t\t// A full list of error codes is available at\n\t\t\t\t// https://firebase.google.com/docs/storage/web/handle-errors\n\t\t\t\tswitch (error.code) {\n\t\t\t\t\tcase \"storage/object-not-found\":\n\t\t\t\t\t\t// File doesn't exist\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/unauthorized\":\n\t\t\t\t\t\t// User doesn't have permission to access the object\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/canceled\":\n\t\t\t\t\t\t// User canceled the upload\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/unknown\":\n\t\t\t\t\t\t// Unknown error occurred, inspect the server response\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treject(error);\n\t\t\t});\n\t});\n};\nconst getFirebaseMessageByResourceId = function (resourceid) {\n\treturn new Promise(function (resolve, reject) {\n\t\t// Create a root reference\n\t\tconst database = firebase.database();\n\t\tconst starCountRef = database.ref(`messages/${resourceid}`).orderByChild(\"date\");\n\t\ttry {\n\t\t\tstarCountRef.once(\"value\", (snapshot) => {\n\t\t\t\tconst messages = [];\n\t\t\t\tsnapshot.forEach((childSnapshot) => {\n\t\t\t\t\t// key will be \"ada\" the first time and \"alan\" the second time\n\t\t\t\t\tlet key = childSnapshot.key;\n\t\t\t\t\t// childData will be the actual contents of the child\n\t\t\t\t\tlet childData = {...childSnapshot.val(), id: key};\n\t\t\t\t\tmessages.push(childData);\n\t\t\t\t});\n\t\t\t\tresolve(messages);\n\t\t\t});\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\t});\n};\nconst updateFirebaseMessage = async function (message) {\n\tconst user = new User();\n\tconst userInfo = await user.getUser();\n\treturn new Promise(function (resolve, reject) {\n\t\t// Create a root reference\n\t\tconst {key} = {...message};\n\t\tdelete message.key;\n\t\tconst database = firebase.database();\n\t\tdatabase.ref(`messages/${userInfo.company_id}/${message.resource_id}/${key}`).set(message);\n\t\t//ref(\"PIN/`-KrnO...Ho/PIN\").set(30);\n\t\ttry {\n\t\t\tresolve({message});\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\t});\n};\nconst deleteFireabseMessage = async function (message) {\n\tconst user = new User();\n\tconst userInfo = await user.getUser();\n\treturn new Promise(function (resolve, reject) {\n\t\t// Create a root reference\n\t\tconst {key} = {...message};\n\t\tdelete message.key;\n\t\tconst database = firebase.database();\n\t\tdatabase\n\t\t\t.ref(`messages/${userInfo.company_id}/${message.resource_id}/${key}`)\n\t\t\t.remove()\n\t\t\t.then(function () {\n\t\t\t\tresolve({message: \"Remove succeeded.\"});\n\t\t\t})\n\t\t\t.catch(function (error) {\n\t\t\t\treject(error);\n\t\t\t});\n\t});\n};\nconst sendFirebaseResourceNotifications = function (notification, resourceId, eventId) {\n\treturn new Promise(async function (resolve, reject) {\n\t\ttry {\n\t\t\tconst user = new User();\n\t\t\tconst userInfo = await user.getUser();\n\t\t\tawait firebase\n\t\t\t\t.database()\n\t\t\t\t.ref(`notification/${userInfo.company_id}/movil/${resourceId}/${eventId}`)\n\t\t\t\t.set(notification);\n\t\t\tresolve({notification});\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\t});\n};\nconst uploadCompanyLogo = async function (filed, path) {\n\tconst that = this;\n\n\treturn new Promise(function (resolve, reject) {\n\t\t// Create a root reference\n\t\tconst storageRef = firebase.storage().ref();\n\t\t// File or Blob named mountains.jpg\n\t\tconst file = filed;\n\t\t// Create the file metadata\n\t\tconst metadata = {\n\t\t\tcontentType: file.type,\n\t\t};\n\t\t// create unique identify date\n\t\tconst uniqueId = new Date().getTime();\n\t\t// Upload file and metadata to the object 'images/mountains.jpg'\n\t\tconst uploadTask = storageRef.child(`${path}${uniqueId}-${file.name}`).put(file, metadata);\n\t\t// Listen for state changes, errors, and completion of the upload.\n\t\tuploadTask.on(\n\t\t\tfirebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n\t\t\tfunction (snapshot) {\n\t\t\t\t// Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n\t\t\t\tlet progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n\t\t\t\tthat.progressPercent = progress;\n\t\t\t\tswitch (snapshot.state) {\n\t\t\t\t\tcase firebase.storage.TaskState.PAUSED: // or 'paused'\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase firebase.storage.TaskState.RUNNING: // or 'running'\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction (error) {\n\t\t\t\t// A full list of error codes is available at\n\t\t\t\t// https://firebase.google.com/docs/storage/web/handle-errors\n\t\t\t\tswitch (error.code) {\n\t\t\t\t\tcase \"storage/unauthorized\":\n\t\t\t\t\t\t// User doesn't have permission to access the object\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/canceled\":\n\t\t\t\t\t\t// User canceled the upload\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"storage/unknown\":\n\t\t\t\t\t\t// Unknown error occurred, inspect error.serverResponse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treject(error);\n\t\t\t},\n\t\t\tfunction () {\n\t\t\t\t// Upload completed successfully, now we can get the download URL\n\t\t\t\tuploadTask.snapshot.ref.getDownloadURL().then(function (downloadURL) {\n\t\t\t\t\tconst urls = {\n\t\t\t\t\t\tdownloadURL,\n\t\t\t\t\t\tbucketPath: `${path}${uniqueId}-${file.name}`,\n\t\t\t\t\t};\n\t\t\t\t\tresolve(urls);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t});\n};\n\nconst deleteFileToFirebase = async function (path, fileName) {\n\tconst user = new User();\n\tconst userInfo = await user.getUser();\n\tconst storageRef = firebase.storage().ref();\n\t// Create a reference to the file to delete\n\tconst desertRef = await storageRef.child(`${userInfo.company_id}${path}${fileName}`);\n\tawait desertRef.getDownloadURL().then(() => {\n\t\tdesertRef\n\t\t\t.delete()\n\t\t\t.then(() => {\n\t\t\t\treturn {message: \"Remove succeeded.\"};\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthrow new Error(error);\n\t\t\t});\n\t});\n};\n\nconst removeFileFromFirebase = function (bucketPath) {\n\treturn new Promise(async (resolve, reject) => {\n\t\tconst storageRef = firebase.storage().ref();\n\t\t// Create a reference to the file to delete\n\t\tconst desertRef = storageRef.child(bucketPath);\n\t\ttry {\n\t\t\t// Delete the file\n\t\t\tawait desertRef.delete();\n\t\t\tresolve(\"File deleted\");\n\t\t} catch (error) {\n\t\t\treject(new Error(\"Error delete\"));\n\t\t}\n\t});\n};\n\nconst listAllFilesFromFirebaseFolder = (folderName) => {\n\treturn new Promise(async (resolve, reject) => {\n\t\tconst storageRef = firebase.storage().ref();\n\t\t// Create a reference under which you want to list\n\t\tconst listRef = storageRef.child(folderName);\n\t\ttry {\n\t\t\t// Find all the prefixes and items.\n\t\t\tconst listFiles = await listRef.listAll();\n\t\t\tif (listFiles.items.length > 0) {\n\t\t\t\tresolve(listFiles.items);\n\t\t\t} else {\n\t\t\t\tresolve([]);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treject(new Error(\"Error delete\"));\n\t\t}\n\t});\n};\n\nexport {\n\tloadFirestore,\n\tgetResourceTracking,\n\tuploadFileToFirebase,\n\tdownloadFileFromFirebase,\n\tdownloadFileFromStorage,\n\tgetFirebaseMessageByResourceId,\n\tupdateFirebaseMessage,\n\tdeleteFireabseMessage,\n\tsendFirebaseResourceNotifications,\n\tuploadCompanyLogo,\n\tdeleteFileToFirebase,\n\tremoveFileFromFirebase,\n\tlistAllFilesFromFirebaseFolder,\n};\n","import '@firebase/storage';\n//# sourceMappingURL=index.esm.js.map\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportListFiles.vue?vue&type=style&index=0&lang=scss&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"report-list-view\"}},[_c('vx-card',{attrs:{\"noShadow\":true}},[_c('vx-card',{attrs:{\"noShadow\":true,\"card-border\":\"\"}},[_c('div',{staticClass:\"flex justify-between flex-wrap\"},[_c('div',{staticClass:\"flex justify-start flex-wrap\"},[_c('feather-icon',{staticClass:\"bg-white mr-2 rounded-full\",attrs:{\"icon\":\"FilePlusIcon\",\"svgClasses\":\"w-16 h-16\"}}),_c('div',{staticClass:\"my-3 ml-3\"},[_c('h5',{staticClass:\"mb-2\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.$t(\"Reports.ReportType\"))+\" :\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.reportSelected ? _vm.reportSelected.report_type : \"\")+\"\\n\\t\\t\\t\\t\\t\\t\")]),_c('h5',[_vm._v(_vm._s(_vm.$t(\"Reports.TotalFiles\"))+\" : \"+_vm._s(_vm.dataFiles.length))])])],1),_c('span',[_c('vs-button',{staticClass:\"mt-4\",attrs:{\"icon-pack\":\"feather\",\"icon\":\"icon-arrow-left\",\"type\":\"border\"},on:{\"click\":_vm.handleBack}},[_vm._v(_vm._s(_vm.$t(\"Resource.BackButton\")))])],1)])]),_c('vs-divider'),(_vm.dataFiles.length > 0)?_c('vs-table',{ref:\"table\",attrs:{\"multiple\":false,\"pagination\":\"\",\"max-items\":_vm.itemsPerPage,\"search\":\"\",\"data\":_vm.dataFiles},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar data = ref.data;\nreturn [_c('tbody',_vm._l((data),function(tr,indextr){return _c('vs-tr',{key:indextr,attrs:{\"data\":tr}},[_c('vs-td',[_c('p',{staticClass:\"product-price\"},[_vm._v(_vm._s(tr.id))])]),_c('vs-td',[_c('p',{staticClass:\"product-category\"},[_vm._v(_vm._s(tr.original_name))])]),_c('vs-td',[_c('p',{staticClass:\"product-category\"},[_vm._v(_vm._s(tr.added_on))])]),_c('vs-td',[_c('feather-icon',{ref:\"BtnSave\",refInFor:true,staticClass:\"ml-2\",attrs:{\"title\":_vm.$t('ManualData.DownloadFile'),\"icon\":\"DownloadIcon\",\"svgClasses\":\"w-5 h-5 hover:text-primary stroke-current\"},on:{\"click\":function($event){$event.stopPropagation();return _vm.download(tr)}}}),_c('feather-icon',{staticClass:\"ml-2\",attrs:{\"title\":_vm.$t('Crud.Delete'),\"icon\":\"TrashIcon\",\"svgClasses\":\"w-5 h-5 hover:text-danger stroke-current\"},on:{\"click\":function($event){$event.stopPropagation();return _vm.openConfirm(tr)}}})],1)],1)}),1)]}}],null,false,1904869966),model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v},expression:\"selected\"}},[_c('div',{staticClass:\"flex flex-wrap-reverse items-center flex-grow justify-between\",attrs:{\"slot\":\"header\"},slot:\"header\"},[_c('vs-dropdown',{staticClass:\"cursor-pointer mb-4 mr-4 items-per-page-handler\",attrs:{\"vs-trigger-click\":\"\"}},[_c('div',{staticClass:\"\\n\\t\\t\\t\\t\\t\\t\\tp-4\\n\\t\\t\\t\\t\\t\\t\\tborder border-solid\\n\\t\\t\\t\\t\\t\\t\\td-theme-border-grey-light\\n\\t\\t\\t\\t\\t\\t\\trounded-full\\n\\t\\t\\t\\t\\t\\t\\td-theme-dark-bg\\n\\t\\t\\t\\t\\t\\t\\tcursor-pointer\\n\\t\\t\\t\\t\\t\\t\\tflex\\n\\t\\t\\t\\t\\t\\t\\titems-center\\n\\t\\t\\t\\t\\t\\t\\tjustify-between\\n\\t\\t\\t\\t\\t\\t\\tfont-medium\\n\\t\\t\\t\\t\\t\\t\"},[_c('span',{staticClass:\"mr-2\"},[_vm._v(_vm._s(_vm.currentPage * _vm.itemsPerPage - (_vm.itemsPerPage - 1))+\" -\\n\\t\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.dataFiles.length - _vm.currentPage * _vm.itemsPerPage > 0\n\t\t\t\t\t\t\t\t\t? _vm.currentPage * _vm.itemsPerPage\n\t\t\t\t\t\t\t\t\t: _vm.dataFiles.length)+\"\\n\\t\\t\\t\\t\\t\\t\\tof \"+_vm._s(_vm.queriedItems))]),_c('feather-icon',{attrs:{\"icon\":\"ChevronDownIcon\",\"svgClasses\":\"h-4 w-4\"}})],1),_c('vs-dropdown-menu',[_c('vs-dropdown-item',{on:{\"click\":function($event){_vm.itemsPerPage = 4}}},[_c('span',[_vm._v(\"4\")])]),_c('vs-dropdown-item',{on:{\"click\":function($event){_vm.itemsPerPage = 10}}},[_c('span',[_vm._v(\"10\")])]),_c('vs-dropdown-item',{on:{\"click\":function($event){_vm.itemsPerPage = 15}}},[_c('span',[_vm._v(\"15\")])]),_c('vs-dropdown-item',{on:{\"click\":function($event){_vm.itemsPerPage = 20}}},[_c('span',[_vm._v(\"20\")])])],1)],1)],1),_c('template',{slot:\"thead\"},[_c('vs-th',{attrs:{\"sort-key\":\"name\"}},[_vm._v(\"N\")]),_c('vs-th',{attrs:{\"sort-key\":\"category\"}},[_vm._v(_vm._s(_vm.$t(\"Name\")))]),_c('vs-th',{attrs:{\"sort-key\":\"order_status\"}},[_vm._v(_vm._s(_vm.$t(\"ManualData.AddedOn\")))]),_c('vs-th',[_vm._v(_vm._s(_vm.$t(\"Actions\")))])],1)],2):_c('div',[_c('vs-alert',{attrs:{\"active\":_vm.activeAlert,\"closable\":\"\",\"icon-pack\":\"feather\",\"close-icon\":\"icon-x\",\"color\":\"warning\",\"title\":_vm.$t('Reports.Report')},on:{\"update:active\":function($event){_vm.activeAlert=$event}}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.$t(\"Reports.Report\"))+\": \"+_vm._s(_vm.$route.params.id)+\" \"+_vm._s(_vm.$t(\"Reports.NoDataReport\"))+\"\\n\\t\\t\\t\")])],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportListFiles.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReportListFiles.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ReportListFiles.vue?vue&type=template&id=279492e4&\"\nimport script from \"./ReportListFiles.vue?vue&type=script&lang=js&\"\nexport * from \"./ReportListFiles.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ReportListFiles.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import UploadFile from \"./UploadFile\";\n\nexport default class UploadedFile extends UploadFile {\n\tconstructor({\n\t\tadded_on,\n\t\tbucket_path,\n\t\tcategory_id,\n\t\tcategory_json_base,\n\t\tcategory_name,\n\t\tcompany_id,\n\t\tid,\n\t\tis_public,\n\t\toriginal_name,\n\t\tprocess_state,\n\t\tresource_id,\n\t\ttypology_id,\n\t\ttypology_name,\n\t\tupdate_on,\n\t}) {\n\t\tsuper({bucket_path, id, is_public, original_name, typology_id});\n\t\tthis.added_on = added_on || \"\";\n\t\tthis.category_id = category_id || 0;\n\t\tthis.category_json_base = category_json_base || {};\n\t\tthis.category_name = category_name || \"\";\n\t\tthis.company_id = company_id || 0;\n\t\tthis.process_state = process_state || \"\";\n\t\tthis.resource_id = resource_id || 0;\n\t\tthis.typology_name = typology_name || \"\";\n\t\tthis.update_on = update_on || \"\";\n\t}\n}\n","/*=========================================================================================\n File Name: moduleCompanyState.js\n Description: Calendar Module State\n ----------------------------------------------------------------------------------------\n Item Name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template\n Author: Pixinvent\n Author URL: http://www.themeforest.net/user/pixinvent\n==========================================================================================*/\n\nexport default {\n\tcountries: [],\n\tcountries_sitidata: [],\n\tcities: [],\n\tdepartments: [],\n\tdataSelectVisitPoint: [],\n\tconfig_list: [],\n\trole: [],\n\tstatus: [],\n\tcategory: [],\n\ttypology: [],\n};\n","/*=========================================================================================\n File Name: moduleCompanyMutations.js\n Description: Company Module Mutations\n ----------------------------------------------------------------------------------------\n Item Name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template\n Author: Pixinvent\n Author URL: http://www.themeforest.net/user/pixinvent\n==========================================================================================*/\n\nexport default {\n\tADD_COMPANY(state, item) {\n\t\tstate.resources.unshift(item);\n\t},\n\tSET_DATA_SELECTS(state, data) {\n\t\tstate.dataSelectVisitPoint = data;\n\t},\n\tSET_CITIES(state, data) {\n\t\tstate.cities = data;\n\t},\n\tSET_COUNTRIES(state, data) {\n\t\tstate.countries = data;\n\t},\n\tSET_COUNTRIES_SITIDATA(state, data) {\n\t\tstate.countries_sitidata = data;\n\t},\n\tSET_DEPARTMENTS(state, data) {\n\t\tstate.departments = data;\n\t},\n\tREMOVE_RESOURCE(state, itemId) {\n\t\tconst ItemIndex = state.resources.findIndex((p) => p.id === itemId);\n\t\tstate.resources.splice(ItemIndex, 1);\n\t},\n\t// categories\n\tSET_CATEGORIES(state, categories) {\n\t\t//state.categories = categories\n\t},\n\t// categories\n\tSET_ROLES_STATUS_CATEGORIES_TYPOLOGIES(state, data) {\n\t\tconst {role, status, category, typology} = data;\n\t\tstate.role = role ? role : [];\n\t\tstate.status = status ? status : [];\n\t\tstate.category = category ? category : [];\n\t\tstate.typology = typology ? typology : [];\n\t},\n};\n","/*=========================================================================================\n File Name: moduleCommonActions.js\n Description: Calendar Module Actions\n ----------------------------------------------------------------------------------------\n Item Name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template\n Author: Pixinvent\n Author URL: http://www.themeforest.net/user/pixinvent\n==========================================================================================*/\n\nimport Api from \"@/helpers/api.js\";\n\nexport default {\n\tfetchDataListResource({commit}) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.get(\"/resource\")\n\t\t\t\t.then((res) => {\n\t\t\t\t\tcommit(\"SET_RESOURCES\", res.data);\n\t\t\t\t\tresolve(res);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\t/**\n\t *\n\t * @param {*} param0\n\t */\n\tgetCountries({commit}) {\n\t\tconst payload = {\n\t\t\tcountry: \"\",\n\t\t\tdepartment: \"\",\n\t\t\tcity: \"\",\n\t\t\tworld_code: \"\",\n\t\t\tonly: \"country_name\",\n\t\t\tfields: [],\n\t\t};\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(`/divipola`, payload)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tresolve(res);\n\t\t\t\t\tcommit(\"SET_COUNTRIES\", res.data);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\tgetCountriesByTokenSitiData({commit}) {\n\t\tconst payload = {\n\t\t\tcountry: \"\",\n\t\t\tdepartment: \"\",\n\t\t\tcity: \"\",\n\t\t\tworld_code: \"\",\n\t\t\tonly: \"country_name_sitidata\",\n\t\t\tfields: [],\n\t\t};\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(`/divipola`, payload)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tresolve(res);\n\t\t\t\t\tcommit(\"SET_COUNTRIES_SITIDATA\", res.data);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\tgetDepartments({commit}, country) {\n\t\tconst payload = {\n\t\t\tcountry: country.name,\n\t\t\tdepartment: \"\",\n\t\t\tcity: \"\",\n\t\t\tonly: \"department_name\",\n\t\t\tworld_code: \"\",\n\t\t\tfields: [],\n\t\t};\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(`/divipola`, payload)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tresolve(res);\n\t\t\t\t\tcommit(\"SET_DEPARTMENTS\", res.data);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\tgetDepartmentsByCityCountry({commit}, data) {\n\t\tconst payload = {\n\t\t\tcountry: data.country,\n\t\t\tdepartment: \"\",\n\t\t\tcity: data.city,\n\t\t\tonly: \"department_name\",\n\t\t\tworld_code: \"\",\n\t\t\tfields: [],\n\t\t};\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(`/divipola`, payload)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tresolve(res);\n\t\t\t\t\tcommit(\"SET_DEPARTMENTS\", res.data);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\t/**\n\t *\n\t * @param {*} param0\n\t * @param {*} resourceId\n\t */\n\tgetAllCities({commit}, country) {\n\t\tconst payload = {\n\t\t\tcountry: country.name,\n\t\t\tdepartment: \"\",\n\t\t\tcity: \"\",\n\t\t\tworld_code: \"\",\n\t\t\tfields: [\"city_name\", \"city_id\", \"country_name\"],\n\t\t};\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(`/divipola`, payload)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tresolve(res);\n\t\t\t\t\tcommit(\"SET_CITIES\", res.data);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\t/**\n\t * @description Request a divipola para obtener las ciudades por departamento\n\t * @param {*} param0\n\t * @param {*} departament\n\t */\n\tgetCitiesByDeparment({commit}, departament) {\n\t\tconst payload = {\n\t\t\tcountry: departament.country || \"\",\n\t\t\tdepartment: departament.name,\n\t\t\tcity: \"\",\n\t\t\tworld_code: \"\",\n\t\t\tonly: \"city_name\",\n\t\t\tfields: [\"city_name\", \"department_name\"],\n\t\t};\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(`/divipola`, payload)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tresolve(res);\n\t\t\t\t\tcommit(\"SET_CITIES\", res.data);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\tfetchResourceById({commit}, resourceId) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.get(`/resource/${resourceId}`)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tresolve(res);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\tfetchDataSelectVisitPoint({commit}) {\n\t\tconst payload = {\n\t\t\trole: [],\n\t\t\tstatus: [],\n\t\t\tcategory: \"VISIT_POINT\",\n\t\t\ttypology: [],\n\t\t};\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(\"/role/status/category/typology\", payload)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tcommit(\"SET_DATA_SELECTS\", res.data);\n\t\t\t\t\tresolve(res);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n\t/**\n\t *\n\t * @param {*} param0\n\t * @param {*} category \"RESOURCE\", \"VISIT_POINT\",\n\t */\n\tfetchDataRoleStatusCategoryTypology({commit}, payload = {role: [], status: [], category: \"\", typology: []}) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(\"/role/status/category/typology\", payload)\n\t\t\t\t.then((res) => {\n\t\t\t\t\tcommit(\"SET_ROLES_STATUS_CATEGORIES_TYPOLOGIES\", res.data);\n\t\t\t\t\tresolve(res);\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t},\n};\n","/*=========================================================================================\n File Name: moduleCompanyGetters.js\n Description: Company Module Getters\n ----------------------------------------------------------------------------------------\n Item Name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template\n Author: Pixinvent\n Author URL: http://www.themeforest.net/user/pixinvent\n==========================================================================================*/\n\nexport default {\n\t//getItem: state => (companyId) => state.companies.find((company) => company.id == companyId),\n\t//getAllItem: state => () => state.companies,\n};\n","import state from \"./moduleCommonState.js\";\nimport mutations from \"./moduleCommonMutations.js\";\nimport actions from \"./moduleCommonActions.js\";\nimport getters from \"./moduleCommonGetters.js\";\n\nexport default {\n\tisRegistered: false,\n\tnamespaced: true,\n\tstate,\n\tmutations,\n\tactions,\n\tgetters,\n};\n","import IndexedDB from \"@/helpers/IndexedDB.js\";\n\nexport default class UploadFile {\n\tconstructor({\n\t\tid,\n\t\tbucket_path,\n\t\toriginal_name,\n\t\ttypology_id,\n\t\tis_public,\n\t\trole_id,\n\t\tjob_id,\n\t\tupload_type,\n\t\tobject_type,\n\t\turl_file,\n\t}) {\n\t\tthis.id = id || 0;\n\t\tthis.upload_type = upload_type || \"\";\n\t\tthis.object_type = object_type || \"\";\n\t\tthis.url_file = url_file || \"\";\n\t\tthis.bucket_path = bucket_path || \"\";\n\t\tthis.original_name = original_name || \"\";\n\t\tthis.typology_id = typology_id || 0;\n\t\tthis.is_public = is_public || 0;\n\n\t\tif (this.upload_type === \"RESOURCE\") this.role_id = role_id || 0;\n\t\tif (this.upload_type === \"LAYER\") this.job_id = job_id || \"\";\n\t}\n\n\tasync saveToIndexedDB() {\n\t\tlet uploadFile = this;\n\t\ttry {\n\t\t\tawait IndexedDB.save(\"upload_files\", uploadFile, uploadFile.id);\n\t\t} catch (error) {\n\t\t\tthrow new Error(error);\n\t\t}\n\t}\n\n\tgetUploadedFiles() {\n\t\treturn IndexedDB.getAll(\"upload_files\");\n\t}\n\n\tdownloadFileTxt(filename, text) {\n\t\tlet element = document.createElement(\"a\");\n\t\telement.setAttribute(\"href\", \"data:text/plain;charset=utf-8,\" + encodeURIComponent(text));\n\t\telement.setAttribute(\"download\", filename);\n\t\telement.style.display = \"none\";\n\t\tdocument.body.appendChild(element);\n\t\telement.click();\n\t\tdocument.body.removeChild(element);\n\t}\n\n\tdownloadFile(filename, url) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfetch(url)\n\t\t\t\t.then((resp) => {\n\t\t\t\t\tif (resp.status === 404) {\n\t\t\t\t\t\tthrow new Error(\"Something was wrong\");\n\t\t\t\t\t}\n\t\t\t\t\treturn resp.blob();\n\t\t\t\t})\n\t\t\t\t.then((blob) => {\n\t\t\t\t\tconst url = window.URL.createObjectURL(blob);\n\t\t\t\t\tconst a = document.createElement(\"a\");\n\t\t\t\t\ta.style.display = \"none\";\n\t\t\t\t\ta.href = url;\n\t\t\t\t\t// the filename you want\n\t\t\t\t\ta.download = filename;\n\t\t\t\t\tdocument.body.appendChild(a);\n\t\t\t\t\ta.click();\n\t\t\t\t\twindow.URL.revokeObjectURL(url);\n\t\t\t\t\tresolve(\"ok\");\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t});\n\t}\n}\n","/*=========================================================================================\n File Name: moduleMapState.js\n Description: Todo Module State\n ----------------------------------------------------------------------------------------\n Item Name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template\n Author: Pixinvent\n Author URL: http://www.themeforest.net/user/pixinvent\n==========================================================================================*/\n\nexport default {\n\tdownloads: [],\n\tfiles: [],\n};\n","/*=========================================================================================\n File Name: moduleReportMutations.js\n Description: Report Module Mutations\n ----------------------------------------------------------------------------------------\n Item Name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template\n Author: Pixinvent\n Author URL: http://www.themeforest.net/user/pixinvent\n==========================================================================================*/\n\nexport default {\n\tADD_DOWNLOAD_REPORT(state, downloadReport) {\n\t\tstate.downloads.unshift(downloadReport);\n\t},\n\tSET_DOWNLOAD_REPORTS(state, downloadReports) {\n\t\tstate.downloads = downloadReports;\n\t},\n\tDELETE_DOWNLOAD_REPORT(state, process_id) {\n\t\tconst ItemIndex = state.downloads.findIndex((p) => p.process_id === process_id);\n\t\tstate.downloads.splice(ItemIndex, 1);\n\t},\n\tREMOVE_FILE_DOWNLOAD_REPORT(state, downloadReports) {\n\t\tconst ItemIndex = state.downloads.findIndex((p) => p.process_id === downloadReports.process_id);\n\t\tconst ItemIndexFile = state.downloads[ItemIndex].files.findIndex((p) => p.id === downloadReports.numFile);\n\t\tstate.downloads[ItemIndex].files.splice(ItemIndexFile, 1);\n\t\tstate.downloads[ItemIndex].num_files = state.downloads[ItemIndex].num_files - 1;\n\t},\n\tCLEAN_DOWNLOAD_REPORTS(state) {\n\t\tstate.downloads = [];\n\t},\n\tSET_FILES_REPORT(state, files) {\n\t\tstate.files = files;\n\t},\n};\n","/**\n *\n * @param {Object} params Object with the parameters to use in the payload\n * @param {string} type can be user or truck\n * @returns Object with the payload to use in the request\n */\nexport const payloadGenerator = (params, type) => {\n\t// spread params into var\n\tconst {page, quantity, fields, sort, filters, order_by} = params;\n\n\tconst payload = {\n\t\tpage: page ? page : 1,\n\t\tquantity: quantity ? quantity : 100000,\n\t\tfields: fields && fields.length > 0 ? fields : resolveFields(type),\n\t\tmatch_filter: true,\n\t};\n\n\tif (sort && sort.length > 0) {\n\t\tpayload.sort = sort;\n\t}\n\n\tif (order_by && order_by.length > 0) {\n\t\tpayload.order_by = order_by;\n\t}\n\n\t// add all of properties of filters object to payload\n\n\tif (filters && Object.keys(filters).length > 0) {\n\t\tObject.keys(filters).forEach((key) => {\n\t\t\tpayload[key] = filters[key];\n\t\t});\n\t}\n\treturn payload;\n};\n\n/**\n * @description Resolve the fields for the payload\n * @param {string} type can be user or truck\n * @returns Array with the fields to use in the payload\n */\nconst resolveFields = (type) => {\n\tswitch (type) {\n\t\tcase \"download\":\n\t\t\treturn [\n\t\t\t\t\"id\",\n\t\t\t\t\"report_type\",\n\t\t\t\t\"bucket_path\",\n\t\t\t\t\"original_name\",\n\t\t\t\t\"process_id\",\n\t\t\t\t\"resource_id\",\n\t\t\t\t\"resource_generated\",\n\t\t\t\t\"date_init\",\n\t\t\t\t\"date_end\",\n\t\t\t\t\"is_public\",\n\t\t\t\t\"added_on\",\n\t\t\t\t\"update_on\",\n\t\t\t];\n\t\tcase \"process\":\n\t\t\treturn [\n\t\t\t\t\"id\",\n\t\t\t\t\"report_type\",\n\t\t\t\t\"date_init\",\n\t\t\t\t\"date_end\",\n\t\t\t\t\"resource_id\",\n\t\t\t\t\"added_on\",\n\t\t\t\t\"update_on\",\n\t\t\t\t\"total_download_file\",\n\t\t\t\t\"download_file_id\",\n\t\t\t];\n\t\tdefault:\n\t\t\tbreak;\n\t}\n};\n","/*=========================================================================================\n File Name: moduleReportActions.js\n Description: Report Module Actions\n ----------------------------------------------------------------------------------------\n Item Name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template\n Author: Pixinvent\n Author URL: http://www.themeforest.net/user/pixinvent\n==========================================================================================*/\nimport Api from \"@/helpers/api.js\";\nimport {payloadGenerator} from \"../../helpers/payloadGenerator\";\n\nexport default {\n\tcreateReport({commit}, {reportType, payload}) {\n\t\t// Se agrega la siguiente validacion para cambiar el end-point del servicio cuando es historicalposition\n\t\t// esto para utilizar el nuevo servicio\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(\"/report/\" + reportType, payload)\n\t\t\t\t.then((response) => {\n\t\t\t\t\tresolve(response);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t});\n\t},\n\tcreateVisitPointReport({commit}, payload) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(\"/report/visitpoint\", payload)\n\t\t\t\t.then((response) => {\n\t\t\t\t\tresolve(response);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t});\n\t},\n\tgetHistoryReport({commit}, payload) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.post(\"/downloads\", payload)\n\t\t\t\t.then((response) => {\n\t\t\t\t\tif (payload.group_by_process) {\n\t\t\t\t\t\tconst processData = [];\n\t\t\t\t\t\tObject.keys(response.data).forEach((key) => {\n\t\t\t\t\t\t\tprocessData.push({...response.data[key], process_id: key});\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcommit(\"SET_DOWNLOAD_REPORTS\", processData);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommit(\"SET_DOWNLOAD_REPORTS\", response.data);\n\t\t\t\t\t}\n\t\t\t\t\tresolve(response);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t});\n\t},\n\tdeleteHistoryReport({commit}, payload) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tApi.delete(`/downloads/${payload.process_id}/${payload.numFile}`)\n\t\t\t\t.then((response) => {\n\t\t\t\t\tif (payload.numFile === 0) {\n\t\t\t\t\t\tcommit(\"DELETE_DOWNLOAD_REPORT\", payload.process_id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommit(\"REMOVE_FILE_DOWNLOAD_REPORT\", payload);\n\t\t\t\t\t}\n\t\t\t\t\tresolve(response);\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\treject(error);\n\t\t\t\t});\n\t\t});\n\t},\n\tasync getHistoryReportsFilter({commit}, params) {\n\t\tconst payload = payloadGenerator(params, \"download\");\n\t\tconst response = await Api.post(\"/downloads/filter\", payload);\n\t\tif (response.data.records) {\n\t\t\tcommit(\"SET_FILES_REPORT\", response.data.records);\n\t\t\treturn response.data.records;\n\t\t} else {\n\t\t\treturn response;\n\t\t}\n\t},\n\tasync getProcessFilter({commit}, params) {\n\t\tconst payload = payloadGenerator(params, \"process\");\n\t\tconst response = await Api.post(\"/process/filter\", payload);\n\t\tif (response.data.records) {\n\t\t\tcommit(\"SET_DOWNLOAD_REPORTS\", response.data.records);\n\t\t\treturn response;\n\t\t} else {\n\t\t\treturn response;\n\t\t}\n\t},\n};\n","export default {\n\tgetItem: (state) => (processId) => state.downloads.find((download) => download.process_id === processId),\n\tgetReportByProcessId: (state) => (processId) => state.downloads.find((download) => download.id === processId),\n\tgetFiles: (state) => state.files,\n};\n","/*=========================================================================================\n File Name: moduleReport.js\n Description: Todo Module\n ----------------------------------------------------------------------------------------\n Item Name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template\n Author: Pixinvent\n Author URL: http://www.themeforest.net/user/pixinvent\n==========================================================================================*/\n\nimport state from \"./moduleReportState.js\";\nimport mutations from \"./moduleReportMutations.js\";\nimport actions from \"./moduleReportActions.js\";\nimport getters from \"./moduleReportGetters.js\";\n\nexport default {\n\tnamespaced: true,\n\tstate,\n\tmutations,\n\tactions,\n\tgetters,\n};\n"],"sourceRoot":""}