@adins/ucsearch 2.9.12 → 2.9.14

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.
@@ -168,7 +168,8 @@ ExportTypeConstant.EXP_TYPE_PDF = 0;
168
168
  ExportTypeConstant.EXP_TYPE_XLS = 1;
169
169
  ExportTypeConstant.EXP_TYPE_XLSX = 2;
170
170
  ExportTypeConstant.EXP_TYPE_DOC = 3;
171
- ExportTypeConstant.EXP_TYPE_DOCX = 4;
171
+ ExportTypeConstant.EXP_TYPE_DOCX = 4;
172
+ ExportTypeConstant.EXP_TYPE_JPDF = 5;
172
173
 
173
174
  class KeyValueUCSearchObj {
174
175
  constructor() {
@@ -251,22 +252,18 @@ class UCSearchComponent {
251
252
  key: ExportTypeConstant.EXP_TYPE_PDF,
252
253
  value: "PDF"
253
254
  },
254
- {
255
- key: ExportTypeConstant.EXP_TYPE_XLS,
256
- value: "Excel 2003"
257
- },
258
255
  {
259
256
  key: ExportTypeConstant.EXP_TYPE_XLSX,
260
257
  value: "Excel 2007"
261
258
  },
262
- {
263
- key: ExportTypeConstant.EXP_TYPE_DOC,
264
- value: "Document"
265
- },
266
259
  {
267
260
  key: ExportTypeConstant.EXP_TYPE_DOCX,
268
261
  value: "Document XML"
269
262
  },
263
+ {
264
+ key: ExportTypeConstant.EXP_TYPE_JPDF,
265
+ value: "Justify PDF"
266
+ }
270
267
  ];
271
268
  this.ListOfMonth = new ListKeyValueMonth();
272
269
  this.ListOfYear = new Array();
@@ -588,7 +585,7 @@ class UCSearchComponent {
588
585
  postJSON(url, criteria = null) {
589
586
  return this.http.post(url, criteria);
590
587
  }
591
- searchClick() {
588
+ searchClick(IsExportExcel = false) {
592
589
  let filtered = this.configuration.component.filter((item, i, arr) => arr.findIndex((x) => (x.name === item.name)) === i);
593
590
  for (let i = 0; i < filtered.length; i++) {
594
591
  if (filtered[i].type == "numeric") {
@@ -604,7 +601,10 @@ class UCSearchComponent {
604
601
  };
605
602
  }
606
603
  this.pageNow = 1;
607
- this.search(this.apiUrl, this.pageNow, this.pageSize, order, this.arrCrit);
604
+ let rowPerPage = this.pageSize;
605
+ if (IsExportExcel)
606
+ rowPerPage = 9999;
607
+ this.search(this.apiUrl, this.pageNow, rowPerPage, order, this.arrCrit, IsExportExcel);
608
608
  }
609
609
  reset() {
610
610
  return __awaiter(this, void 0, void 0, function* () {
@@ -614,7 +614,7 @@ class UCSearchComponent {
614
614
  yield this.initiateForm();
615
615
  });
616
616
  }
617
- search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array()) {
617
+ search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array(), IsExportExcel = false) {
618
618
  let request = new RequestCriteriaObj();
619
619
  let arrCrit = new Array();
620
620
  let IsQueryIn = false;
@@ -776,13 +776,16 @@ class UCSearchComponent {
776
776
  }
777
777
  }
778
778
  request.criteria = arrCrit;
779
- if (!this.searchInput.isJoinExAPI) {
780
- request.integrationObj = null;
781
- }
782
- else {
779
+ request.integrationObj = null;
780
+ if (this.searchInput.isJoinExAPI) {
783
781
  request.integrationObj = this.searchInput.integrationObj;
784
782
  }
785
783
  this.http.post(apiUrl, request).subscribe((response) => {
784
+ if (IsExportExcel) {
785
+ this.ExcelData = response["Data"];
786
+ this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
787
+ return;
788
+ }
786
789
  let qryPaging = {
787
790
  response: response,
788
791
  pageNow: pageNo
@@ -850,24 +853,26 @@ class UCSearchComponent {
850
853
  element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));
851
854
  }
852
855
  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
- });
856
+ this.searchClick(true);
857
+ // let request = new RequestCriteriaObj();
858
+ // request.pageNo = 1;
859
+ // request.rowPerPage = 9999;
860
+ // request.orderBy = null;
861
+ // request.criteria = [];
862
+ // request.queryString = this.configuration.querystring;
863
+ // if (!this.searchInput.isJoinExAPI) {
864
+ // request.integrationObj = null;
865
+ // } else {
866
+ // request.integrationObj = this.searchInput.integrationObj;
867
+ // }
868
+ // this.http.post(this.apiUrl, request).subscribe(
869
+ // response => {
870
+ // this.ExcelData = response["Data"];
871
+ // this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
872
+ // },
873
+ // (error) => {
874
+ // console.log(error);
875
+ // });
871
876
  }
872
877
  onChangeEvent(optValue, afFilter) {
873
878
  let jsonComp = this.configuration.component;