1import{a as M,e as T,m as z,f}from"./CqawAVUb.js";import U from"./D2A-cuOJ.js";import A from"./Cq6d0fYR.js";import{d as B}from"./DdMfNbGx.js";import{C as P}from"./OiANFlSe.js";import{E as q}from"./DoQnLyDE.js";import{D as F}from"./DeZaBaMW.js";import{m as S}from"./CbO2Rjsj.js";import{bf as i,b2 as _,O as h,$ as t,bW as s,G as l,br as c,bY as K,Y as u}from"./yzds40HC.js";import"./BgqE2USM.js";import"./C8Dppsyt.js";import"./DhlRdtTC.js";import"./Dz0mkqCC.js";import"./DkpuU7u1.js";import"./DtS_aP2E.js";const O={name:"Index",components:{CallTo:P,EmailTo:q,DateIntervalPicker:F,ResetFiltersButton:A,TextFieldFilter:U},mixins:[B],data(){return{registrationInputs:{},headers:[{title:this.$t("fields.first_name"),align:"start",key:"first_name"},{title:this.$t("fields.last_name"),key:"last_name"},{title:this.$t("fields.email"),key:"email"},{title:this.$t("fields.registration_number"),key:"registration_number"},{title:this.$t("fields.phone"),key:"phone"},{title:this.$t("fields.status"),key:"status"},{title:this.$t("fields.category"),key:"category"},{title:this.$t("fields.created_at"),key:"created_at"},{title:this.$t("fields.image"),key:"image",sortable:!1},{title:"",key:"data-table-expand"}]}},async mounted(){S.locale("ro"),await this.fetchData()},head(){return{title:"Listare SesizÄri"}},computed:{...f("tenant",["tenant"]),...f("citizenReports",["citizenReports"]),...f("loader",["loading"]),...f("query",["queryParams"]),currentScope(){return"citizen-reports"}},methods:{...z("resources",["getData","updateResource","updateRegistrationNumber"]),...z("query",["setVuetifyPagination"]),...T("citizens",["SET_CITIZEN_ID"]),async markAsResolved(e){await this.updateResource({scope:"citizen-reports",navigate:!1,data:{...e,status:"Rezolvat"},id:e.id}),await this.getData(this.currentScope)},formatDate(e,o){if(!e)return"";const m=this.$store?.state?.app?.time||{zone:"Europe/Bucharest",format:"D MMM YYYY"},{zone:g,format:d}=m;return S(e).tz(g).locale("ro").format(o||d||"D MMM YYYY")},handleOptionsUpdate(e){this.setVuetifyPagination({scope:this.currentScope,pagination:e}),this.getData(this.currentScope)},async fetchData(){await this.getData(this.currentScope),this.$store.state.citizenReports&&this.$store.state.citizenReports.citizenReports&&this.$store.state.citizenReports.citizenReports.forEach(e=>{e&&e.id&&(this.registrationInputs[e.id]=e.registration_number||"")})},async updateRegistrationNr(e){if(!e||!e.id)return;const o=this.registrationInputs[e.id];if(!o||!/^\d+$/.test(o)){this.$errorAlert&&await this.$errorAlert("NumÄrul de înregistrare poate conÈine doar cifre.");return}const m={id:e.id,number:o,scope:this.currentScope};await this.updateRegistrationNumber(m)}}},G={class:"d-flex flex-column flex-grow-1"},H={class:"text-h5 text-md-h4"},L=["colspan"],W={class:"filter-row"},Z={class:"text-end"},j=["href"],J={key:1},Q={class:"d-flex align-center"};function X(e,o,m,g,d,n){const R=i("v-divider"),$=i("v-spacer"),x=i("v-card-title"),v=i("v-card-text"),b=i("v-card"),r=i("text-field-filter"),w=i("date-interval-picker"),D=i("reset-filters-button"),I=i("call-to"),C=i("v-chip"),y=i("v-icon"),k=i("v-btn"),N=i("v-tooltip"),Y=i("email-to"),V=i("v-text-field"),E=i("v-data-table-server");return _(),h("div",G,[t(b,{elevation:"5"},{default:s(()=>[t(x,null,{default:s(()=>[l("div",H,c(e.$t("menu.citizen_reports")),1),t(R,{vertical:"",class:"mx-2 d-none d-md-inline"}),t($)]),_:1}),t(v,null,{default:s(()=>[t(E,{headers:d.headers,"items-per-page-options":[10,15,30,60],loading:e.loading,"items-length":e.queryParams[n.currentScope]?.pagination?.total||0,items:e.citizenReports,"expand-on-click":!1,"show-expand":"",class:"flex-grow-1 v2-style-table",options:e.pagination,"onUpdate:options":[o[0]||(o[0]=a=>e.pagination=a),n.handleOptionsUpdate]},{"expanded-row":s(({item:a,columns:p})=>[l("tr",null,[l("td",{colspan:p.length},[t(b,{dark:""},{default:s(()=>[t(v,{class:"text-white"},{default:s(()=>[u(c(a.description),1)]),_:2},1024)]),_:2},1024)],8,L)])]),"body.prepend":s(()=>[l("tr",W,[l("td",null,[t(r,{label:e.$t("fields.first_name"),scope:n.currentScope,"scope-key":"first_name",class:"filter-field","hide-details":""},null,8,["label","scope"])]),l("td",null,[t(r,{label:e.$t("fields.last_name"),scope:n.currentScope,"scope-key":"last_name",class:"filter-field","hide-details":""},null,8,["label","scope"])]),l("td",null,[t(r,{label:e.$t("fields.email"),scope:n.currentScope,"scope-key":"email",class:"filter-field","hide-details":""},null,8,["label","scope"])]),l("td",null,[t(r,{label:e.$t("fields.registration_number"),scope:n.currentScope,"scope-key":"registration_number",class:"filter-field","hide-details":""},null,8,["label","scope"])]),l("td",null,[t(r,{label:e.$t("fields.phone"),scope:n.currentScope,"scope-key":"phone",class:"filter-field","hide-details":""},null,8,["label","scope"])]),l("td",null,[t(r,{label:e.$t("fields.status"),scope:n.currentScope,"scope-key":"status",class:"filter-field","hide-details":""},null,8,["label","scope"])]),l("td",null,[t(r,{label:e.$t("fields.category"),scope:n.currentScope,"scope-key":"category",class:"filter-field","hide-details":""},null,8,["label","scope"])]),l("td",null,[t(w,{"scope-key":"created_at",scope:n.currentScope,class:"filter-field","hide-details":""},null,8,["scope"])]),o[1]||(o[1]=l("td",null,null,-1)),l("td",Z,[t(D,{scope:"citizen-reports"})])])]),"item.created_at":s(({item:a})=>[u(c(n.formatDate(a.created_at)),1)]),"item.phone":s(({item:a})=>[t(I,{class:"text-link",phone:a.phone},null,8,["phone"])]),"item.status":s(({item:a})=>[t(C,{label:"",color:a.status==="Ãn lucru"?"error":"success"},{default:s(()=>[u(c(a.status),1)]),_:2},1032,["color"]),t(N,{location:"top"},{activator:s(({props:p})=>[t(k,{icon:"",size:"small",variant:"text",density:"compact",class:"v2
1-icon-button",onClick:ee=>n.markAsResolved(a)},{default:s(()=>[t(y,{size:"small",class:"v2-icon"},{default:s(()=>[...o[2]||(o[2]=[u("mdi-check",-1)])]),_:1})]),_:1},8,["onClick"])]),default:s(()=>[l("span",null,c(e.$t("fields.check")),1)]),_:2},1024)]),"item.image":s(({item:a})=>[a.image?(_(),h("a",{key:0,target:"_blank",href:a.image},c(e.$t("fields.image_link")),9,j)):(_(),h("span",J,c(e.$t("fields.no_image")),1))]),"item.email":s(({item:a})=>[t(Y,{class:"text-link",email:a.email},null,8,["email"])]),"item.registration_number":s(({item:a})=>[l("div",Q,[t(V,{modelValue:d.registrationInputs[a.id],"onUpdate:modelValue":p=>d.registrationInputs[a.id]=p,variant:"outlined",density:"compact",class:"my-1 filter-field","hide-details":"",style:{"max-width":"400px"},placeholder:e.$t("menu.registration_number"),label:e.$t("menu.registration_number"),color:"primary",onKeyup:K(p=>n.updateRegistrationNr(a),["enter"])},null,8,["modelValue","onUpdate:modelValue","placeholder","label","onKeyup"]),t(k,{color:"primary",icon:"",size:"small",variant:"text",density:"compact",class:"v2-icon-button",onClick:p=>n.updateRegistrationNr(a),disabled:!d.registrationInputs[a.id],title:"SalveazÄ numÄrul"},{default:s(()=>[t(y,{size:"small",class:"v2-icon"},{default:s(()=>[...o[3]||(o[3]=[u("mdi-content-save",-1)])]),_:1})]),_:1},8,["onClick","disabled"])])]),_:1},8,["headers","loading","items-length","items","options","onUpdate:options"])]),_:1})]),_:1})])}const he=M(O,[["render",X],["__scopeId","data-v-f79469f2"]]);export{he 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.