@monoui/vuejs 1.1.33 → 1.1.35
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/dist/main.js +2 -2
- package/package.json +1 -1
- package/src/components/Table/Table.vue +37 -38
package/package.json
CHANGED
|
@@ -495,11 +495,10 @@ export default {
|
|
|
495
495
|
this.addPopStateListener();
|
|
496
496
|
},
|
|
497
497
|
async mounted() {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
this.loadHistory();
|
|
498
|
+
const filterParams = this.getHistoryParameters("f-");
|
|
499
|
+
const sortingParams = this.getHistoryParameters("s-");
|
|
500
|
+
if (filterParams || sortingParams) {
|
|
501
|
+
this.loadHistory(filterParams, sortingParams);
|
|
503
502
|
}
|
|
504
503
|
if (this.autoLoad) {
|
|
505
504
|
await this.getValues();
|
|
@@ -517,7 +516,7 @@ export default {
|
|
|
517
516
|
this.loadHistory();
|
|
518
517
|
this.getValues(false);
|
|
519
518
|
},
|
|
520
|
-
loadHistory() {
|
|
519
|
+
loadHistory(filterParams, sortingParams) {
|
|
521
520
|
this.settings.currentPage = this.getHistoryParameter("page", 1);
|
|
522
521
|
this.settings.itemPerPage = this.getHistoryParameter(
|
|
523
522
|
"limit",
|
|
@@ -529,8 +528,8 @@ export default {
|
|
|
529
528
|
""
|
|
530
529
|
);
|
|
531
530
|
}
|
|
532
|
-
this.loadHistoryFilters();
|
|
533
|
-
this.loadHistorySorting();
|
|
531
|
+
this.loadHistoryFilters(filterParams);
|
|
532
|
+
this.loadHistorySorting(sortingParams);
|
|
534
533
|
},
|
|
535
534
|
sortableIcon(column) {
|
|
536
535
|
const currentSort = this.sorting.find(x => x.Column === column);
|
|
@@ -882,42 +881,42 @@ export default {
|
|
|
882
881
|
console.error(error);
|
|
883
882
|
}
|
|
884
883
|
},
|
|
885
|
-
loadHistoryFilters() {
|
|
886
|
-
|
|
884
|
+
loadHistoryFilters(filterParams) {
|
|
885
|
+
if (!filterParams) filterParams = this.getHistoryParameters("f-");
|
|
886
|
+
if (!filterParams) return;
|
|
887
|
+
|
|
887
888
|
const trimName = this.getHistoryName("f-");
|
|
888
|
-
const names = Object.keys(
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
});
|
|
899
|
-
}
|
|
889
|
+
const names = Object.keys(filterParams);
|
|
890
|
+
this.filters.splice(0, this.filters.length);
|
|
891
|
+
for (const paramName of names) {
|
|
892
|
+
const value = filterParams[paramName];
|
|
893
|
+
const column = paramName.replace(trimName, "");
|
|
894
|
+
if (value) {
|
|
895
|
+
this.filters.push({
|
|
896
|
+
Column: column,
|
|
897
|
+
Value: value
|
|
898
|
+
});
|
|
900
899
|
}
|
|
901
900
|
}
|
|
902
901
|
},
|
|
903
|
-
loadHistorySorting() {
|
|
904
|
-
|
|
902
|
+
loadHistorySorting(sortingParams) {
|
|
903
|
+
if (!sortingParams) sortingParams = this.getHistoryParameters("s-");
|
|
904
|
+
if (!sortingParams) return;
|
|
905
|
+
|
|
905
906
|
const trimName = this.getHistoryName("s-");
|
|
906
|
-
const names = Object.keys(
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
const column = paramName.replace(trimName, "");
|
|
907
|
+
const names = Object.keys(sortingParams);
|
|
908
|
+
this.sorting.splice(0, this.sorting.length);
|
|
909
|
+
for (const paramName of names) {
|
|
910
|
+
var paramValue = sortingParams[paramName];
|
|
911
|
+
let value = undefined;
|
|
912
|
+
if (paramValue && paramValue === "1") value = true;
|
|
913
|
+
else if (paramValue && paramValue === "0") value = false;
|
|
914
|
+
const column = paramName.replace(trimName, "");
|
|
915
915
|
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
}
|
|
916
|
+
this.sorting.push({
|
|
917
|
+
Column: column,
|
|
918
|
+
Asc: value
|
|
919
|
+
});
|
|
921
920
|
}
|
|
922
921
|
},
|
|
923
922
|
replaceHistory(state, storage = this.historyStorage) {
|