@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.
@@ -167,7 +167,8 @@ ExportTypeConstant.EXP_TYPE_PDF = 0;
167
167
  ExportTypeConstant.EXP_TYPE_XLS = 1;
168
168
  ExportTypeConstant.EXP_TYPE_XLSX = 2;
169
169
  ExportTypeConstant.EXP_TYPE_DOC = 3;
170
- ExportTypeConstant.EXP_TYPE_DOCX = 4;
170
+ ExportTypeConstant.EXP_TYPE_DOCX = 4;
171
+ ExportTypeConstant.EXP_TYPE_JPDF = 5;
171
172
 
172
173
  class KeyValueUCSearchObj {
173
174
  constructor() {
@@ -250,22 +251,18 @@ class UCSearchComponent {
250
251
  key: ExportTypeConstant.EXP_TYPE_PDF,
251
252
  value: "PDF"
252
253
  },
253
- {
254
- key: ExportTypeConstant.EXP_TYPE_XLS,
255
- value: "Excel 2003"
256
- },
257
254
  {
258
255
  key: ExportTypeConstant.EXP_TYPE_XLSX,
259
256
  value: "Excel 2007"
260
257
  },
261
- {
262
- key: ExportTypeConstant.EXP_TYPE_DOC,
263
- value: "Document"
264
- },
265
258
  {
266
259
  key: ExportTypeConstant.EXP_TYPE_DOCX,
267
260
  value: "Document XML"
268
261
  },
262
+ {
263
+ key: ExportTypeConstant.EXP_TYPE_JPDF,
264
+ value: "Justify PDF"
265
+ }
269
266
  ];
270
267
  this.ListOfMonth = new ListKeyValueMonth();
271
268
  this.ListOfYear = new Array();
@@ -583,7 +580,7 @@ class UCSearchComponent {
583
580
  postJSON(url, criteria = null) {
584
581
  return this.http.post(url, criteria);
585
582
  }
586
- searchClick() {
583
+ searchClick(IsExportExcel = false) {
587
584
  let filtered = this.configuration.component.filter((item, i, arr) => arr.findIndex((x) => (x.name === item.name)) === i);
588
585
  for (let i = 0; i < filtered.length; i++) {
589
586
  if (filtered[i].type == "numeric") {
@@ -599,7 +596,10 @@ class UCSearchComponent {
599
596
  };
600
597
  }
601
598
  this.pageNow = 1;
602
- this.search(this.apiUrl, this.pageNow, this.pageSize, order, this.arrCrit);
599
+ let rowPerPage = this.pageSize;
600
+ if (IsExportExcel)
601
+ rowPerPage = 9999;
602
+ this.search(this.apiUrl, this.pageNow, rowPerPage, order, this.arrCrit, IsExportExcel);
603
603
  }
604
604
  async reset() {
605
605
  this.searchForm.resetForm({
@@ -607,7 +607,7 @@ class UCSearchComponent {
607
607
  });
608
608
  await this.initiateForm();
609
609
  }
610
- search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array()) {
610
+ search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array(), IsExportExcel = false) {
611
611
  let request = new RequestCriteriaObj();
612
612
  let arrCrit = new Array();
613
613
  let IsQueryIn = false;
@@ -769,13 +769,16 @@ class UCSearchComponent {
769
769
  }
770
770
  }
771
771
  request.criteria = arrCrit;
772
- if (!this.searchInput.isJoinExAPI) {
773
- request.integrationObj = null;
774
- }
775
- else {
772
+ request.integrationObj = null;
773
+ if (this.searchInput.isJoinExAPI) {
776
774
  request.integrationObj = this.searchInput.integrationObj;
777
775
  }
778
776
  this.http.post(apiUrl, request).subscribe((response) => {
777
+ if (IsExportExcel) {
778
+ this.ExcelData = response["Data"];
779
+ this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
780
+ return;
781
+ }
779
782
  let qryPaging = {
780
783
  response: response,
781
784
  pageNow: pageNo
@@ -843,24 +846,26 @@ class UCSearchComponent {
843
846
  element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));
844
847
  }
845
848
  exportAsXLSX() {
846
- let request = new RequestCriteriaObj();
847
- request.pageNo = 1;
848
- request.rowPerPage = 9999;
849
- request.orderBy = null;
850
- request.criteria = [];
851
- request.queryString = this.configuration.querystring;
852
- if (!this.searchInput.isJoinExAPI) {
853
- request.integrationObj = null;
854
- }
855
- else {
856
- request.integrationObj = this.searchInput.integrationObj;
857
- }
858
- this.http.post(this.apiUrl, request).subscribe(response => {
859
- this.ExcelData = response["Data"];
860
- this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
861
- }, (error) => {
862
- console.log(error);
863
- });
849
+ this.searchClick(true);
850
+ // let request = new RequestCriteriaObj();
851
+ // request.pageNo = 1;
852
+ // request.rowPerPage = 9999;
853
+ // request.orderBy = null;
854
+ // request.criteria = [];
855
+ // request.queryString = this.configuration.querystring;
856
+ // if (!this.searchInput.isJoinExAPI) {
857
+ // request.integrationObj = null;
858
+ // } else {
859
+ // request.integrationObj = this.searchInput.integrationObj;
860
+ // }
861
+ // this.http.post(this.apiUrl, request).subscribe(
862
+ // response => {
863
+ // this.ExcelData = response["Data"];
864
+ // this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
865
+ // },
866
+ // (error) => {
867
+ // console.log(error);
868
+ // });
864
869
  }
865
870
  onChangeEvent(optValue, afFilter) {
866
871
  let jsonComp = this.configuration.component;