"use strict";(self.webpackChunkWebBehandish=self.webpackChunkWebBehandish||[]).push([[993],{39993:(A,g,n)=>{n.d(g,{j:()=>F});var C=n(10467),D=n(86466),c=n(88574),m=n(842),d=n(21626),u=n(50179),h=n(68974),e=n(4020),M=n(89417),v=n(24393),P=n(97795),T=n(21223),O=n(18498),S=n(97302),B=n(49898),x=n(60177);const f=["dlgBase"],I=["picker"],b=()=>({standalone:!0}),y=s=>({ConditionPickerStrategy:s});function U(s,N){if(1&s&&e.nrm(0,"behObjectPicker",6,1),2&s){let a;const t=e.XpG();e.Y8G("MultiSelect",!0)("ConditionPickerComponent",t.pickerType)("DataPropertyName","Name")("SelectionMode","Leaf")("FormControl",t.BizForm.get("Names"))("Title",null!==(a=t.BizForm.get("Names").value)&&void 0!==a?a:"\u0627\u0646\u062a\u062e\u0627\u0628 ")("ExtraData",e.eq3(13,y,t.CndStrategy))("HttpParams",t.HttpParams)("SelectedItemsOptimization",!0)("ShowModal",!0)("ModalHeader","\u0627\u0646\u062a\u062e\u0627\u0628 "+t.Title)("PlaceHolder",t.Title)("ID","NamesPicker")}}let F=(()=>{class s extends D.H{constructor(a,t,r,o,E,l){super(),this.formBuilder=a,this.systemSetting=t,this.excelService=r,this.kernelService=o,this.router=E,this.dynamicComponentService=l,this.Title=""}get FormTitle(){return"\u062a\u0628\u062f\u06cc\u0644 \u0628\u0647 \u0641\u0627\u06cc\u0644 \u0627\u06a9\u0633\u0644"}get FormID(){return"dlgconvertToExcelFile"}get SubmitObservable(){return this.onSubmit(!1)}ngOnInit(){this.SetBizForm()}SetBizForm(){this.bizForm=this.formBuilder.group({Names:[{value:"",disabled:!1}],Active:[{value:!1,disabled:!1}]})}onSubmit(a=!1){var t=this,r=(new d.Nl).set("TreeType",`${this.TreeType}`).set("Active",`${this.BizForm.controls?.Active?.value??0}`).set("Cnd",`${this.picker?.NgModel?.map(o=>o.ID)?.join(",")??""}`);return this.kernelService.PrepareExcelFilesToTreeConvert(r).subscribe(o=>{this.excelFileDatas=o;const l=`\u0641\u0627\u06cc\u0644 \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647: ${(this.excelFileDatas?.map(i=>i?.FileName?.replace(".xlsx","").replace("\\",""))).join(", ")}\n\u0630\u062e\u06cc\u0631\u0647 \u0634\u0648\u062f\u061f`;h.y.ShowMessageBox(l,u.V.Question).then(function(){var i=(0,C.A)(function*(p){if(p.isConfirmed)for(let _ of t.excelFileDatas)_.FileName=_.FileName.replace(".xlsx","").replace("\\",""),t.ExportToExcel(_)});return function(p){return i.apply(this,arguments)}}())},o=>h.y.ShowMessageBox(o?.Error??o,u.V.Error)),null}ExportToExcel(a){const t=a.Data[0],r=[];for(let o=1;o<a.Data.length;o++)r.push(a.Data[o]);this.excelService.ExportToExcel(a.FileName,t,r)}OpenModal(){this.SetBizForm();var a=this.dynamicComponentService?.ConditionPickers?.get(this.TreeType);this.pickerType=a?.ComponentType,this.Title=a?.Title??"",this.CndStrategy=a?.Strategy,this.HttpParams=(new d.Nl).set("ShowIdle",!0),this.dlgBase?.modalBaseDialog?.onOpenModal()}static{this.\u0275fac=function(t){return new(t||s)(e.rXU(M.ze),e.rXU(v.b),e.rXU(P.V),e.rXU(T.h3),e.rXU(O.Ix),e.rXU(S._i))}}static{this.\u0275cmp=e.VBU({type:s,selectors:[["convertTreeToExcel"]],viewQuery:function(t,r){if(1&t&&(e.GBs(f,5,c.y),e.GBs(I,5,m.a)),2&t){let o;e.mGM(o=e.lsd())&&(r.dlgBase=o.first),e.mGM(o=e.lsd())&&(r.picker=o.first)}},standalone:!1,features:[e.Vt3],decls:6,vars:10,consts:[["dlgBase",""],["picker",""],[3,"FormStrategy","ShowMessageBox","ShowLoadingSpinner"],[1,"row"],["class","col-xs-12 col-sm-6 col-lg-6 from-group",3,"MultiSelect","ConditionPickerComponent","DataPropertyName","SelectionMode","FormControl","Title","ExtraData","HttpParams","SelectedItemsOptimization","ShowModal","ModalHeader","PlaceHolder","ID",4,"ngIf"],[1,"col-xs-12","col-sm-6","col-lg-4","mt-1","from-group",3,"ID","Label","FormControl","NgModelOptions","NgModel"],[1,"col-xs-12","col-sm-6","col-lg-6","from-group",3,"MultiSelect","ConditionPickerComponent","DataPropertyName","SelectionMode","FormControl","Title","ExtraData","HttpParams","SelectedItemsOptimization","ShowModal","ModalHeader","PlaceHolder","ID"]],template:function(t,r){if(1&t&&(e.j41(0,"behBaseDialog",2,0)(2,"div",3),e.DNE(3,U,2,15,"behObjectPicker",4),e.k0s(),e.j41(4,"div",3),e.nrm(5,"behCheckbox",5),e.k0s()()),2&t){const o=e.sdS(1);e.Y8G("FormStrategy",r)("ShowMessageBox",!0)("ShowLoadingSpinner",!1),e.R7$(3),e.Y8G("ngIf",null==o||null==o.modalBaseDialog?null:o.modalBaseDialog.IsOpen),e.R7$(2),e.Y8G("ID","cbxActive")("Label","\u0622\u06cc\u062a\u0645 \u0647\u0627\u06cc \u0641\u0639\u0627\u0644")("FormControl",r.bizForm.get("Active"))("NgModelOptions",e.lJ4(9,b))("NgModel",!0)}},dependencies:[B.S,m.a,c.y,x.bT],encapsulation:2})}}return s})()}}]);