1import{_ as N,c as h,s as _,R as v}from"./index-rpK2Mxmx.js";import{X as c,a6 as n,ah as F,ai as $,a5 as i,W as d,k as a,a3 as u,G as b,ac as p,a2 as x,F as M,ae as R}from"./vue-E3d3mecD.js";import{d as O}from"./datatableMixins-qxGvkUTU.js";import"./antd-C9qusGDu.js";import"./lodash-BLIbnOd4.js";import"./moment-lgN9U01c.js";import"./ckeditor-C5RZI2Xj.js";import"./filterDateRangeDropdown-BC9VS5Pe.js";import"./filterInputSearchDropdown-BahlBAH6.js";const T={mixins:[O],data(){var t,e,g,C,l;return{ROLES:v,datatableUrl:this.$constants.adminCompentencyFormUrl,deleteRecordUrl:this.$constants.adminCompentencyFormDelete,columns:[{title:"Employee",dataIndex:["employee","full_name"],key:"full_name",slots:{filterDropdown:"filterDropdown",filterIcon:"filterIcon"},defaultFilteredValue:(t=this.$route.query)!=null&&t.employee_name?[(e=this.$route.query)==null?void 0:e.employee_name]:void 0},{title:"Assessor Name",dataIndex:"assessor_name",key:"assessor_name",slots:{filterDropdown:"filterDropdown",filterIcon:"filterIcon"},defaultFilteredValue:(g=this.$route.query)!=null&&g.assessor_name?[(C=this.$route.query)==null?void 0:C.assessor_name]:void 0},{title:"Type",dataIndex:"form_type",key:"form_type",customRender:({record:o})=>{const m=this.$constants.competency.find(r=>r.id===o.form_type);return m?m.label:"N/A"}},{title:"Competency",dataIndex:"key",key:"competency",customRender:({record:o})=>this.$comman.getCompetencyLabel(o)},{title:"Created By",dataIndex:"creator_name",key:"creator_name",customRender:({record:o})=>{var m;return((m=o==null?void 0:o.creator)==null?void 0:m.fl_name)??""}},{title:"Action",dataIndex:"action",key:"action",fixed:"right",slots:{customRender:"action"}}],activeTabKey:((l=this.$route.query)==null?void 0:l.status)??"0",tabList:this.$constants.competenceAssessmentFormStatusesAdmin.map(o=>({key:o.value.toString(),counts:0,text:o.text,status:o.value,slots:{tab:"customRender"}}))}},computed:{...$("auth",["user"])},methods:{...F("drawer",["open"]),handleSendCompetencyAssessment(t){h.store(this.$constants.adminCompentencyFormSendMail,{id:t.id}).then(e=>{e.success?(this.refresh(),this.$message.success(e.message)):this.$message.error(e.message||"Could not send the competency assessment.")}).catch(e=>{_(e,"Could not send the competency assessment.")})},handleAssessmentDeleteEvent(t){h.store(this.deleteRecordUrl,{id:t.id}).then(e=>{e.success?(this.refresh(),this.$message.success(e.message)):this.$message.error(e.message||"Could not delete the competency assessment.")}).catch(e=>{_(e,"Could not delete the competency assessment.")})},downloadPdf(t){this.datatableLoading=!0,h.downloadFile(this.$constants.adminCompentencyFormPreviewPdf,{id:t.id},`${t.employee.fl_name} assessment document.pdf`).then(e=>{this.$message.success(e)}).catch(e=>{_(e,"Could not download the competency assessment PDF.")}).finally(()=>{this.datatableLoading=!1})},renderPdf(t){this.datatableLoading=!0,h.renderFile(this.$constants.adminCompentencyFormPreviewPdf,{id:t.id},"application/pdf;base64").then(e=>{}).catch(e=>{_(e,"Could not print the competency assessment.")}).finally(()=>{this.datatableLoading=!1})},showOfferMailLog(t){this.open({title:"Mail Logs",path:"admin.competencyAssessments.mailLog",callback:this.refresh,record:t})}}};function V(t,e,g,C,l,o){const m=i("a-space"),r=i("a-button"),k=i("router-link"),I=i("page-header"),S=i("xFilterInputSearchDropdown"),A=i("xFilterIcon"),f=i("a-tooltip"),w=i("a-popconfirm"),L=i("ant-data-table"),E=i("a-card"),D=i("a-layout-content");return d(),c(D,null,{default:n(()=>[a(I,null,{title:n(()=>[...e[1]||(e[1]=[b("Competency Assessment",-1)])]),buttons:n(()=>[t.$comman.hasRole([l.ROLES.ADMIN_VIEW_ONLY,l.ROLES.SECURITY_MANAGER])?p("",!0):(d(),c(k,{key:0,to:{name:"admin-competency-assessments-new-store"}},{default:n(()=>[a(r,{type:"primary"},{default:n(()=>[a(m,null,{default:n(()=>[...e[2]||(e[2]=[u("i",{class:"ti ti-plus ti-lg"},null,-1),b(" Add Competency Assessment ",-1)])]),_:1})]),_:1})]),_:1}))]),_:1}),a(E,{tabList:l.tabList,activeTabKey:l.activeTabKey,onTabChange:e[0]||(e[0]=s=>l.activeTabKey=s),size:"small"},{customRender:n(s=>[b(R(s.text)+" ("+R(s.counts)+") ",1)]),default:n(()=>[a(L,{columns:l.columns,rowKey:(s,y)=>s.id,dataSource:t.dataSource,pagination:t.pagination,loading:t.datatableLoading,onChange:t.handleTableChange,onRefresh:t.refresh,size:"small",scroll:t.scroll,rowClassName:s=>s.is_flagged?"flagged-row":""},{filterDropdown:n(s=>[a(S,{filterDropdown:s,onHandleSearch:t.handleDatatableSearch,onHandleReset:t.handleDatatableReset},null,8,["filterDropdown","onHandleSearch","onHandleReset"])]),filterIcon:n(s=>[a(A,{filterIcon:s},null,8,["filterIcon"])]),action:n(({record:s})=>[a(m,{size:1},{default:n(()=>[t.$comman.hasRole([l.ROLES.ADMIN_VIEW_ONLY,l.ROLES.SECURITY_MANAGER])?p("",!0):(d(),x(M,{key:0},[s.status===2&&t.user.email===s.assessor_email?(d(),c(k,{key:0,to:{name:"admin-competency-assessment-new-show",params:{id:s.id}}},{default:n(()=>[a(f,{title:"View"},{default:n(()=>[a(r,{type:"link",size:"small"},{default:n(()=>[...e[3]||(e[3]=[u("i",{class:"ti ti-eye ti-lg"},null,-1)])]),_:1})]),_:1})]),_:1},8,["to"])):p("",!0),[0,1].includes(s.status)||s.status===2&&t.user.email!==s.assessor_email?(d(),c(w,{key:1,title:"Are you sure you want to send this assessment?","ok-text":"Yes","cancel-text":"No",onConfirm:y=>o.handleSendCompetencyAssessment(s)},{default:n(()=>[a(f,{title:"Send Mail"},{default:n(()=>[a(r,{type:"link",size:"small"},{default:n(()=>[...e[4]||(e[4]=[u("i",{class:"ti ti-mail ti-lg"},null,-1)])]),_:1})]),_:1})]),_:1},8,["onConfirm"])):p("",!0),s.status!=0?(d(),c(f,{key:2,title:"Mail Logs"},{default:n(()=>[a(r,{type:"link",size:"small",onClick:y=>o.showOfferMailLog(s)},{default:n(()=>[...e[5]||(e[5]=[u("i",{class:"ti ti-history ti-lg"},null,-1)])]),_:1},8,["onClick"])]),_:2},1024)):p("",!0)],64)),a(f,{title:"Print"},{default:n(()=>[a(r,{type:"link",size:"small",onClick:y=>o.renderPdf(s)},{default:n(()=>[...e[6]||(e[6]=[u("i",{class:"ti ti-printer ti-lg"},null,-1)])]),_:1},8,["onClick"])]),_:2},1024),!t.$comman.hasRole([l.ROLES.ADMIN_VIEW_ONLY,l.ROLES.SECURITY_MANAGER])&&s.status===0?(d(),c(w,{key:1,title:"Are you sure you want to delete this assessment?","ok-text":"Yes","cancel-text":"No",onConfirm:y=>o.handleAssessmentDeleteEvent(s)},{default:n(()=>[a(f,{title:"Delete",placement:"bottom"},{default:n(()=>[a(r,{size:"small",type:"link",danger:""},{default:n(()=>[...e[7]||(e[7]=[u("i",{class:"ti ti-trash ti-lg"},null,-1)])]),_:1})]),_:1})]),_:1},8,["onConfirm"])):p("",!0)]),_:2},1024)]),_:1},8,["columns","rowKey","dataSource","pagination","loading","onChange","onRefresh","scroll","rowClassName"])]),_:1},8,["tabList","activeTabKey"])]),_:1})}const W=N(T,[["render",V]]);export{W as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.