@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
|
@@ -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
|
-
|
|
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
|
|
@@ -804,7 +812,9 @@ class UCSearchComponent {
|
|
|
804
812
|
MaxComponent = this.configuration.component.find(x => x.name == component.name && (x.restriction.toUpperCase() == "LT"));
|
|
805
813
|
}
|
|
806
814
|
if (MinComponent && MaxComponent) {
|
|
807
|
-
|
|
815
|
+
let minValue = this.myForm.nativeElement[MinComponent.id].valueAsNumber;
|
|
816
|
+
let maxValue = this.myForm.nativeElement[MaxComponent.id].valueAsNumber;
|
|
817
|
+
if (minValue > maxValue) {
|
|
808
818
|
this.toastr.warning(MinComponent.label + " must be less than " + MaxComponent.label);
|
|
809
819
|
return false;
|
|
810
820
|
}
|
|
@@ -848,24 +858,26 @@ class UCSearchComponent {
|
|
|
848
858
|
element.target.value = parseFloat(element.target.value.toString().replace(/,/g, ''));
|
|
849
859
|
}
|
|
850
860
|
exportAsXLSX() {
|
|
851
|
-
|
|
852
|
-
request
|
|
853
|
-
request.
|
|
854
|
-
request.
|
|
855
|
-
request.
|
|
856
|
-
request.
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
else {
|
|
861
|
-
|
|
862
|
-
}
|
|
863
|
-
this.http.post(this.apiUrl, request).subscribe(
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
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
|
+
// });
|
|
869
881
|
}
|
|
870
882
|
onChangeEvent(optValue, afFilter) {
|
|
871
883
|
let jsonComp = this.configuration.component;
|
|
@@ -1166,7 +1178,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImpor
|
|
|
1166
1178
|
args: ['enjiForm']
|
|
1167
1179
|
}], myForm: [{
|
|
1168
1180
|
type: ViewChild,
|
|
1169
|
-
args: ['formIdSearch'
|
|
1181
|
+
args: ['formIdSearch']
|
|
1170
1182
|
}], searchInput: [{
|
|
1171
1183
|
type: Input
|
|
1172
1184
|
}], pageSize: [{
|