@adins/ucsearch 2.11.28 → 2.13.2
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 +9 -0
- package/adins-ucsearch.metadata.json +1 -1
- package/bundles/adins-ucsearch.umd.js +106 -51
- package/bundles/adins-ucsearch.umd.js.map +1 -1
- package/bundles/adins-ucsearch.umd.min.js +1 -1
- package/bundles/adins-ucsearch.umd.min.js.map +1 -1
- package/esm2015/lib/ucsearch.component.js +101 -53
- package/esm5/lib/ucsearch.component.js +111 -54
- package/fesm2015/adins-ucsearch.js +100 -52
- package/fesm2015/adins-ucsearch.js.map +1 -1
- package/fesm5/adins-ucsearch.js +110 -53
- package/fesm5/adins-ucsearch.js.map +1 -1
- package/lib/ucsearch.component.d.ts +3 -2
- package/package.json +2 -2
|
@@ -691,25 +691,28 @@ class UCSearchComponent {
|
|
|
691
691
|
return this.http.post(url, criteria);
|
|
692
692
|
}
|
|
693
693
|
/**
|
|
694
|
+
* @param {?=} IsExportExcel
|
|
694
695
|
* @return {?}
|
|
695
696
|
*/
|
|
696
|
-
searchClick() {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
697
|
+
searchClick(IsExportExcel = false) {
|
|
698
|
+
/** @type {?} */
|
|
699
|
+
let filtered = this.configuration.component.filter((/**
|
|
700
|
+
* @param {?} item
|
|
701
|
+
* @param {?} i
|
|
702
|
+
* @param {?} arr
|
|
703
|
+
* @return {?}
|
|
704
|
+
*/
|
|
705
|
+
(item, i, arr) => arr.findIndex((/**
|
|
706
|
+
* @param {?} x
|
|
707
|
+
* @return {?}
|
|
708
|
+
*/
|
|
709
|
+
(x) => (x.name === item.name))) === i));
|
|
710
|
+
for (let i = 0; i < filtered.length; i++) {
|
|
711
|
+
if (filtered[i].type == "numeric") {
|
|
712
|
+
if (!this.checkValueGteLte(filtered[i]))
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
713
716
|
/** @type {?} */
|
|
714
717
|
let order = null;
|
|
715
718
|
if (this.configuration.orderby != null) {
|
|
@@ -719,7 +722,11 @@ class UCSearchComponent {
|
|
|
719
722
|
};
|
|
720
723
|
}
|
|
721
724
|
this.pageNow = 1;
|
|
722
|
-
|
|
725
|
+
/** @type {?} */
|
|
726
|
+
let rowPerPage = this.pageSize;
|
|
727
|
+
if (IsExportExcel)
|
|
728
|
+
rowPerPage = 9999;
|
|
729
|
+
this.search(this.apiUrl, this.pageNow, rowPerPage, order, this.arrCrit, IsExportExcel);
|
|
723
730
|
}
|
|
724
731
|
/**
|
|
725
732
|
* @return {?}
|
|
@@ -738,9 +745,10 @@ class UCSearchComponent {
|
|
|
738
745
|
* @param {?} rowPerPage
|
|
739
746
|
* @param {?} orderBy
|
|
740
747
|
* @param {?=} addCrit
|
|
748
|
+
* @param {?=} IsExportExcel
|
|
741
749
|
* @return {?}
|
|
742
750
|
*/
|
|
743
|
-
search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array()) {
|
|
751
|
+
search(apiUrl, pageNo, rowPerPage, orderBy, addCrit = new Array(), IsExportExcel = false) {
|
|
744
752
|
/** @type {?} */
|
|
745
753
|
let request = new RequestCriteriaObj();
|
|
746
754
|
/** @type {?} */
|
|
@@ -911,10 +919,8 @@ class UCSearchComponent {
|
|
|
911
919
|
}
|
|
912
920
|
}
|
|
913
921
|
request.criteria = arrCrit;
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
}
|
|
917
|
-
else {
|
|
922
|
+
request.integrationObj = null;
|
|
923
|
+
if (this.searchInput.isJoinExAPI) {
|
|
918
924
|
request.integrationObj = this.searchInput.integrationObj;
|
|
919
925
|
}
|
|
920
926
|
this.http.post(apiUrl, request).subscribe((/**
|
|
@@ -922,6 +928,11 @@ class UCSearchComponent {
|
|
|
922
928
|
* @return {?}
|
|
923
929
|
*/
|
|
924
930
|
(response) => {
|
|
931
|
+
if (IsExportExcel) {
|
|
932
|
+
this.ExcelData = response["Data"];
|
|
933
|
+
this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
925
936
|
/** @type {?} */
|
|
926
937
|
let qryPaging = {
|
|
927
938
|
response: response,
|
|
@@ -982,6 +993,46 @@ class UCSearchComponent {
|
|
|
982
993
|
}
|
|
983
994
|
}));
|
|
984
995
|
}
|
|
996
|
+
/**
|
|
997
|
+
* @param {?} component
|
|
998
|
+
* @return {?}
|
|
999
|
+
*/
|
|
1000
|
+
checkValueGteLte(component) {
|
|
1001
|
+
//cek yg pakai restriction gte/lte/gt/lt
|
|
1002
|
+
/** @type {?} */
|
|
1003
|
+
let MinComponent = this.configuration.component.find((/**
|
|
1004
|
+
* @param {?} x
|
|
1005
|
+
* @return {?}
|
|
1006
|
+
*/
|
|
1007
|
+
x => x.name == component.name && (x.restriction.toUpperCase() == "GTE"))) == undefined ? this.configuration.component.find((/**
|
|
1008
|
+
* @param {?} x
|
|
1009
|
+
* @return {?}
|
|
1010
|
+
*/
|
|
1011
|
+
x => x.name == component.name && (x.restriction.toUpperCase() == "GT"))) : this.configuration.component.find((/**
|
|
1012
|
+
* @param {?} x
|
|
1013
|
+
* @return {?}
|
|
1014
|
+
*/
|
|
1015
|
+
x => x.name == component.name && (x.restriction.toUpperCase() == "GTE")));
|
|
1016
|
+
/** @type {?} */
|
|
1017
|
+
let MaxComponent = this.configuration.component.find((/**
|
|
1018
|
+
* @param {?} x
|
|
1019
|
+
* @return {?}
|
|
1020
|
+
*/
|
|
1021
|
+
x => x.name == component.name && (x.restriction.toUpperCase() == "LTE"))) == undefined ? this.configuration.component.find((/**
|
|
1022
|
+
* @param {?} x
|
|
1023
|
+
* @return {?}
|
|
1024
|
+
*/
|
|
1025
|
+
x => x.name == component.name && (x.restriction.toUpperCase() == "LT"))) : this.configuration.component.find((/**
|
|
1026
|
+
* @param {?} x
|
|
1027
|
+
* @return {?}
|
|
1028
|
+
*/
|
|
1029
|
+
x => x.name == component.name && (x.restriction.toUpperCase() == "LTE")));
|
|
1030
|
+
if (this.myForm.nativeElement[MinComponent.id].value > this.myForm.nativeElement[MaxComponent.id].value) {
|
|
1031
|
+
this.toastr.warning(MinComponent.label + " must be less than " + MaxComponent.label);
|
|
1032
|
+
return false;
|
|
1033
|
+
}
|
|
1034
|
+
return true;
|
|
1035
|
+
}
|
|
985
1036
|
/**
|
|
986
1037
|
* @param {?} element
|
|
987
1038
|
* @return {?}
|
|
@@ -1002,33 +1053,26 @@ class UCSearchComponent {
|
|
|
1002
1053
|
* @return {?}
|
|
1003
1054
|
*/
|
|
1004
1055
|
exportAsXLSX() {
|
|
1005
|
-
|
|
1006
|
-
let request = new RequestCriteriaObj();
|
|
1007
|
-
request.pageNo = 1;
|
|
1008
|
-
request.rowPerPage = 9999;
|
|
1009
|
-
request.orderBy = null;
|
|
1010
|
-
request.criteria = [];
|
|
1011
|
-
request.queryString = this.configuration.querystring;
|
|
1012
|
-
if (!this.searchInput.isJoinExAPI) {
|
|
1013
|
-
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
}), (/**
|
|
1026
|
-
* @param {?} error
|
|
1027
|
-
* @return {?}
|
|
1028
|
-
*/
|
|
1029
|
-
(error) => {
|
|
1030
|
-
console.log(error);
|
|
1031
|
-
}));
|
|
1056
|
+
this.searchClick(true);
|
|
1057
|
+
// let request = new RequestCriteriaObj();
|
|
1058
|
+
// request.pageNo = 1;
|
|
1059
|
+
// request.rowPerPage = 9999;
|
|
1060
|
+
// request.orderBy = null;
|
|
1061
|
+
// request.criteria = [];
|
|
1062
|
+
// request.queryString = this.configuration.querystring;
|
|
1063
|
+
// if (!this.searchInput.isJoinExAPI) {
|
|
1064
|
+
// request.integrationObj = null;
|
|
1065
|
+
// } else {
|
|
1066
|
+
// request.integrationObj = this.searchInput.integrationObj;
|
|
1067
|
+
// }
|
|
1068
|
+
// this.http.post(this.apiUrl, request).subscribe(
|
|
1069
|
+
// response => {
|
|
1070
|
+
// this.ExcelData = response["Data"];
|
|
1071
|
+
// this.excelService.exportAsExcelFile(this.ExcelData, 'sample');
|
|
1072
|
+
// },
|
|
1073
|
+
// (error) => {
|
|
1074
|
+
// console.log(error);
|
|
1075
|
+
// });
|
|
1032
1076
|
}
|
|
1033
1077
|
/**
|
|
1034
1078
|
* @param {?} optValue
|
|
@@ -1095,8 +1139,12 @@ class UCSearchComponent {
|
|
|
1095
1139
|
let ddl = component.options;
|
|
1096
1140
|
/** @type {?} */
|
|
1097
1141
|
let text = ddl[ddl.selectedIndex].value.trim();
|
|
1098
|
-
|
|
1099
|
-
|
|
1142
|
+
/** @type {?} */
|
|
1143
|
+
let listValue = text.split(';');
|
|
1144
|
+
/** @type {?} */
|
|
1145
|
+
let listWfKey = wfKeyFilter.split(';');
|
|
1146
|
+
for (let i = 0; i < listValue.length; i++) {
|
|
1147
|
+
this.searchInput.integrationObj.requestObj[listWfKey[i]] = listValue[i];
|
|
1100
1148
|
}
|
|
1101
1149
|
}
|
|
1102
1150
|
/**
|