@adins/ucsearch 2.9.11 → 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.
- package/README.md +6 -0
- package/esm2020/lib/ucsearch.component.mjs +36 -24
- package/fesm2015/adins-ucsearch.mjs +35 -23
- package/fesm2015/adins-ucsearch.mjs.map +1 -1
- package/fesm2020/adins-ucsearch.mjs +35 -23
- package/fesm2020/adins-ucsearch.mjs.map +1 -1
- package/lib/ucsearch.component.d.ts +2 -2
- package/package.json +2 -2
|
@@ -583,7 +583,7 @@ class UCSearchComponent {
|
|
|
583
583
|
postJSON(url, criteria = null) {
|
|
584
584
|
return this.http.post(url, criteria);
|
|
585
585
|
}
|
|
586
|
-
searchClick() {
|
|
586
|
+
searchClick(IsExportExcel = false) {
|
|
587
587
|
let filtered = this.configuration.component.filter((item, i, arr) => arr.findIndex((x) => (x.name === item.name)) === i);
|
|
588
588
|
for (let i = 0; i < filtered.length; i++) {
|
|
589
589
|
if (filtered[i].type == "numeric") {
|
|
@@ -599,7 +599,10 @@ class UCSearchComponent {
|
|
|
599
599
|
};
|
|
600
600
|
}
|
|
601
601
|
this.pageNow = 1;
|
|
602
|
-
|
|
602
|
+
let rowPerPage = this.pageSize;
|
|
603
|
+
if (IsExportExcel)
|
|
604
|
+
rowPerPage = 9999;
|
|
605
|
+
this.search(this.apiUrl, this.pageNow, rowPerPage, order, this.arrCrit, IsExportExcel);
|
|
603
606
|
}
|
|
604
607
|
async reset() {
|
|
605
608
|
this.searchForm.resetForm({
|
|
@@ -607,7 +610,7 @@ class UCSearchComponent {
|
|
|
607
610
|
});
|
|
608
611
|
await this.initiateForm();
|
|
609
612
|
}
|
|
610
|
-
search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array()) {
|
|
613
|
+
search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array(), IsExportExcel = false) {
|
|
611
614
|
let request = new RequestCriteriaObj();
|
|
612
615
|
let arrCrit = new Array();
|
|
613
616
|
let IsQueryIn = false;
|
|
@@ -776,6 +779,11 @@ class UCSearchComponent {
|
|
|
776
779
|
request.integrationObj = this.searchInput.integrationObj;
|
|
777
780
|
}
|
|
778
781
|
this.http.post(apiUrl, request).subscribe((response) => {
|
|
782
|
+
if (IsExportExcel) {
|
|
783
|
+
this.ExcelData = response["Data"];
|
|
784
|
+
this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
779
787
|
let qryPaging = {
|
|
780
788
|
response: response,
|
|
781
789
|
pageNow: pageNo
|
|
@@ -797,7 +805,9 @@ class UCSearchComponent {
|
|
|
797
805
|
MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LT"));
|
|
798
806
|
}
|
|
799
807
|
if (MinComponent && MaxComponent) {
|
|
800
|
-
|
|
808
|
+
let minValue = this.myForm.nativeElement[MinComponent.id].valueAsNumber;
|
|
809
|
+
let maxValue = this.myForm.nativeElement[MaxComponent.id].valueAsNumber;
|
|
810
|
+
if (minValue > maxValue) {
|
|
801
811
|
this.toastr.warning(MinComponent.label + " must be less than " + MaxComponent.label);
|
|
802
812
|
return false;
|
|
803
813
|
}
|
|
@@ -841,24 +851,26 @@ class UCSearchComponent {
|
|
|
841
851
|
element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));
|
|
842
852
|
}
|
|
843
853
|
exportAsXLSX() {
|
|
844
|
-
|
|
845
|
-
request
|
|
846
|
-
request.
|
|
847
|
-
request.
|
|
848
|
-
request.
|
|
849
|
-
request.
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
else {
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
this.http.post(this.apiUrl, request).subscribe(
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
854
|
+
this.searchClick(true);
|
|
855
|
+
// let request = new RequestCriteriaObj();
|
|
856
|
+
// request.pageNo = 1;
|
|
857
|
+
// request.rowPerPage = 9999;
|
|
858
|
+
// request.orderBy = null;
|
|
859
|
+
// request.criteria = [];
|
|
860
|
+
// request.queryString = this.configuration.querystring;
|
|
861
|
+
// if (!this.searchInput.isJoinExAPI) {
|
|
862
|
+
// request.integrationObj = null;
|
|
863
|
+
// } else {
|
|
864
|
+
// request.integrationObj = this.searchInput.integrationObj;
|
|
865
|
+
// }
|
|
866
|
+
// this.http.post(this.apiUrl, request).subscribe(
|
|
867
|
+
// response => {
|
|
868
|
+
// this.ExcelData = response["Data"];
|
|
869
|
+
// this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
|
|
870
|
+
// },
|
|
871
|
+
// (error) => {
|
|
872
|
+
// console.log(error);
|
|
873
|
+
// });
|
|
862
874
|
}
|
|
863
875
|
onChangeEvent(optValue, afFilter) {
|
|
864
876
|
let jsonComp = this.configuration.component;
|
|
@@ -1157,7 +1169,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
|
|
|
1157
1169
|
args: ['enjiForm']
|
|
1158
1170
|
}], myForm: [{
|
|
1159
1171
|
type: ViewChild,
|
|
1160
|
-
args: ['formIdSearch'
|
|
1172
|
+
args: ['formIdSearch']
|
|
1161
1173
|
}], searchInput: [{
|
|
1162
1174
|
type: Input
|
|
1163
1175
|
}], pageSize: [{
|