{"version":3,"sources":["webpack:///./src/views/management/Agent.vue","webpack:///./src/views/management/Agent.vue?4f5a","webpack:///./src/views/management/Agent.vue?3edd","webpack:///./src/views/management/Agent.vue?c38d","webpack:///./src/core/helpers/breadcrumb.ts"],"names":["class","style","align","id","search","searchValue","placeholder","openCreateAgent","data","pagedTableDate","selectAgent","prop","label","filters","filter-method","filterActive","scope","row","layout","page-size","pageSize","page-sizes","pageSizes","small","disabled","background","total","getFilteredAgentList","length","handleSizeChange","setPage","name","components","agents","getAgents","Promise","resolve","reject","ApiService","setHeader","get","then","value","catch","response","Error","errors","filter","toLowerCase","includes","phone","email","page","pageValue","sizes","curr_length","push","i","slice","val","is_active","router","params","render","setCurrentPageBreadcrumbs","pageTitle","breadcrumbs","dispatch","SET_BREADCRUMB_ACTION","title","pageBreadcrumbPath","setCurrentPageTitle"],"mappings":"kJACOA,MAAM,oBAAoBC,MAAA,2B,GAGxBD,MAAM,WAAWE,MAAM,S,GACrBF,MAAM,Q,GAgBRA,MAAM,qBAAqBG,GAAG,c,SAgBUH,MAAM,iD,SAC1BA,MAAM,gD,GAItBE,MAAM,S,8SAzCjB,gCAmBM,MAnBN,EAmBM,C,YAlBJ,gCACM,OADDF,MAAM,yEAAuE,UAElF,gCAeM,MAfN,EAeM,CAdJ,gCAaM,MAbN,EAaM,CAZJ,yBAIiC,G,WAHpB,EAAAI,OAAOC,Y,qCAAP,EAAAD,OAAkB,eAC3BE,YAAY,iBACZN,MAAM,YACNC,MAAA,0B,uBACJ,gCAMS,UALJ,QAAK,oBAAE,EAAAM,iBAAA,EAAAA,mBAAA,IACRP,MAAM,yBACNG,GAAG,uBACN,kBAML,gCAkCM,MAlCN,EAkCM,CAjCF,yBAmBW,GAnBAK,KAAM,EAAAC,eAAgBR,MAAA,qCAAwC,WAAW,EAAAS,a,8BAChF,IAA4E,CAA5E,yBAA4E,GAA3DC,KAAK,eAAeC,MAAM,iBAC3C,yBAA4D,GAA3CD,KAAK,OAAOC,MAAM,SACnC,y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\r\n \r\n \r\n Active\r\n Inactive\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n","\r\nimport { defineComponent, onMounted, computed, ref, reactive, onBeforeMount } from \"vue\";\r\nimport Vue from 'vue';\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport bootstrap from \"bootstrap\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport router from \"@/router\";\r\n\r\nexport default defineComponent({\r\n name: \"agent-list\",\r\n components: {\r\n },\r\n setup() {\r\n const agents = reactive([]);\r\n\r\n const getAgents = async () => {\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"agent\")\r\n .then(({ data }) => {\r\n agents.value = data.data;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getAgents error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n const getFilteredAgentList = () =>{\r\n if(agents.value){\r\n return agents.value.filter(data => !search \r\n || data.name?.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.phone?.toLowerCase().includes(search.searchValue.toLowerCase())\r\n || data.email?.toLowerCase().includes(search.searchValue.toLowerCase()));\r\n }\r\n\r\n return [];\r\n }\r\n\r\n const pageSize = ref(20);\r\n let page = reactive({pageValue : 1});\r\n\r\n const pageSizes = computed(()=>{\r\n let sizes = [20];\r\n let curr_length = getFilteredAgentList().length;\r\n\r\n if(curr_length > 20){\r\n sizes.push(50);\r\n if(curr_length >50){\r\n let i = 0;\r\n while(i{\r\n if(agents.value){\r\n return getFilteredAgentList().slice(pageSize.value * page.pageValue - pageSize.value, pageSize.value * page.pageValue);\r\n }\r\n else{\r\n return [];\r\n }\r\n })\r\n\r\n const search = reactive({searchValue : ''});\r\n\r\n const setPage = (val) => {\r\n page.pageValue = val;\r\n }\r\n\r\n const handleSizeChange = (val: number) => {\r\n pageSize.value = val; \r\n }\r\n\r\n const filterActive = (value, row) => {\r\n return row.is_active === value\r\n }\r\n\r\n const selectAgent= (row) =>{\r\n router.push({ name: \"agent-detail\", params: { id: row.id } });\r\n }\r\n\r\n const openCreateAgent= () =>{\r\n router.push({ name: \"agent-detail\", params: { id: 0 } });\r\n }\r\n\r\n onBeforeMount(async() => {\r\n await getAgents();\r\n })\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(\"Agent\", [\"Management\"]);\r\n });\r\n\r\n return {\r\n setPage,\r\n pagedTableDate,\r\n pageSize,\r\n search,\r\n filterActive,\r\n selectAgent,\r\n agents,\r\n openCreateAgent,\r\n pageSizes,\r\n handleSizeChange,\r\n getFilteredAgentList\r\n };\r\n },\r\n});\r\n","import { render } from \"./Agent.vue?vue&type=template&id=64fc3996\"\nimport script from \"./Agent.vue?vue&type=script&lang=ts\"\nexport * from \"./Agent.vue?vue&type=script&lang=ts\"\n\nimport \"./Agent.vue?vue&type=style&index=0&id=64fc3996&lang=css\"\nscript.render = render\n\nexport default script","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Agent.vue?vue&type=style&index=0&id=64fc3996&lang=css\"","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":""}