{"version":3,"sources":["webpack:///./src/views/UserTrackingHistory.vue","webpack:///./src/views/UserTrackingHistory.vue?af1f","webpack:///./src/views/UserTrackingHistory.vue?dd95","webpack:///./src/views/UserTrackingHistory.vue?6dc6"],"names":["class","$t","label","component","InputDateComponent","selectedDate","onChanged","getTotalLabel","isEnableLabel","isDrawing","arrTrackPoints","arrTrackPointLabel","arrUserTrackingCount","ref","loading","drawingKey","this","document","documentElement","style","overflow","window","scrollTo","initData","projectId","$store","state","project","details","id","dispatch","date","errorHandler","reDrawLeaderLine","$nextTick","$refs","userTrackingFlow","queueMicrotask","drawLeaderLine","InputDate","trackPoints","originalArrTracKPoints","profile","userTrackingDataHistory","userTrackingHistoryCount","totalTrackingCount","reduce","acc","curr","total","trackingCounts","count","components","TrackedDataFlow","CompanyName","BaseInput","name","render","__scopeId"],"mappings":"+OACOA,MAAM,Q,GAEJA,MAAM,wD,EAOX,yBAAM,mB,oTATR,yBAkBM,MAlBN,EAkBM,CAjBJ,yBAAe,GACf,yBAAkG,MAAlG,EAAkG,6BAA7B,EAAAC,GAAE,sBACvE,yBAKE,GAJCC,MAAO,EAAAD,GAAE,iBACTE,UAAW,EAAAC,mB,WACH,EAAAC,a,qDAAA,EAAAA,aAAY,IACpB,SAAQ,EAAAC,W,sDAEX,EACA,yBAAiC,yCAAvB,EAAAC,eAAa,GACvB,yBAME,GALCC,eAAe,EACfR,MAAK,UAAK,EAAAS,UAAS,gBACnBC,eAAgB,EAAAA,eAChBC,mBAAoB,EAAAC,qBACrBC,IAAI,oB,mEAhB0C,EAAAC,a,eAAhC,E,MAAA,E,MAAA,S,4OCoBC,EAArB,yG,0BACE,EAAAL,WAAY,EACZ,EAAAM,WAAa,EACb,EAAAD,SAAU,EACV,EAAAT,aAAe,GAJjB,oEAYQW,KAAKF,QACPG,SAASC,gBAAgBC,MAAMC,SAAW,SAI5CH,SAASC,gBAAgBC,MAAMC,SAAW,SAjB9C,qLAiCIC,OAAOC,SAAS,EAAG,GAjCvB,SA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EkD,MAAON,QA9CpD,GAAiD,QAW/C,gBADC,eAAM,Y,+BAQN,MAlBkB,EAAmB,gBARvC,eAAQ,CACPO,WAAY,CACVC,kBAAA,KACAC,cAAA,KACAC,YAAA,MAEFC,KAAM,yBAEa,W,UChBrB,EAAOC,OAASA,EAChB,EAAOC,UAAY,kBAEJ,gB,kCCRf,W","file":"js/userTrackingHistory.11164c28.js","sourcesContent":["\n\n\n\n\n","\nimport BaseInput from '@/components/BaseInput.vue'\nimport CompanyName from '@/components/CompanyName.vue'\nimport TrackedDataFlow from '@/components/detail/TrackedDataFlow.vue'\nimport InputDate from '@/components/InputDate.vue'\nimport { FETCH_TRACKING_COUNT } from '@/store/actions'\nimport errorHandler from '@/utils/errorHandler'\nimport { sortTrackingPoints } from '@/utils/helpers'\nimport { ITrackpoint, TError, TTrackingDataCount } from 'smartbarcode-web-core/src/utils/types/index'\nimport { cloneDeep } from 'lodash'\nimport { Options, Vue } from 'vue-class-component'\nimport { Watch } from 'vue-property-decorator'\nimport { objectToArray } from 'smartbarcode-web-core/src/utils/helpers'\n@Options({\n components: {\n TrackedDataFlow,\n CompanyName,\n BaseInput,\n },\n name: 'UserTrackingHistory',\n})\nexport default class UserTrackingHistory extends Vue {\n isDrawing = true\n drawingKey = 0\n loading = false\n selectedDate = ''\n\n get InputDateComponent() {\n return InputDate\n }\n\n @Watch('loading')\n onLoadingChanged() {\n if (this.loading) {\n document.documentElement.style.overflow = 'hidden'\n return\n }\n\n document.documentElement.style.overflow = 'auto'\n }\n\n get arrTrackPoints() {\n const trackPoints = this.$store.state.project?.details?.trackPoints\n const arrTrackPoints = objectToArray(trackPoints) || []\n const originalArrTracKPoints = cloneDeep(arrTrackPoints)\n sortTrackingPoints(arrTrackPoints)\n return originalArrTracKPoints\n }\n\n get arrUserTrackingCount() {\n return this.$store.state.profile?.userTrackingDataHistory\n }\n\n async onChanged() {\n window.scrollTo(0, 0)\n await this.initData()\n }\n\n get getTotalLabel() {\n const userTrackingHistoryCount: TTrackingDataCount[] = this.$store.state?.profile?.userTrackingDataHistory\n\n const totalTrackingCount = userTrackingHistoryCount.reduce((acc, curr) => {\n const total = curr.trackingCounts.reduce((acc, curr) => {\n return acc + curr.count\n }, 0)\n return acc + total\n }, 0)\n return this.$t('Total tracking count', { count: totalTrackingCount })\n }\n\n async initData() {\n try {\n this.loading = true\n const projectId = this.$store.state.project?.details?.id || ''\n await this.$store.dispatch(FETCH_TRACKING_COUNT, {\n projectId,\n date: this.selectedDate,\n })\n } catch (error) {\n errorHandler(error as TError)\n } finally {\n this.loading = false\n }\n }\n\n async mounted() {\n try {\n await this.initData()\n await this.reDrawLeaderLine()\n } catch (error) {\n errorHandler(error as TError)\n }\n }\n\n async reDrawLeaderLine() {\n this.drawingKey++\n try {\n this.loading = true\n await this.$nextTick(async () => {\n if (this.$refs.userTrackingFlow) {\n await queueMicrotask(async () => await this.$refs.userTrackingFlow.drawLeaderLine())\n this.isDrawing = false\n this.loading = false\n }\n })\n } catch (e) {\n } finally {\n this.loading = false\n }\n }\n}\n","import { render } from \"./UserTrackingHistory.vue?vue&type=template&id=3858ed90&scoped=true\"\nimport script from \"./UserTrackingHistory.vue?vue&type=script&lang=ts\"\nexport * from \"./UserTrackingHistory.vue?vue&type=script&lang=ts\"\n\nimport \"./UserTrackingHistory.vue?vue&type=style&index=0&id=3858ed90&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-3858ed90\"\n\nexport default script","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader-v16/dist/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-v16/dist/index.js??ref--0-1!./UserTrackingHistory.vue?vue&type=style&index=0&id=3858ed90&lang=scss&scoped=true\""],"sourceRoot":""}