File manager - Edit - /home/autoph/public_html/projects/ahg-hr/assets/index.b00d035a.js
Back
import{w as j,L as O}from"./index.2f12c00b.js";import{C as z}from"./index.73a721da.js";import{B as P}from"./index.d5f9070d.js";import{B as q}from"./index.dd345587.js";import{I as B}from"./index.0cc90e2a.js";import{I as G}from"./index.082b43f0.js";import"./lodash.73665e2b.js";import{_ as D,r as l,o as a,c as v,w as u,j as h,d as s,k as N,e as i,b as f,f as b,t as y,m as R,h as I,F as k}from"./index.6f826883.js";import{T as S}from"./TravelApprovalService.9156e9d6.js";import{C as E}from"./CloseButton.d6e96b7d.js";import{D as H}from"./DeleteButton.1177ae51.js";import{E as W}from"./EditButton.234ef2e8.js";/* empty css */import{S as L}from"./SubmitButton.4efa94a6.js";import{V as Y}from"./ViewButton.a34ed5c7.js";import"./jspdf.es.min.9b897a33.js";/* empty css *//* empty css */import"./vue-cleave.min.2c699dc6.js";import{V as T}from"./array.b1e0d30e.js";import{L as M}from"./Loading.a7caf7be.js";import"./vue-quill.snow.8a0635dc.js";/* empty css */import{F as Z}from"./index.8944847c.js";import{F as J}from"./index.30a5caa1.js";import{T as K}from"./index.8e02d38d.js";import{T as Q}from"./index.0885aab1.js";import{D as X}from"./DenyButton.8d66bccd.js";import{U as $}from"./UpdateButton.feaaf9dc.js";import{A as ee}from"./ApproverService.dbafd287.js";import{F as te}from"./FileService.12c44bcb.js";import{M as oe}from"./Multiselect.30f38e61.js";import{F as re}from"./index.025ace30.js";import{f as se}from"./apiUtils.c9d55e6b.js";import{C as ie}from"./index.0abb9ccc.js";import{p as ne,j as ae}from"./scr-1.d9aaecca.js";import{P as le}from"./index.c8e81a7d.js";import{A as de}from"./main.esm.720326be.js";import{A as me}from"./ActionCellRendererApprover.d3695303.js";import"./logo-black.7c15feb3.js";import"./logo-white.b04c5a89.js";import"./transition.75ebe11b.js";import"./EmployeeService.b8be485c.js";import"./es.string.replace.f9ff181c.js";import"./Loading.vue_vue_type_style_index_0_scoped_cbded5a2_lang.feec42bc.js";import"./index.58a64031.js";import"./CompanyService.1b97fd33.js";import"./DealershipService.5b263c9d.js";import"./DepartmentService.b2fb95e4.js";import"./DivisionService.8915c98c.js";import"./EmploymentTypeService.ceebba18.js";import"./GroupService.f006f84b.js";import"./JobClassficationService.2ba440de.js";import"./JobTitleService.bab1c32f.js";import"./SectionService.274b84ab.js";import"./SupportingDocumentService.234d6f89.js";import"./UnitService.d49084c2.js";import"./CitizenshipService.1dbb0db7.js";import"./CivilStatusService.4ad3e9ec.js";import"./ReligionService.ac7b7e5b.js";import"./ck-white.4bf441fa.js";const ce={components:{FileType:re,DenyButton:X,FormModal:J,FormGroup:Z,TextInput:K,Textarea:Q,SubmitButton:L,UpdateButton:$,CloseButton:E,Loading:M,Multiselect:oe,Icon:B,Checkbox:ie},data(){return{currentEmployeeId:this.$store.userSettings.getActiveUser.employees?this.$store.userSettings.getActiveUser.employees.employee_id:"",currentClassificationId:this.$store.userSettings.getActiveUser.employees?this.$store.userSettings.getActiveUser.employees.classification_id:"",currentRecommendingId:"",currentApprovingId:"",btnTitle:"",recommendingOptions:[],approvingOptions:[],recommending:"",approving:"",status:[],companyOptions:[],form:{date_from:"",date_to:"",from_time:"",to_time:"",meal:"",transportation:"",meal_amount:"",transportation_amount:"",destination:"",description:"",attachment:"",recommending_id:"",approver_id:"",charge_to:""},errors:{},state:{isEdit:!1,isSaving:!1,isLoading:!1,isCompanyLoading:!1},fileIcons:{pdf:ne,jpg:ae,default:""}}},methods:{getFileTypeImage(e){if(typeof e=="string"){if(!e)return this.fileIcons.default;const t=e.substring(e.lastIndexOf(".")+1).toLowerCase();return this.fileIcons[t]||this.fileIcons.default}},async viewAttachment(e){if(this.state.isDownloading)return;this.state.isDownloading=!0;let t=await te.Reader2("employee-overtime",e),r;if(e.endsWith(".pdf"))r="application/pdf";else if(e.endsWith(".png"))r="image/png";else if(e.endsWith(".jpg")||e.endsWith(".jpeg"))r="image/jpeg";else if(e.endsWith(".svg"))r="image/svg+xml";else throw new Error("Unsupported file type");const d=atob(t),o=new Array(d.length);for(let m=0;m<d.length;m++)o[m]=d.charCodeAt(m);const c=new Uint8Array(o),p=new Blob([c],{type:r}),g=URL.createObjectURL(p);window.open(g),this.state.isLoadingPDF=!1},handleMainImageUpload(){const e=event.target.files[0];this.form.attachment=e;const t=new FileReader;t.onload=()=>{e.type.startsWith("image/")?this.form.imageView=t.result:e.type==="application/pdf"?this.form.imageView=this.pdf_file_view:e.type==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&(this.form.imageView=this.excel_file_view)},console.log(e),t.readAsDataURL(e)},async loadRecord(e){this.resetForm(),this.form=e,this.form.meal=e.meal==1,this.form.transportation=e.transportation==1,this.form.date_from=new Date(e.date_from).toLocaleDateString("en-CA").split("T")[0],this.form.date_to=new Date(e.date_to).toLocaleDateString("en-CA").split("T")[0],this.currentRecommendingId=e.recommending?e.recommending[0].employee_id:"",this.currentApprovingId=e.approving?e.approving[0].employee_id:"",this.recommending=e.recommending?e.recommending[0].firstname+" "+e.recommending[0].lastname:"",this.approving=e.approving?e.approving[0].firstname+" "+e.approving[0].lastname:"",this.currentApprovingId==this.currentEmployeeId&&this.form.approver_id==this.currentEmployeeId?this.btnTitle="Approve":this.currentRecommendingId==this.currentEmployeeId&&this.form.status<1&&(this.btnTitle="Submit For Approval"),this.currentClassificationId>=3&&await ee.fetchEmployeeApprover(e.employee_id).then(t=>{if(t.status==200)this.recommendingOptions=t.data.map((r,d)=>({value:r.employee_id,label:r.firstname+" "+r.lastname})),this.approvingOptions=t.data.filter(r=>r.classification_id>=3).map((r,d)=>({value:r.employee_id,label:r.firstname+" "+r.lastname}));else throw new Error("Failed to fetch employee approvers")})},closeModal(){this.state.showModal=!1},resetForm(){this.state.isEdit=!1,this.form={date_from:"",date_to:"",from_time:"",to_time:"",meal:"",transportation:"",meal_amount:"",transportation_amount:"",destination:"",description:"",attachment:"",recommending_id:"",approver_id:""}},reload(){return this.$emit("reload")},async updateApproverRecord(){this.state.isSaving=!0;const e=this.form.id;this.state.isSaving=!1;let t={recommending_id:this.form.recommending_id,approver_id:this.form.approver_id};await S.updateApprover(e,t).then(r=>{r.status==201?(this.$swal.fire({title:"Great!",text:"Record successfully updated.",icon:"success",timer:2e3}),this.state.showModal=!1):this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3}),this.reload()}).catch(r=>{r.response.status==422?this.$swal.fire({title:"Ooops! something is wrong.",text:r.response.data.message,icon:"warning"}):this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3})})},async saveRecord(){this.state.isSaving=!0;const e={status:this.status,meal:this.form.meal,transportation:this.form.transportation,meal_amount:this.form.meal_amount,transportation_amount:this.form.transportation_amount};console.log(e);const t=this.form.id;await S.update(t,e).then(r=>{r.status==201?(this.$swal.fire({title:"Great!",text:"Record successfully updated.",icon:"success",timer:2e3}),this.state.isSaving=!1,this.state.showModal=!1):this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3}),this.reload()}).catch(r=>{r.response.status==422?this.$swal.fire({title:"Ooops! something is wrong.",text:r.response.data.message,icon:"warning"}):this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3})})},async submitForm(){this.form.recommending_id==this.currentEmployeeId&&(this.status={status:1}),this.form.approver_id==this.currentEmployeeId&&(this.status={status:2});try{this.$swal.fire({title:"Are you sure you want to save submit this record?",text:"",icon:"question",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes",cancelButtonText:"No"}).then(e=>{e.value&&this.saveRecord()})}catch(e){if(e instanceof T){const t={};e.inner.forEach(r=>{t[r.path]=r.message}),this.errors=t}}},async updateApproverForm(){try{this.$swal.fire({title:"Are you sure you want to update the approver of this record?",text:"",icon:"question",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes",cancelButtonText:"No"}).then(e=>{e.value&&this.updateApproverRecord()})}catch(e){if(e instanceof T){const t={};e.inner.forEach(r=>{t[r.path]=r.message}),this.errors=t}}},async denyForm(){this.status={status:99};try{this.$swal.fire({title:"Are you sure you want to deny this record?",text:"",icon:"question",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes",cancelButtonText:"No",html:` <textarea id="swal-input" style="width: 100%; height: 80px; padding: 8px; border: 1px solid #ced4da; border-radius: 4px;" placeholder="Enter reason"></textarea>`,preConfirm:()=>{const e=document.getElementById("swal-input").value;return e?this.denied_reason=e:(this.$swal.showValidationMessage("The reason field is required"),!1)}}).then(e=>{this.status={status:99,denied_reason:this.denied_reason},e.value&&this.saveRecord()})}catch(e){if(e instanceof T){const t={};e.inner.forEach(r=>{t[r.path]=r.message}),this.errors=t}}},calculateHours(){const e=this.form.from_time,t=this.form.to_time;if(e&&t){const[r,d]=this.form.from_time.split(":").map(Number),[o,c]=this.form.to_time.split(":").map(Number);let p=o-r;p+=(c-d)/60,p<0&&(p+=24),this.form.hours=p}},async fetchCompanyRecords(){try{this.state.isCompanyLoading=!0,this.companyOptions=await se()}catch(e){console.error("Failed to fetch company data:",e)}finally{this.state.isCompanyLoading=!1}}},mounted(){this.fetchCompanyRecords()},watch:{"form.from_time":{handler:"calculateHours",immediate:!0},"form.to_time":{handler:"calculateHours",immediate:!0}}},pe={class:"text-slate-600 dark:text-slate-400 text-sm font-normal"},ue={class:"grid grid-cols-12 gap-4"},fe={class:"col-span-6"},he={key:0,class:"text-[#ec4899]"},ge={class:"col-span-6"},_e={key:0,class:"text-[#ec4899]"},ve={class:"col-span-6"},ye={class:"col-span-6"},xe={class:"col-span-6"},we={key:0,class:"text-red-400"},be={class:"col-span-6"},Ce={class:"col-span-12"},Fe={class:"col-span-12"},Ae={key:1},Ve={class:"grid grid-cols-12 justify-center items-center"},Te={class:"col-span-8 flex justify-between items-center gap-4"},Ie={class:"col-span-6 flex justify-center items-center gap-4"},Se={class:"font-bold"},Re={class:"col-span-6 flex justify-center items-center gap-4"},ke={class:"font-bold"},Be={key:2},De={class:"grid grid-cols-12 gap-4"},Ee={class:"col-span-6"},Le={class:"relative"},Me={class:"col-span-6"},Ue={class:"relative"},je={class:"flex gap-1 justify-end pt-8"},Oe={key:0,class:"flex gap-1 justify-end"},ze={key:1,class:"flex gap-1 justify-end"},Pe={class:"flex gap-1 justify-end"};function qe(e,t,r,d,o,c){const p=l("Loading"),g=l("flat-pickr"),m=l("FormGroup"),x=l("Multiselect"),C=l("TextInput"),F=l("FileType"),A=l("Textarea"),_=l("UpdateButton"),V=l("DenyButton"),w=l("CloseButton"),U=l("FormModal");return a(),v(U,{title:"View Record",active:o.state.showModal,sideTitle:this.form.status==0?"for recommendation":this.form.status==1?"for approval":this.form.status==2&&this.form.validated==1?"Approved & validated":this.form.status==2&&this.form.validated==99?"Denied":this.form.status==2?"for validation":this.form.status==99?"denied":"",badgeColor:this.form.status==0?"warning":this.form.status==1?"info":this.form.status==2&&this.form.validated==1?"success":this.form.status==2&&this.form.validated==99?"danger":this.form.status==2?"purple":this.form.status==99?"danger":"",onSubmit:e.confirmSubmit,onClose:c.closeModal,themeClass:"bg-gray-800",sizeClass:"lg:w-2/4"},{default:u(()=>[o.state.isEdit&&o.state.isLoading?(a(),v(p,{key:0,text:"Fetching record"})):h("",!0),s("div",pe,[s("form",{onSubmit:t[10]||(t[10]=N((...n)=>e.confirmSubmit&&e.confirmSubmit(...n),["prevent"])),class:"space-y-4",enctype:"multipart/form-data"},[o.state.isSaving?(a(),v(p,{key:0,text:"Saving record"})):h("",!0),s("div",ue,[s("div",fe,[i(m,{label:"Date From",isRequired:!0},{default:u(()=>[i(g,{modelValue:o.form.date_from,"onUpdate:modelValue":t[0]||(t[0]=n=>o.form.date_from=n),class:"form-control h-[48px]",id:"date_from",disabled:!0,placeholder:"yyyy, dd M"},null,8,["modelValue"])]),_:1}),o.errors.date_from?(a(),f("div",he,"Date From is required")):h("",!0)]),s("div",ge,[i(m,{label:"Date To",isRequired:!0},{default:u(()=>[i(g,{modelValue:o.form.date_to,"onUpdate:modelValue":t[1]||(t[1]=n=>o.form.date_to=n),class:"form-control h-[48px]",id:"date_to",disabled:!0,placeholder:"yyyy, dd M"},null,8,["modelValue"])]),_:1}),o.errors.date_to?(a(),f("div",_e,"Date To is required")):h("",!0)]),s("div",ve,[i(m,{label:"From Time",isRequired:!0},{default:u(()=>[i(g,{class:"form-control h-[48px]",placeholder:"From time",modelValue:o.form.from_time,"onUpdate:modelValue":t[2]||(t[2]=n=>o.form.from_time=n),disabled:!0,config:{enableTime:!0,noCalendar:!0,dateFormat:"H:i"}},null,8,["modelValue"])]),_:1})]),s("div",ye,[i(m,{label:"To Time",isRequired:!0},{default:u(()=>[i(g,{class:"form-control h-[48px]",placeholder:"To time",modelValue:o.form.to_time,"onUpdate:modelValue":t[3]||(t[3]=n=>o.form.to_time=n),disabled:!0,onChange:c.calculateHours,config:{enableTime:!0,noCalendar:!0,dateFormat:"H:i"}},null,8,["modelValue","onChange"])]),_:1})]),s("div",xe,[i(m,{label:"Charge To"},{default:u(()=>[i(x,{modelValue:o.form.charge_to,"onUpdate:modelValue":t[4]||(t[4]=n=>o.form.charge_to=n),error:o.errors.charge_to,classInput:"h-[48px]",options:o.companyOptions,loading:e.isCompanyLoading,searchable:!0,disabled:!0},null,8,["modelValue","error","options","loading"])]),_:1}),o.errors.charge_to?(a(),f("span",we," Field is required ")):h("",!0)]),s("div",be,[i(m,{label:"Destination"},{default:u(()=>[i(C,{type:"text",modelValue:o.form.destination,"onUpdate:modelValue":t[5]||(t[5]=n=>o.form.destination=n),error:o.errors.destination,disabled:!0,classInput:"h-[48px]"},null,8,["modelValue","error"])]),_:1})]),s("div",Ce,[i(m,{label:"Attachment"},{default:u(()=>[typeof o.form.attachment=="string"?(a(),f("div",{key:0,class:"flex items-center gap-2 mt-2 cursor-pointer",onClick:t[6]||(t[6]=n=>c.viewAttachment(o.form.attachment))},[i(F,{image:c.getFileTypeImage(o.form.attachment)},null,8,["image"]),b(" "+y(o.form.attachment),1)])):h("",!0)]),_:1})]),s("div",Fe,[i(m,{label:"Reason"},{default:u(()=>[i(A,{name:"pn4",placeholder:"Textarea",disabled:!0,modelValue:o.form.description,"onUpdate:modelValue":t[7]||(t[7]=n=>o.form.description=n)},null,8,["modelValue"])]),_:1})])]),o.currentClassificationId<=2?(a(),f("div",Ae,[s("div",Ve,[s("div",Te,[s("div",Ie,[t[11]||(t[11]=b(" Recommending: ")),s("p",Se,y(o.recommending),1)]),s("div",Re,[t[12]||(t[12]=b(" Approving: ")),s("p",ke,y(o.approving),1)])])])])):(a(),f("div",Be,[s("div",De,[s("div",Ee,[i(m,{label:"Recommending"},{default:u(()=>[s("div",Le,[i(x,{modelValue:o.form.recommending_id,"onUpdate:modelValue":t[8]||(t[8]=n=>o.form.recommending_id=n),"close-on-select":!0,searchable:!0,id:"recommending_id",options:o.recommendingOptions},null,8,["modelValue","options"])])]),_:1})]),s("div",Me,[i(m,{label:"Approver"},{default:u(()=>[s("div",Ue,[i(x,{modelValue:o.form.approver_id,"onUpdate:modelValue":t[9]||(t[9]=n=>o.form.approver_id=n),"close-on-select":!0,searchable:!0,id:"approver_id",options:o.approvingOptions},null,8,["modelValue","options"])])]),_:1})])])])),s("div",je,[this.form.status==0&&o.currentRecommendingId==o.currentEmployeeId||o.currentApprovingId==o.currentEmployeeId&&this.form.status==1&&o.currentApprovingId==this.form.approver_id||this.form.approver_id==this.form.recommending_id&&o.currentApprovingId==this.form.approver_id&&o.currentEmployeeId==this.form.approver_id?(a(),f("div",Oe,[this.form.status<=1?(a(),v(_,{key:0,onClick:c.submitForm,text:o.btnTitle},null,8,["onClick","text"])):h("",!0),this.form.status<=1?(a(),v(V,{key:1,onClick:c.denyForm,text:"Deny"},null,8,["onClick"])):h("",!0)])):this.form.status==0&&o.currentApprovingId==o.currentEmployeeId||o.currentApprovingId!=this.form.approver_id?(a(),f("div",ze,[this.form.status<=1?(a(),v(_,{key:0,onClick:c.updateApproverForm,text:"Update Approver"},null,8,["onClick"])):h("",!0)])):h("",!0),s("div",Pe,[i(w,{onClick:c.closeModal},null,8,["onClick"])])])],32)])]),_:1},8,["active","sideTitle","badgeColor","onSubmit","onClose"])}const Ge=D(ce,[["render",qe],["__scopeId","data-v-ded8ad58"]]);const Ne={mixins:[j],components:{ActionCellRendererApprover:me,AgGridVue:de,Pagination:le,Card:z,Button:P,Badge:q,Layout:O,Icon:B,ViewButton:Y,SubmitButton:L,CloseButton:E,EditButton:W,DeleteButton:H,View:Ge,InputGroup:G,Loading:M},data(){return{paginationPageSize:10,paginationPageSizeSelector:[10,25,50],colDefs:[{field:"#",flex:1},{field:"employee id",filter:!0,floatingFilter:!0,flex:3},{field:"name",filter:!0,floatingFilter:!0,flex:4},{field:"date coverage",filter:!0,floatingFilter:!0,flex:3},{field:"time coverage",filter:!0,floatingFilter:!0,flex:3},{field:"destination",filter:!0,floatingFilter:!0},{field:"meal_label",headerName:"Meal",filter:!0,floatingFilter:!0,flex:2},{field:"transportation_label",headerName:"Transporation",filter:!0,floatingFilter:!0,flex:2},{headerName:"Status",field:"status",filter:!0,floatingFilter:!0,valueGetter:e=>{switch(e.data.status){case 0:return"For Recommendation";case 1:return"For Approval";case 2:return e.data.validated==1?"Validated":e.data.validated==99?"Denied":"For Validation";case 99:return"Denied";default:return""}},cellRenderer:e=>{switch(e.value){case"For Recommendation":return'<span class="inline-block rounded-full text-xs capitalize whitespace-nowrap text-center py-1 text-yellow-600 bg-gray-100 px-4">For Recommendation</span>';case"For Approval":return'<span class="inline-block rounded-full text-xs capitalize whitespace-nowrap text-center py-1 text-blue-600 bg-gray-100 px-4">For Approval</span>';case"For Validation":return'<div class="inline-block rounded-full text-xs capitalize whitespace-nowrap text-center py-1 bg-gray-100 text-fuchsia-600 px-4">For Validation</div>';case"Validated":return'<div class="inline-block rounded-full text-xs capitalize whitespace-nowrap text-center py-1 bg-gray-100 text-green-600 px-4">Approved & Validated</div>';case"Denied":return'<span class="inline-block rounded-full text-xs capitalize whitespace-nowrap text-center py-1 text-red-600 bg-gray-100 px-4">Denied</span>';default:return""}}},{headerName:"Actions",cellRenderer:"ActionCellRendererApprover",flex:2,cellRendererParams:{context:{componentParent:this}}}],breadcrumbs:[{text:"Home",href:"/"},{text:"Timekeeping",href:"/attendance/employee-ob"},{text:"OB Application",active:!0}],statistics:[{title:"Pending",count:[{total:0}],bg:"bg-primary-500",text:"text-primary-500",percent:"1.67% ",icon:"heroicons-outline:clock"},{title:"Approved",count:[{total:0}],bg:"bg-info-500",text:"text-info-500",percent:"25.67% ",icon:"heroicons-outline:menu-alt-1"},{title:"Denied",count:[{total:0}],bg:"bg-warning-500",text:"text-warning-500",percent:"8.67%",icon:"heroicons-outline:chart-pie"}],items:[],state:{isLoading:!1,isEdit:!1,isDeleting:!1}}},methods:{formatTime(e){let[t,r]=e.split(":");t=parseInt(t);const d=t>=12;return t=t%12||12,`${t}:${r} ${d?"PM":"AM"}`},formatDate(e){const t=new Date(e),r=new Date(t.toLocaleString("en-US",{timeZone:"UTC"})),d=new Date(r.toLocaleString("en-US",{timeZone:"Asia/Singapore"})),o=d.getFullYear(),c=String(d.getMonth()+1).padStart(2,"0"),p=String(d.getDate()).padStart(2,"0");return`${o}-${c}-${p}`},async fetchRecords(){this.state.isLoading=!0,await S.fetchRecords().then(e=>{let t=e.data.data;this.items=t,this.items=t.map((r,d)=>(this.statistics[0].count[0].total=r.pending,this.statistics[1].count[0].total=r.approved,this.statistics[2].count[0].total=r.denied,{...r,"#":d+1,"employee id":r.employee_id,name:r.employee.firstname+" "+r.employee.lastname,"date coverage":r.date_from===r.date_to?this.$formatDate(r.date_from):this.$formatDate(r.date_from)+" - "+this.$formatDate(r.date_to),"time coverage":this.$formatTime(r.from_time)+" - "+this.$formatTime(r.to_time),destination:r.destination,meal_label:r.meal==1?"Yes ( "+r.meal_amount+" )":"No",transportation_label:r.transportation==1?`Yes ( ${r.transportation_amount||0} )`:"No",status:r.status}))}).finally(()=>{this.state.isLoading=!1})},reload(){this.$emit("reload")},viewRecord(e){console.log(e),this.$refs.view.resetForm(),this.$refs.view.loadRecord(e),this.$refs.view.state.showModal=!0}},mounted(){this.fetchRecords()}},He={class:"space-y-4 mt-4"},We={class:"flex-1 md:mb-0 mb-3"},Ye={class:"grid grid-cols-1 gap-4 pb-4 md:grid-cols-3"},Ze={class:I("h-14 w-14 flex items-center justify-center rounded-md text-4xl mb-4 shadow-lg bg-white")},Je={class:"text-md font-semibold text-slate-700 dark:text-white mb-2"},Ke={class:"flex justify-center gap-4"},Qe={class:"text-xs font-medium text-slate-500 dark:text-white mb-1"},Xe={class:"text-2xl text-slate-900 dark:text-white font-semibold"},$e={class:"ag-grid-toolbar flex items-center justify-between px-4 py-2 bg-gray-100 border-b rounded-t-xl border-gray-200"},et={class:"flex items-center gap-4"},tt={class:"relative z-10 flex items-center transition-colors duration-300 group-hover:text-white"};function ot(e,t,r,d,o,c){const p=l("Icon"),g=l("Button"),m=l("ag-grid-vue"),x=l("Card"),C=l("Loading"),F=l("View"),A=l("Layout");return a(),v(A,{breadcrumbs:o.breadcrumbs},{default:u(()=>[s("div",He,[i(x,{title:"OB Applications"},{default:u(()=>[s("h6",We,y(e.title),1),s("div",Ye,[(a(!0),f(k,null,R(o.statistics,(_,V)=>(a(),f("div",{key:V,class:I([_.bg,"flex flex-col items-center rounded-lg p-2 bg-opacity-[0.15] dark:bg-opacity-50 text-center shadow-md hover:shadow-xl transition-transform transform hover:scale-101 w-full"])},[s("div",Ze,[i(p,{icon:_.icon,class:I(["text-2xl",_.text])},null,8,["icon","class"])]),s("div",Je,y(_.title),1),s("div",Ke,[(a(!0),f(k,null,R(_.count,w=>(a(),f("div",{key:w.type},[s("div",Qe,y(w.type),1),s("div",Xe,y(w.total),1)]))),128))])],2))),128))]),s("div",$e,[t[2]||(t[2]=s("div",{class:"flex items-center justify-center gap-4 text-gray-900"}," OB ",-1)),s("div",et,[i(g,{icon:"mdi:microsoft-excel",text:"Export to CSV",btnClass:"relative overflow-hidden font-normal px-4 py-2 rounded-lg shadow-md bg-white text-gray-900 border group transition-colors duration-300 group-hover:border-green-500",iconClass:"text-2xl",onClick:e.exportToCsv},{default:u(()=>[t[1]||(t[1]=s("span",{class:"absolute inset-0 bg-green-500 transition-transform duration-300 transform -translate-x-full group-hover:translate-x-0"},null,-1)),s("span",tt,[i(p,{icon:"mdi:microsoft-excel",class:"text-2xl mr-2"}),t[0]||(t[0]=b(" Export to CSV "))])]),_:1},8,["onClick"])])]),i(m,{ref:"agGrid",rowData:o.items,columnDefs:o.colDefs,style:{height:"500px"},class:"ag-theme-quartz",pagination:!0,paginationPageSize:o.paginationPageSize,paginationPageSizeSelector:o.paginationPageSizeSelector,onGridReady:e.onGridReady},null,8,["rowData","columnDefs","paginationPageSize","paginationPageSizeSelector","onGridReady"])]),_:1}),o.state.isLoading?(a(),v(C,{key:0,text:"Fetching records"})):h("",!0),i(F,{ref:"view",onReload:c.fetchRecords},null,8,["onReload"])])]),_:1},8,["breadcrumbs"])}const co=D(Ne,[["render",ot],["__scopeId","data-v-d1f8b055"]]);export{co as default};
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0 |
proxy
|
phpinfo
|
Settings