@adins/ucsearch 2.9.12 → 2.9.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -588,7 +588,7 @@ class UCSearchComponent {
588
588
  postJSON(url, criteria = null) {
589
589
  return this.http.post(url, criteria);
590
590
  }
591
- searchClick() {
591
+ searchClick(IsExportExcel = false) {
592
592
  let filtered = this.configuration.component.filter((item, i, arr) => arr.findIndex((x) => (x.name === item.name)) === i);
593
593
  for (let i = 0; i < filtered.length; i++) {
594
594
  if (filtered[i].type == "numeric") {
@@ -604,7 +604,10 @@ class UCSearchComponent {
604
604
  };
605
605
  }
606
606
  this.pageNow = 1;
607
- this.search(this.apiUrl, this.pageNow, this.pageSize, order, this.arrCrit);
607
+ let rowPerPage = this.pageSize;
608
+ if (IsExportExcel)
609
+ rowPerPage = 9999;
610
+ this.search(this.apiUrl, this.pageNow, rowPerPage, order, this.arrCrit, IsExportExcel);
608
611
  }
609
612
  reset() {
610
613
  return __awaiter(this, void 0, void 0, function* () {
@@ -614,7 +617,7 @@ class UCSearchComponent {
614
617
  yield this.initiateForm();
615
618
  });
616
619
  }
617
- search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array()) {
620
+ search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array(), IsExportExcel = false) {
618
621
  let request = new RequestCriteriaObj();
619
622
  let arrCrit = new Array();
620
623
  let IsQueryIn = false;
@@ -783,6 +786,11 @@ class UCSearchComponent {
783
786
  request.integrationObj = this.searchInput.integrationObj;
784
787
  }
785
788
  this.http.post(apiUrl, request).subscribe((response) => {
789
+ if (IsExportExcel) {
790
+ this.ExcelData = response["Data"];
791
+ this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
792
+ return;
793
+ }
786
794
  let qryPaging = {
787
795
  response: response,
788
796
  pageNow: pageNo
@@ -850,24 +858,26 @@ class UCSearchComponent {
850
858
  element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));
851
859
  }
852
860
  exportAsXLSX() {
853
- let request = new RequestCriteriaObj();
854
- request.pageNo = 1;
855
- request.rowPerPage = 9999;
856
- request.orderBy = null;
857
- request.criteria = [];
858
- request.queryString = this.configuration.querystring;
859
- if (!this.searchInput.isJoinExAPI) {
860
- request.integrationObj = null;
861
- }
862
- else {
863
- request.integrationObj = this.searchInput.integrationObj;
864
- }
865
- this.http.post(this.apiUrl, request).subscribe(response => {
866
- this.ExcelData = response["Data"];
867
- this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
868
- }, (error) => {
869
- console.log(error);
870
- });
861
+ this.searchClick(true);
862
+ // let request = new RequestCriteriaObj();
863
+ // request.pageNo = 1;
864
+ // request.rowPerPage = 9999;
865
+ // request.orderBy = null;
866
+ // request.criteria = [];
867
+ // request.queryString = this.configuration.querystring;
868
+ // if (!this.searchInput.isJoinExAPI) {
869
+ // request.integrationObj = null;
870
+ // } else {
871
+ // request.integrationObj = this.searchInput.integrationObj;
872
+ // }
873
+ // this.http.post(this.apiUrl, request).subscribe(
874
+ // response => {
875
+ // this.ExcelData = response["Data"];
876
+ // this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
877
+ // },
878
+ // (error) => {
879
+ // console.log(error);
880
+ // });
871
881
  }
872
882
  onChangeEvent(optValue, afFilter) {
873
883
  let jsonComp = this.configuration.component;