{"version":3,"sources":["webpack:///./src/views/management/Staff.vue?89af","webpack:///./src/views/management/Staff.vue","webpack:///./src/views/management/Staff.vue?fbd0","webpack:///./src/views/management/Staff.vue?4668","webpack:///./src/core/helpers/breadcrumb.ts"],"names":["class","style","align","id","search","searchValue","placeholder","openCreateStaff","data","pagedTableDate","selectStaff","prop","label","scope","row","first_name","last_name","filters","filter-method","filterActive","layout","page-size","pageSize","page-sizes","pageSizes","small","disabled","background","total","getFilteredStaffList","length","handleSizeChange","setPage","name","components","staffs","getStaffs","Promise","resolve","reject","ApiService","setHeader","get","then","Object","assign","catch","response","Error","errors","page","pageValue","slice","value","filter","toLowerCase","includes","phone","email","type","sizes","curr_length","push","i","val","is_active","router","params","render","setCurrentPageBreadcrumbs","pageTitle","breadcrumbs","dispatch","SET_BREADCRUMB_ACTION","title","pageBreadcrumbPath","setCurrentPageTitle"],"mappings":"yIAAA,W,kECCOA,MAAM,oBAAoBC,MAAA,2B,GAGxBD,MAAM,WAAWE,MAAM,S,GACrBF,MAAM,Q,GAgBRA,MAAM,qBAAqBG,GAAG,c,SAqBUH,MAAM,iD,SAC1BA,MAAM,gD,GAItBE,MAAM,S,8SA9CjB,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,gCAuCM,MAvCN,EAuCM,CAtCF,yBAwBW,GAxBAK,KAAM,EAAAC,eAAgBR,MAAA,qCAAwC,WAAW,EAAAS,a,8BAChF,IAA8D,CAA9D,yBAA8D,GAA7CC,KAAK,WAAWC,MAAM,OACvC,yBAIkB,GAJDD,K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AC5CC,MAAOJ,EACPK,mBAAoBJ,KAQXK,EAAuBF,IAClC,OAAMF,SAAS,OAAQC,sBAAuB,CAC5CC,MAAOA","file":"js/chunk-2f137e6d.07ff2f72.js","sourcesContent":["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!./Staff.vue?vue&type=style&index=0&id=d4186160&lang=css\"","\r\n\r\n\r\n\r\n\r\n","\r\nimport { defineComponent, onMounted, computed, reactive, onBeforeMount, ref } from \"vue\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport router from \"@/router\";\r\n\r\nexport default defineComponent({\r\n name: \"staff-list\",\r\n components: {\r\n },\r\n setup() {\r\n const staffs = reactive([]);\r\n\r\n const getStaffs = async () => {\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"staff\")\r\n .then(({ data }) => {\r\n Object.assign(staffs,data.data);\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getStaffs error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n const pageSize = ref(20);\r\n let page = reactive({pageValue : 1});\r\n\r\n const pagedTableDate = computed(()=>{\r\n if(staffs){\r\n return getFilteredStaffList().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 getFilteredStaffList = () =>{\r\n return staffs.filter(data => !search \r\n || (data.first_name+' '+data.last_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 || data.type?.toLowerCase().includes(search.searchValue.toLowerCase()));\r\n }\r\n\r\n const pageSizes = computed(()=>{\r\n let sizes = [20];\r\n let curr_length = getFilteredStaffList().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 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 selectStaff= (row) =>{\r\n router.push({ name: \"staff-detail\", params: { id: row.id } });\r\n }\r\n\r\n const openCreateStaff= () =>{\r\n router.push({ name: \"staff-detail\", params: { id: 0 } });\r\n }\r\n\r\n onBeforeMount(async() => {\r\n await getStaffs();\r\n })\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(\"Faculty/Staff\", [\"Management\"]);\r\n });\r\n\r\n return {\r\n handleSizeChange,\r\n pagedTableDate,\r\n pageSize,\r\n search,\r\n filterActive,\r\n selectStaff,\r\n staffs,\r\n pageSizes,\r\n getFilteredStaffList,\r\n openCreateStaff,\r\n setPage\r\n };\r\n },\r\n});\r\n","import { render } from \"./Staff.vue?vue&type=template&id=d4186160\"\nimport script from \"./Staff.vue?vue&type=script&lang=ts\"\nexport * from \"./Staff.vue?vue&type=script&lang=ts\"\n\nimport \"./Staff.vue?vue&type=style&index=0&id=d4186160&lang=css\"\nscript.render = render\n\nexport default script","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":""}