frontend-roadreport-main/frontend-roadreport-deploy/dist/road-report/186.9e3760d3c202465a.js
2024-12-31 10:28:36 +07:00

1 line
11 KiB
JavaScript

"use strict";(self.webpackChunkroad_report=self.webpackChunkroad_report||[]).push([[186],{2186:(V,g,r)=>{r.r(g),r.d(g,{LaporanModule:()=>X});var p=r(177),_=r(2665),t=r(8699),u=r(8185),F=r(5471),k=r(1991),j=r(1626),m=r(7110);let L=(()=>{class n extends k.G{constructor(e,a){super(e,a),this.http=e,this.helpers=a}static{this.\u0275fac=function(a){return new(a||n)(t.KVO(j.Qq),t.KVO(m.V))}}static{this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var l=r(6803),R=r(5211),C=r(2423),c=r(9417);function I(n,i){if(1&n&&(t.j41(0,"div",14),t.nrm(1,"i",15)(2,"input",16),t.k0s()),2&n){const e=t.XpG();t.R7$(2),t.Y8G("formControl",e.searchForm)("readonly",0===e.dataSourceLength&&e.queries.filter&&!e.queries.search)}}function y(n,i){if(1&n){const e=t.RV6();t.j41(0,"button",17),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.export())}),t.nrm(1,"i",18),t.EFF(2," Export PDF "),t.k0s()}}function v(n,i){if(1&n){const e=t.RV6();t.j41(0,"button",11),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.applyFilter("PROG"))}),t.EFF(1," Dalam Proses "),t.k0s()}if(2&n){const e=t.XpG();t.AVh("active","PROG"===e.statusId)}}function E(n,i){if(1&n){const e=t.RV6();t.j41(0,"button",11),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.applyFilter("RJT"))}),t.EFF(1," Ditolak "),t.k0s()}if(2&n){const e=t.XpG();t.AVh("active","RJT"===e.statusId)}}function T(n,i){1&n&&(t.j41(0,"p",19),t.nrm(1,"i",20),t.EFF(2," Belum ada data. "),t.k0s())}function x(n,i){1&n&&(t.j41(0,"p",19),t.nrm(1,"i",21),t.EFF(2," Tidak ada hasil pencarian "),t.k0s())}function G(n,i){if(1&n){const e=t.RV6();t.j41(0,"button",35),t.bIt("click",function(){t.eBV(e);const o=t.XpG().$implicit,s=t.XpG(2);return t.Njj(s.onDeleteData(o.id,o.user.fullname))}),t.EFF(1," Hapus "),t.k0s()}}const D=function(n,i,e,a,o,s){return{"bg-primary":n,"bg-warning":i,"bg-danger":e,"bg-info":a,"bg-secondary":o,"bg-success":s,"text-nowrap text-white text-center rounded-2 px-2 py-2":!0,"d-block":!0}};function S(n,i){if(1&n){const e=t.RV6();t.j41(0,"tr")(1,"td"),t.EFF(2),t.nI1(3,"date"),t.k0s(),t.j41(4,"td"),t.EFF(5),t.k0s(),t.j41(6,"td"),t.EFF(7),t.k0s(),t.j41(8,"td")(9,"small",30),t.EFF(10),t.k0s()(),t.j41(11,"td")(12,"a",31),t.EFF(13),t.k0s()(),t.j41(14,"td"),t.EFF(15),t.k0s(),t.j41(16,"td")(17,"div",32)(18,"button",33),t.bIt("click",function(){const s=t.eBV(e).$implicit,d=t.XpG(2);return t.Njj(d.goToDetail(s.id))}),t.EFF(19," Detail "),t.k0s(),t.DNE(20,G,2,0,"button",34),t.k0s()()()}if(2&n){const e=i.$implicit,a=t.XpG(2);t.R7$(2),t.JRh(t.i5U(3,12,e.created_at,"dd/MM/yyyy")),t.R7$(3),t.JRh(e.no_ticket),t.R7$(2),t.JRh(e.user.fullname),t.R7$(2),t.Y8G("ngClass",t.l4e(15,D,"PROG"===e.status_report.id,"FOLUP"===e.status_report.id,"RJT"===e.status_report.id,"RPR"===e.status_report.id,"FIXED"===e.status_report.id,"DONE"===e.status_report.id)),t.R7$(1),t.SpI(" ","DONE"===e.status_report.id?"Selesai":e.status_report.name," "),t.R7$(2),t.FRS("href","https://www.google.com/maps/search/?api=1&query=",a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates[1],",",a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates[0],"&zoom=15&markers=",a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates[1],",",a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates[0],"",t.B4B),t.R7$(1),t.SpI(" ","["+a.parsing(e.segmens[e.segmens.length-1].segmen.center_point).coordinates.reverse().join(", ")+"]"," "),t.R7$(2),t.SpI(" ",e.segmens.length>0?e.segmens[e.segmens.length-1].segmen.name:"-"," "),t.R7$(5),t.Y8G("ngIf",a.isPNGL())}}function $(n,i){if(1&n&&(t.j41(0,"option",36),t.EFF(1),t.k0s()),2&n){const e=i.$implicit,a=t.XpG(2);t.Y8G("value",e)("selected",e===a.queryLimit),t.R7$(1),t.SpI(" ",e," ")}}function P(n,i){if(1&n){const e=t.RV6();t.qex(0),t.j41(1,"div",22)(2,"table",23)(3,"thead")(4,"tr")(5,"th"),t.EFF(6,"Tanggal"),t.k0s(),t.j41(7,"th"),t.EFF(8,"No Tiket"),t.k0s(),t.j41(9,"th"),t.EFF(10,"Nama Pelapor"),t.k0s(),t.j41(11,"th"),t.EFF(12,"Status"),t.k0s(),t.j41(13,"th"),t.EFF(14,"Lihat Maps"),t.k0s(),t.j41(15,"th"),t.EFF(16,"Lokasi"),t.k0s(),t.j41(17,"th"),t.EFF(18,"Aksi"),t.k0s()()(),t.j41(19,"tbody"),t.DNE(20,S,21,22,"tr",24),t.k0s()()(),t.j41(21,"div",25)(22,"div",26)(23,"span"),t.EFF(24,"Item per halalaman"),t.k0s(),t.j41(25,"select",27),t.bIt("change",function(o){t.eBV(e);const s=t.XpG();return t.Njj(s.onPageSizeChange(o))}),t.DNE(26,$,2,3,"option",28),t.k0s(),t.j41(27,"span"),t.EFF(28),t.k0s()(),t.j41(29,"ngb-pagination",29),t.bIt("pageChange",function(o){t.eBV(e);const s=t.XpG();return t.Njj(s.queryPage=o)})("pageChange",function(o){t.eBV(e);const s=t.XpG();return t.Njj(s.onPaginateChange(o))}),t.k0s()(),t.bVm()}if(2&n){const e=t.XpG();t.R7$(20),t.Y8G("ngForOf",e.dataSource),t.R7$(6),t.Y8G("ngForOf",e.pageSizeOptions),t.R7$(2),t.SpI("dari ",e.dataSourceLength,""),t.R7$(1),t.Y8G("collectionSize",e.dataSourceLength)("page",e.queryPage)("maxSize",5)("pageSize",e.queryLimit)("rotate",!0)("ellipses",!1)("boundaryLinks",!1)("directionLinks",!0)}}const N=[{path:"",component:(()=>{class n extends _.v{constructor(e,a,o,s,d,h,f,b){super(h,b,f,d),this.activatedRoute=e,this.router=a,this.auth=o,this.exportAll=s,this.modal=d,this.helpers=h,this.api=f,this.loading=b,this.statusId="",this.field={eq:this.statusId},this.searchFields="no_ticket,user.fullname,segmens.segmen.name",this.api.endpoint="report-list",this.queries={page:1,sort:"-created_at",limit:10,embed:"status_report,user,segmens,segmens.segmen,segmens.photos"},"PNGL"==this.auth.getLoggedUser().role.code&&(this.api.endpoint="report-list/pengelola")}applyFilter(e){return this.statusId=e,""!==this.statusId?this.queries.filter={status_id:{eq:this.statusId}}:"SADM"==this.auth.getLoggedUser().role.code?delete this.queries.filter.status_id:this.queries.filter={status_id:{ne:"PROG,RJT"}},this.getAll(),!0}export(){this.loading.show(),this.exportAll.endpoint=`report-list/export-all/${this.statusId}`,this.exportAll.getAll().pipe().subscribe({next:e=>{const o=e.data.rel_path;setTimeout(()=>{window.open(o,"_blank")},500),window.open(o,"_blank"),this.loading.hide()},error:e=>{}})}goToDetail(e){"PNGL"==this.auth.getLoggedUser().role.code?this.router.navigate(["dashboard","data-laporan",e]):this.router.navigate([e],{relativeTo:this.activatedRoute})}isPNGL(){const e=this.auth.getLoggedUser();return!!e&&"SADM"===e.role.code}parsing(e){return JSON.parse(e)}static{this.\u0275fac=function(a){return new(a||n)(t.rXU(u.nX),t.rXU(u.Ix),t.rXU(F.u),t.rXU(L),t.rXU(l.Bq),t.rXU(m.V),t.rXU(R.Z),t.rXU(C.U))}}static{this.\u0275cmp=t.VBU({type:n,selectors:[["app-laporan"]],features:[t.Vt3],decls:26,vars:16,consts:[[1,"mb-4","fw-bold"],[1,"rounded-3","p-4","bg-white"],[1,"d-flex","align-items-center","justify-content-between","gap-3","flex-wrap","mb-3",3,"ngClass"],["class","form-group has-search d-flex align-items-center",4,"ngIf"],["ngbDropdown",""],["class","btn no-caret text-primary me-2","style","background-color: #eef0fd",3,"click",4,"ngIf"],["id","filterDropdown","ngbDropdownToggle","",1,"btn","no-caret","text-primary",2,"background-color","#eef0fd"],[1,"ms-2","bi","bi-funnel","text-primary"],["ngbDropdownMenu","","aria-labelledby","filterDropdown"],["ngbDropdownItem","",1,"dropdown-item",3,"click"],["ngbDropdownItem","",3,"active","click",4,"ngIf"],["ngbDropdownItem","",3,"click"],["class","text-body-tertiary",4,"ngIf"],[4,"ngIf"],[1,"form-group","has-search","d-flex","align-items-center"],[1,"bi","bi-search","form-control-feedback","mx-auto","ms-3",2,"color","black"],["type","text","placeholder","Cari data...",1,"form-control","border-0","form-control",2,"background","#f2f2f2","height","48px",3,"formControl","readonly"],[1,"btn","no-caret","text-primary","me-2",2,"background-color","#eef0fd",3,"click"],[1,"bi","bi-file-earmark-text","text-primary"],[1,"text-body-tertiary"],[1,"bi","bi-exclamation-circle"],[1,"bi","bi-search"],[1,"table-responsive"],[1,"table"],[4,"ngFor","ngForOf"],[1,"d-flex","align-items-center","justify-content-between","gap-3","flex-wrap"],[1,"w-auto","d-flex","align-items-center","gap-2"],[1,"form-select","w-auto",3,"change"],[3,"value","selected",4,"ngFor","ngForOf"],[1,"mb-n3",3,"collectionSize","page","maxSize","pageSize","rotate","ellipses","boundaryLinks","directionLinks","pageChange"],[3,"ngClass"],["target","_blank",1,"text-nowrap",3,"href"],[1,"d-flex"],["type","button",1,"btn","btn-outline-primary","me-2",3,"click"],["class","btn btn-outline-primary",3,"click",4,"ngIf"],[1,"btn","btn-outline-primary",3,"click"],[3,"value","selected"]],template:function(a,o){1&a&&(t.j41(0,"h4",0),t.EFF(1,"Data Laporan"),t.k0s(),t.j41(2,"div",1)(3,"div",2),t.DNE(4,I,3,2,"div",3),t.j41(5,"div",4),t.DNE(6,y,3,0,"button",5),t.j41(7,"button",6),t.EFF(8," Filter "),t.nrm(9,"i",7),t.k0s(),t.j41(10,"div",8)(11,"button",9),t.bIt("click",function(){return o.applyFilter("")}),t.EFF(12," Semua "),t.k0s(),t.DNE(13,v,2,2,"button",10),t.j41(14,"button",11),t.bIt("click",function(){return o.applyFilter("FOLUP")}),t.EFF(15," Ditindak Lanjuti "),t.k0s(),t.j41(16,"button",11),t.bIt("click",function(){return o.applyFilter("RPR")}),t.EFF(17," Perbaikan "),t.k0s(),t.j41(18,"button",11),t.bIt("click",function(){return o.applyFilter("FIXED")}),t.EFF(19," Selesai Perbaikan "),t.k0s(),t.DNE(20,E,2,2,"button",10),t.j41(21,"button",11),t.bIt("click",function(){return o.applyFilter("DONE")}),t.EFF(22," Selesai "),t.k0s()()()(),t.DNE(23,T,3,0,"p",12),t.DNE(24,x,3,0,"p",12),t.DNE(25,P,30,11,"ng-container",13),t.k0s()),2&a&&(t.R7$(3),t.Y8G("ngClass",o.dataSourceTotal>0?"justify-content-between":"justify-content-end"),t.R7$(1),t.Y8G("ngIf",o.dataSourceTotal>0),t.R7$(2),t.Y8G("ngIf",o.dataSourceTotal>0),t.R7$(7),t.Y8G("ngIf",o.isPNGL()),t.R7$(1),t.AVh("active","FOLUP"===o.statusId),t.R7$(2),t.AVh("active","RPR"===o.statusId),t.R7$(2),t.AVh("active","FIXED"===o.statusId),t.R7$(2),t.Y8G("ngIf",o.isPNGL()),t.R7$(1),t.AVh("active","DONE"===o.statusId),t.R7$(2),t.Y8G("ngIf",0==o.dataSourceTotal),t.R7$(1),t.Y8G("ngIf",o.dataSourceTotal>0&&0===o.dataSourceLength&&o.queries.search),t.R7$(1),t.Y8G("ngIf",o.dataSourceTotal>0&&o.dataSourceLength>0))},dependencies:[p.YU,p.Sq,p.bT,c.xH,c.y7,c.me,c.BC,c.l_,l.tg,l.do,l.U0,l._H,l.s5,p.vh],styles:[".has-search[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{padding-left:3rem}.has-search[_ngcontent-%COMP%] .form-control-feedback[_ngcontent-%COMP%]{position:absolute}.form-control[_ngcontent-%COMP%]::placeholder{color:#bdbdbd}"]})}}return n})(),children:[]},{path:":id",loadChildren:()=>Promise.all([r.e(257),r.e(76),r.e(641)]).then(r.bind(r,6641)).then(n=>n.DetailModule)},{path:":id/tindak-lanjut",loadChildren:()=>Promise.all([r.e(76),r.e(367)]).then(r.bind(r,9367)).then(n=>n.TindakLanjutModule)}];let X=(()=>{class n{static{this.\u0275fac=function(a){return new(a||n)}}static{this.\u0275mod=t.$C({type:n})}static{this.\u0275inj=t.G2t({imports:[p.MD,u.iI.forChild(N),c.X1,l.zH,l.c9]})}}return n})()}}]);