{"version":3,"sources":["webpack:///./src/views/DataAnalysis/CompanyReport.vue?17c7","webpack:///./src/views/DataAnalysis/CompanyReport.vue?500e","webpack:///./src/views/DataAnalysis/CompanyReport.vue","webpack:///./src/views/DataAnalysis/CompanyReport.vue?894b","webpack:///./src/core/helpers/breadcrumb.ts"],"names":["_withScopeId","n","_hoisted_1","class","style","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","id","_hoisted_14","role","render","_ctx","_cache","$props","$setup","$data","$options","_component_Multiselect","_component_el_date_picker","_component_Datatable","modelValue","companyList","value","$event","placeholder","mode","searchable","loading","companiesLoading","errortype","date","type","onClick","fetchTableData","args","cardClasses","tableHeader","companyTableData","_","keys","key","name","slotName","fn","company","components","Multiselect","Datatable","props","String","methods","setup","options","Array","Set","companyNames","sortable","errorKeys","Online","Offline","months","1","2","3","4","5","6","7","8","9","10","11","12","companies","push","label","start","Date","end","startYear","getUTCFullYear","getUTCDate","startMonth","getUTCMonth","endMonth","endYear","clear","errorKey","splice","length","forEach","JSON","parse","stringify","payload","companiesData","data","add","slice","sort","c1","c2","year","companyData","undefined","se_account_id","days","month","console","log","day","has","dates","Object","startIndex","findIndex","val","toString","a","b","Number","lastIndex","__exports__","setCurrentPageBreadcrumbs","pageTitle","breadcrumbs","dispatch","SET_BREADCRUMB_ACTION","title","pageBreadcrumbPath","setCurrentPageTitle"],"mappings":"yIAAA,W,qECEMA,EAAe,SAAAC,GAAK,OAAC,yBAAa,mBAAmBA,EAAEA,IAAI,0BAAcA,GACzEC,EAAa,CACjBC,MAAO,kBACPC,MAAO,CAAC,cAAc,QAElBC,EAAa,CAAEF,MAAO,OACtBG,EAAa,CAAEH,MAAO,SACtBI,EAA2BP,GAAa,WAAmB,uCAAoB,OAAQ,CAAEG,MAAO,mBAAqB,kBAAmB,MACxIK,EAAa,CAAEL,MAAO,SACtBM,EAA2BT,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KAAKsB,EAAKO,EAAYE,iB,0GAE/C9E,EAAQL,OAAQ,E,aAKhB,O,WAHAsF,QAAQC,IAAI,GAEZlF,EAAQL,OAAQ,EAChB,I,yBAGJ,MAAO,CACLc,YAAW,EACXP,UAAS,EACTR,YAAW,EACXgB,iBAAgB,EAChBE,KAAI,EACJT,KAAI,EACJH,QAAO,EACPC,iBAAgB,EAChBK,eAAc,M,iCCjRpB,MAAMyF,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAAShH,GAAQ,CAAC,YAAY,qBAE1E,gB,kCCTf,gGAQaiH,EAA4B,SACvCC,EACAC,GAEA,OAAMC,SAAS,OAAQC,sBAAuB,CAC5CC,MAAOJ,EACPK,mBAAoBJ,KAQXK,EAAsB,SAACF,GAClC,OAAMF,SAAS,OAAQC,sBAAuB,CAC5CC,MAAOA","file":"js/chunk-4ade0d78.ffa51067.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./CompanyReport.vue?vue&type=style&index=0&id=f7bc2718&scoped=true&lang=css\"","import { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, mergeProps as _mergeProps, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, normalizeClass as _normalizeClass, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-f7bc2718\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n class: \"container mb-10\",\n style: {\"margin-left\":\"0px\"}\n}\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = { class: \"col-3\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"h5 text-primary\" }, \"Select Company\", -1))\nconst _hoisted_5 = { class: \"col-3\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"h5 text-primary\" }, \"Select Error Type\", -1))\nconst _hoisted_7 = { class: \"col-4\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"h5 text-primary\" }, \"Select Date Range\", -1))\nconst _hoisted_9 = { class: \"col-2 p-0\" }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"btn btn-success topmrng btn-hover-scale\" }, \"Export\", -1))\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"pb-4\" }, [\n /*#__PURE__*/_createElementVNode(\"h4\", { class: \"h4 text-primary w-100\" }, \"Company Report\")\n], -1))\nconst _hoisted_12 = { class: \"card-body pt-0\" }\nconst _hoisted_13 = {\n id: \"kt_referred_users_tab_content\",\n class: \"tab-content\"\n}\nconst _hoisted_14 = {\n id: \"kt_customer_details_invoices_1\",\n class: \"py-0 tab-pane fade active show\",\n role: \"tabpanel\"\n}\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_Multiselect = _resolveComponent(\"Multiselect\")!\n const _component_el_date_picker = _resolveComponent(\"el-date-picker\")!\n const _component_Datatable = _resolveComponent(\"Datatable\")!\n\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _hoisted_4,\n _createVNode(_component_Multiselect, _mergeProps({\n class: \"rounded mt-2\",\n modelValue: _ctx.companyList.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((_ctx.companyList.value) = $event))\n }, _ctx.companyList, {\n placeholder: \"Select the Company\",\n mode: \"tags\",\n \"close-on-select\": false,\n searchable: true,\n \"create-option\": true,\n loading: _ctx.companiesLoading\n }), null, 16, [\"modelValue\", \"loading\"])\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _createVNode(_component_Multiselect, _mergeProps({\n class: \"mt-2\",\n modelValue: _ctx.errortype.value,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((_ctx.errortype.value) = $event))\n }, _ctx.errortype, { placeholder: \"Select the Error Type\" }), null, 16, [\"modelValue\"])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _hoisted_8,\n _createVNode(_component_el_date_picker, {\n class: \"border border-primary rounded mt-2\",\n modelValue: _ctx.date,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((_ctx.date) = $event)),\n type: \"daterange\",\n \"start-placeholder\": \"Start date\",\n \"end-placeholder\": \"End date\"\n }, null, 8, [\"modelValue\"])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _createElementVNode(\"button\", {\n class: \"btn btn-primary topmrng btn-hover-scale\",\n onClick: _cache[3] || (_cache[3] = \n//@ts-ignore\n(...args) => (_ctx.fetchTableData && _ctx.fetchTableData(...args)))\n }, \" Submit \"),\n _hoisted_10\n ])\n ])\n ]),\n _hoisted_11,\n _createElementVNode(\"div\", {\n class: _normalizeClass(`card pt-2 ${_ctx.cardClasses}`)\n }, [\n _createElementVNode(\"div\", _hoisted_12, [\n _createElementVNode(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", _hoisted_14, [\n _createVNode(_component_Datatable, {\n \"table-header\": _ctx.tableHeader,\n \"table-data\": _ctx.companyTableData,\n \"rows-per-page\": 8,\n loading: _ctx.loading,\n \"enable-items-per-page-dropdown\": false\n }, _createSlots({ _: 2 }, [\n _renderList(_ctx.keys, (key) => {\n return {\n name: _ctx.slotName(key),\n fn: _withCtx(({ row: company }) => [\n _createTextVNode(_toDisplayString(company[key]), 1)\n ])\n }\n })\n ]), 1032, [\"table-header\", \"table-data\", \"loading\"])\n ])\n ])\n ])\n ], 2)\n ], 64))\n}","\r\nimport { defineComponent, ref } from \"vue\";\r\nimport Datatable from \"@/components/kt-datatable/KTDatatable.vue\";\r\nimport Multiselect from \"@vueform/multiselect\";\r\nimport { onMounted } from \"vue\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport { getCompaniesData, getCustomersList } from \"@/store/api/devices\";\r\n\r\nexport default defineComponent({\r\n components: {\r\n Multiselect,\r\n Datatable,\r\n },\r\n name: \"kt-invoices\",\r\n props: {\r\n cardClasses: String,\r\n },\r\n methods: {\r\n slotName(name) {\r\n return \"cell-\" + name;\r\n },\r\n },\r\n setup() {\r\n const companyList = ref({ value: [], options: new Array({}) });\r\n const loading = ref(false);\r\n const companiesLoading = ref(false);\r\n const keys = ref>(new Set());\r\n const companyNames = ref>({});\r\n const tableHeader = ref([\r\n {\r\n name: \"Companies\",\r\n key: \"companyName\",\r\n sortable: false,\r\n },\r\n ]);\r\n const errorKeys = {\r\n Online: \"active\",\r\n Offline: \"offline\",\r\n \"511\": \"deviceError\",\r\n };\r\n const date = ref([]);\r\n const months = {\r\n 1: \"Jan\",\r\n 2: \"Feb\",\r\n 3: \"Mar\",\r\n 4: \"Apr\",\r\n 5: \"May\",\r\n 6: \"Jun\",\r\n 7: \"Jul\",\r\n 8: \"Aug\",\r\n 9: \"Sep\",\r\n 10: \"Oct\",\r\n 11: \"Nov\",\r\n 12: \"Dec\",\r\n };\r\n const companyTableData = ref>([]);\r\n onMounted(async () => {\r\n companiesLoading.value = true;\r\n let companies = await getCustomersList();\r\n for (let company of companies) {\r\n companyList.value.options.push({\r\n label: company.name,\r\n value: company.id,\r\n });\r\n companyNames.value[company.id] = company.name;\r\n }\r\n companiesLoading.value = false;\r\n // loadData()\r\n setCurrentPageBreadcrumbs(\"Companies Report\", [\"\"]);\r\n });\r\n const errortype = ref({\r\n value: 0,\r\n options: [\"Online\", \"Offline\", \"511\"],\r\n });\r\n const fetchTableData = async () => {\r\n try {\r\n loading.value = true;\r\n const start = new Date(date.value[0]);\r\n const end = new Date(date.value[1]);\r\n let startYear = start.getUTCFullYear();\r\n let startDate = start.getUTCDate();\r\n let endDate = end.getUTCDate();\r\n let startMonth = start.getUTCMonth() + 1;\r\n let endMonth = end.getUTCMonth() + 1;\r\n let endYear = end.getUTCFullYear();\r\n let companies: any[] = [];\r\n keys.value.clear();\r\n let errorKey = errorKeys[errortype.value.value];\r\n companyTableData.value.splice(0, companyTableData.value.length);\r\n companyList.value.value.forEach((company) => {\r\n companies.push(company);\r\n });\r\n if (companies.length == 0) {\r\n companyList.value.options.forEach((company) => {\r\n companies.push(JSON.parse(JSON.stringify(company)).value);\r\n });\r\n }\r\n\r\n let payload = {\r\n start: `${startYear}-${startMonth}-${startDate}`,\r\n end: `${endYear}-${endMonth}-${endDate}`,\r\n companies,\r\n };\r\n\r\n const companiesData = await getCompaniesData(payload);\r\n\r\n let data: Record = {};\r\n keys.value?.add(\"companyName\");\r\n tableHeader.value = tableHeader.value.slice(0, 1);\r\n companiesData.sort((c1, c2) => {\r\n return c1.year - c2.year;\r\n });\r\n for (let companyData of companiesData) {\r\n if (data[companyData.se_account_id] === undefined) {\r\n data[companyData.se_account_id] = {};\r\n }\r\n let days = JSON.parse(companyData[\"days\"]);\r\n let month = months[companyData.month];\r\n data[companyData.se_account_id][\"companyName\"] =\r\n companyNames.value[companyData.se_account_id];\r\n\r\n if (companyData.year < startYear || companyData.year > endYear) {\r\n console.log(\"data out of range\");\r\n } else if (\r\n (companyData.year == startYear && companyData.month < startMonth) ||\r\n (companyData.year == endYear && companyData.month > endMonth)\r\n ) {\r\n console.log(\"data out of range\");\r\n } else {\r\n if (companyData.year != endYear) {\r\n if (\r\n companyData.month != startMonth &&\r\n companyData.month != endMonth\r\n ) {\r\n for (let day in days) {\r\n if (!keys.value.has(`value-${month}${day}`)) {\r\n tableHeader.value.push({\r\n name: `${month}-${day}`,\r\n key: `value-${month}${day}`,\r\n sortable: false,\r\n });\r\n keys.value.add(`value-${month}${day}`);\r\n }\r\n data[companyData.se_account_id][`value-${month}${day}`] =\r\n days[day][errorKey];\r\n }\r\n } else if (companyData.month == startMonth) {\r\n let dates = Object.keys(days);\r\n let startIndex = dates.findIndex(\r\n (val) => val === startDate.toString()\r\n );\r\n if (startIndex >= 0) {\r\n dates = dates.slice(startIndex);\r\n }\r\n for (let day of dates) {\r\n if (!keys.value.has(`value-${month}${day}`)) {\r\n tableHeader.value.push({\r\n name: `${month}-${day}`,\r\n key: `value-${month}${day}`,\r\n sortable: false,\r\n });\r\n keys.value.add(`value-${month}${day}`);\r\n }\r\n data[companyData.se_account_id][`value-${month}${day}`] =\r\n days[day][errorKey];\r\n }\r\n }\r\n } else {\r\n if (\r\n companyData.month != startMonth &&\r\n companyData.month != endMonth\r\n ) {\r\n for (let day in days) {\r\n if (!keys.value.has(`value-${month}${day}`)) {\r\n tableHeader.value.push({\r\n name: `${month}-${day}`,\r\n key: `value-${month}${day}`,\r\n sortable: false,\r\n });\r\n keys.value.add(`value-${month}${day}`);\r\n }\r\n data[companyData.se_account_id][`value-${month}${day}`] =\r\n days[day][errorKey];\r\n }\r\n } else if (companyData.month == startMonth) {\r\n let dates = Object.keys(days).sort(\r\n (a, b) => Number(a) - Number(b)\r\n );\r\n if (companyData.month == endMonth) {\r\n let startIndex = dates.findIndex(\r\n (val) => val === startDate.toString()\r\n );\r\n let lastIndex = dates.findIndex(\r\n (val) => val === endDate.toString()\r\n );\r\n\r\n if (startIndex < 0 || lastIndex < 0) {\r\n if (startIndex < 0 && lastIndex < 0) {\r\n if (\r\n endDate < Number(dates[0]) ||\r\n startDate > Number(dates[dates.length - 1])\r\n ) {\r\n dates = [];\r\n }\r\n } else if (startIndex < 0) {\r\n dates = dates.slice(0, lastIndex + 1);\r\n } else {\r\n dates = dates.slice(startIndex);\r\n }\r\n } else {\r\n dates = dates.slice(startIndex, lastIndex + 1);\r\n }\r\n } else {\r\n let startIndex = dates.findIndex(\r\n (val) => val === startDate.toString()\r\n );\r\n if (startIndex >= 0) {\r\n dates = dates.slice(startIndex);\r\n } else {\r\n dates = dates.slice(0);\r\n }\r\n }\r\n\r\n for (let day of dates) {\r\n if (!keys.value.has(`value-${month}${day}`)) {\r\n tableHeader.value.push({\r\n name: `${month}-${day}`,\r\n key: `value-${month}${day}`,\r\n sortable: false,\r\n });\r\n keys.value.add(`value-${month}${day}`);\r\n }\r\n\r\n data[companyData.se_account_id][`value-${month}${day}`] =\r\n days[day][errorKey];\r\n }\r\n } else if (companyData.month == endMonth) {\r\n let dates = Object.keys(days);\r\n let lastIndex = dates.findIndex(\r\n (val) => val === endDate.toString()\r\n );\r\n if (lastIndex >= 0) {\r\n dates = dates.slice(0, lastIndex + 1);\r\n } else {\r\n dates = dates.slice(0);\r\n }\r\n for (let day of dates) {\r\n if (!keys.value.has(`value-${month}${day}`)) {\r\n tableHeader.value.push({\r\n name: `${month}-${day}`,\r\n key: `value-${month}${day}`,\r\n sortable: false,\r\n });\r\n keys.value.add(`value-${month}${day}`);\r\n }\r\n data[companyData.se_account_id][`value-${month}${day}`] =\r\n days[day][errorKey];\r\n }\r\n }\r\n }\r\n }\r\n companyTableData.value.push(data[companyData.se_account_id]);\r\n }\r\n loading.value = false;\r\n } catch (error) {\r\n console.log(error);\r\n\r\n loading.value = false;\r\n return;\r\n }\r\n };\r\n return {\r\n tableHeader,\r\n errortype,\r\n companyList,\r\n companyTableData,\r\n keys,\r\n date,\r\n loading,\r\n companiesLoading,\r\n fetchTableData,\r\n };\r\n },\r\n});\r\n","import { render } from \"./CompanyReport.vue?vue&type=template&id=f7bc2718&scoped=true&ts=true\"\nimport script from \"./CompanyReport.vue?vue&type=script&lang=ts\"\nexport * from \"./CompanyReport.vue?vue&type=script&lang=ts\"\n\nimport \"./CompanyReport.vue?vue&type=style&index=0&id=f7bc2718&scoped=true&lang=css\"\n\nimport exportComponent from \"C:\\\\Smartends\\\\bb-admin-panel-frontend\\\\node_modules\\\\@vue\\\\cli-service\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-f7bc2718\"]])\n\nexport default __exports__","import store from \"@/store\";\r\nimport { Actions } from \"@/store/enums/StoreEnums\";\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} pageTitle Current page title\r\n * @param {Array} breadcrumbs Current page breadcrumbs\r\n */\r\nexport const setCurrentPageBreadcrumbs = (\r\n pageTitle: string,\r\n breadcrumbs: Array\r\n): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: pageTitle,\r\n pageBreadcrumbPath: breadcrumbs,\r\n });\r\n};\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} title Current page title name\r\n */\r\nexport const setCurrentPageTitle = (title: string): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: title,\r\n });\r\n};\r\n"],"sourceRoot":""}