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

1 line
8.3 KiB
JavaScript

"use strict";(self.webpackChunkroad_report=self.webpackChunkroad_report||[]).push([[76],{2408:(f,m,e)=>{e.d(m,{a:()=>d});var c=e(1991),a=e(8699),r=e(1626),t=e(7110);let d=(()=>{class o extends c.G{constructor(n,s){super(n,s),this.http=n,this.helpers=s,this.endpoint="report-list/count"}static{this.\u0275fac=function(s){return new(s||o)(a.KVO(r.Qq),a.KVO(t.V))}}static{this.\u0275prov=a.jDH({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})()},5211:(f,m,e)=>{e.d(m,{Z:()=>o});var c=e(1991),a=e(4412),r=e(8699),t=e(1626),d=e(7110);let o=(()=>{class i extends c.G{constructor(s,l){super(s,l),this.http=s,this.helpers=l,this.reportDetailsSubject=new a.t(null),this.endpoint="report-list"}getData(s,l){const h=this.urlWithId(s),u=l?this.helpers.generateParams(l):{};return this.http.get(h,{params:u})}static{this.\u0275fac=function(l){return new(l||i)(r.KVO(t.Qq),r.KVO(d.V))}}static{this.\u0275prov=r.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()},6747:(f,m,e)=>{e.d(m,{r:()=>o});var c=e(1991),a=e(8699),r=e(5471),t=e(1626),d=e(7110);let o=(()=>{class i extends c.G{constructor(s,l,h){super(l,h),this.auth=s,this.http=l,this.helpers=h,this.endpoint="PNGL"==s.getLoggedUser().role.code?`report-schedules/pengelola/${s.getLoggedUser().id}`:"report-schedules"}static{this.\u0275fac=function(l){return new(l||i)(a.KVO(r.u),a.KVO(t.Qq),a.KVO(d.V))}}static{this.\u0275prov=a.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})()},2665:(f,m,e)=>{e.d(m,{v:()=>h});var c=e(1413),a=e(152),r=e(6977),t=e(9417),d=e(8001),o=e(8699),i=e(7110),n=e(2423),s=e(1991),l=e(6803);let h=(()=>{class u{constructor(_,p,g,D){this.helpers=_,this.loading=p,this.api=g,this.modal=D,this.pageTitle="",this.queryLimit=10,this.queryPage=1,this.querySort="-created_at",this.queries={},this.searchFields="",this.searchForm=new t.MJ,this.searchSubs$=new c.B,this.dataSource=[],this.dataSourceLength=0,this.dataSourceTotal=0,this.dataSourceSubs$=new c.B,this.pageSizeOptions=[5,10,25,50],this.queries={limit:this.queryLimit,page:this.queryPage,sort:this.querySort}}ngOnInit(){this.getAll()}ngAfterViewInit(){this.searchForm.valueChanges.pipe((0,a.B)(1e3),(0,r.Q)(this.searchSubs$)).subscribe(_=>{if(_.trim().length>=3&&!_.startsWith(" "))this.queries={...this.queries,search:{fields:this.searchFields,value:_}};else{if(0!==_.trim().length||_.startsWith(" "))return;delete this.queries.search}this.getAll(!1)})}ngOnDestroy(){this.dataSourceSubs$.next(),this.dataSourceSubs$.complete(),this.searchSubs$.next(),this.searchSubs$.complete(),this.loading.hide()}getAll(_=!0){this.loading.show(),this.api.getAll(this.queries).pipe((0,r.Q)(this.dataSourceSubs$)).subscribe({next:({data:p,total:g})=>{this.loading.hide(),this.dataSource=p,this.dataSourceLength=g,_&&(this.dataSourceTotal=g)},error:()=>{this.loading.hide(),this.helpers.toast("error","Gagal mengambil data")}})}onPageSizeChange(_){const p=parseInt(_.target.value);this.queryLimit=p,this.queries={...this.queries,limit:this.queryLimit,page:this.queryPage},this.getAll(!1)}onPaginateChange(_){this.queryPage=_,this.queries={...this.queries,page:this.queryPage},this.getAll(!1)}parseNumber(_){return this.queries.page&&this.queries.limit?_+1+(this.queries.page-1)*this.queries.limit:_}onDeleteData(_,p=null){const g=this.modal.open(d.M,{size:"sm"});g.componentInstance.modalType=2,g.componentInstance.message=`Anda yakin ingin menghapus ${p?`<span class='fw-medium text-danger'>${p}</span>`:"data"} ?`,g.result.then(D=>{D&&this.api.delete(_).subscribe({next:()=>{this.helpers.toast("success",`Berhasil menghapus ${p??"data"}`),this.getAll(!0)},error:()=>{this.helpers.toast("error",`Gagal menghapus data ${p} ?? 'data'`)}})},()=>{})}static{this.\u0275fac=function(p){return new(p||u)(o.rXU(i.V),o.rXU(n.U),o.rXU(s.G),o.rXU(l.Bq))}}static{this.\u0275cmp=o.VBU({type:u,selectors:[["base-crud"]],decls:0,vars:0,template:function(p,g){},encapsulation:2})}}return u})()},7645:(f,m,e)=>{e.d(m,{C:()=>r});var c=e(177),a=e(8699);let r=(()=>{class t{constructor(){this.bgColor="",this.textColor="",this.message="",this.statusMessage="",this.height=""}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=a.VBU({type:t,selectors:[["app-alert"]],inputs:{bgColor:"bgColor",textColor:"textColor",message:"message",statusMessage:"statusMessage",height:"height"},standalone:!0,features:[a.aNF],decls:5,vars:8,consts:[["role","alert",1,"alert","mb-0","text-center","w-full"],[1,"bi","bi-exclamation-circle","me-2"]],template:function(i,n){1&i&&(a.j41(0,"div",0),a.nrm(1,"i",1),a.EFF(2),a.j41(3,"strong"),a.EFF(4),a.k0s()()),2&i&&(a.xc7("background",n.bgColor)("color",n.textColor)("height",n.height),a.R7$(2),a.SpI(" ",n.message," "),a.R7$(2),a.SpI(" ",n.statusMessage,""))},dependencies:[c.MD]})}}return t})()},7181:(f,m,e)=>{e.d(m,{$:()=>d});var c=e(177),a=e(2244),r=e(8699);function t(o,i){if(1&o){const n=r.RV6();r.j41(0,"div",1)(1,"img",2),r.bIt("click",function(){const h=r.eBV(n).index,u=r.XpG();return r.Njj(u.open(h))}),r.k0s()()}if(2&o){const n=r.XpG();r.R7$(1),r.Y8G("src",n.data.abs_path,r.B4B)}}let d=(()=>{class o{constructor(n,s){this._lightbox=n,this._lightboxConfig=s,this._album=[],s.fadeDuration=1,s.showZoom=!0,s.wrapAround=!0,s.positionFromTop=50,s.disableScrolling=!1,s.fadeDuration=.7}ngOnInit(){this.data&&this._album.push({src:this.data.abs_path,caption:this.data.filename,thumb:this.data.abs_path})}open(n){this._lightbox.open(this._album,n)}close(){this._lightbox.close()}static{this.\u0275fac=function(s){return new(s||o)(r.rXU(a.Yf),r.rXU(a.Mw))}}static{this.\u0275cmp=r.VBU({type:o,selectors:[["app-lightbox"]],inputs:{data:"data"},standalone:!0,features:[r.aNF],decls:1,vars:1,consts:[["class","",4,"ngFor","ngForOf"],[1,""],[1,"rounded-2",2,"width","70px","height","70px",3,"src","click"]],template:function(s,l){1&s&&r.DNE(0,t,2,1,"div",0),2&s&&r.Y8G("ngForOf",l._album)},dependencies:[c.MD,c.Sq,a.Ib]})}}return o})()},6847:(f,m,e)=>{e.d(m,{a:()=>n});var c=e(177),a=e(9417),r=e(9519),t=e(8699),d=e(6803),o=e(7110);function i(s,l){1&s&&t.nrm(0,"textarea",11)}let n=(()=>{class s{constructor(h,u,E){this.activeModal=h,this.formBuilder=u,this.helpers=E,this.modalType=0,this.message="",this.form={}}ngOnInit(){this.initForm()}initForm(){this.form=this.formBuilder.group({note:[null,[r.M.noWhiteSpace]]})}onSubmit(){this.activeModal.close(this.form.value)}static{this.\u0275fac=function(u){return new(u||s)(t.rXU(d.Lw),t.rXU(a.ok),t.rXU(o.V))}}static{this.\u0275cmp=t.VBU({type:s,selectors:[["app-submit"]],inputs:{modalType:"modalType",message:"message"},standalone:!0,features:[t.aNF],decls:17,vars:4,consts:[[1,"modal-body","mx-auto"],[1,"icon-container","my-1","d-flex","justify-content-center"],[1,"bi","bi-exclamation-triangle","fs-3",2,"color","#ffab00"],[1,"text-center","fs-5","fw-bold","text-primary"],[1,"text-center","px-5","my-3"],[1,"fw-bold",3,"ngClass"],[3,"formGroup"],["formControlName","note","class","form-control mb-3","id","exampleFormControlTextarea1","rows","3","placeholder","Beri alasan ditolak",4,"ngIf"],[1,"d-flex","justify-content-center"],["type","button",1,"btn","btn-outline-primary","me-2",3,"click"],["type","button",1,"btn","btn-primary",3,"click"],["formControlName","note","id","exampleFormControlTextarea1","rows","3","placeholder","Beri alasan ditolak",1,"form-control","mb-3"]],template:function(u,E){1&u&&(t.j41(0,"div",0)(1,"div",1),t.nrm(2,"i",2),t.k0s(),t.j41(3,"h5",3),t.EFF(4,"Konfirmasi Status"),t.k0s(),t.j41(5,"div",4),t.EFF(6," Apakah anda yakin ingin mengonfirmasi pengubahan status "),t.j41(7,"span",5),t.EFF(8),t.k0s(),t.EFF(9," ? "),t.k0s(),t.j41(10,"form",6),t.DNE(11,i,1,0,"textarea",7),t.k0s(),t.j41(12,"div",8)(13,"button",9),t.bIt("click",function(){return E.activeModal.close(!1)}),t.EFF(14," Batal "),t.k0s(),t.j41(15,"button",10),t.bIt("click",function(){return E.onSubmit()}),t.EFF(16," Ya, Setuju "),t.k0s()()()),2&u&&(t.R7$(7),t.Y8G("ngClass",1===E.modalType?"text-danger":"text-dark"),t.R7$(1),t.SpI("",E.message," "),t.R7$(2),t.Y8G("formGroup",E.form),t.R7$(1),t.Y8G("ngIf",1===E.modalType))},dependencies:[c.MD,c.YU,c.bT,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD]})}}return s})()},467:(f,m,e)=>{function c(r,t,d,o,i,n,s){try{var l=r[n](s),h=l.value}catch(u){return void d(u)}l.done?t(h):Promise.resolve(h).then(o,i)}function a(r){return function(){var t=this,d=arguments;return new Promise(function(o,i){var n=r.apply(t,d);function s(h){c(n,o,i,s,l,"next",h)}function l(h){c(n,o,i,s,l,"throw",h)}s(void 0)})}}e.d(m,{A:()=>a})}}]);