diff --git a/js/gamutable.es6.js b/js/gamutable.es6.js index 0cc0993..bc9ef6f 100644 --- a/js/gamutable.es6.js +++ b/js/gamutable.es6.js @@ -414,7 +414,6 @@ let monTableau = { let url = this.apiuri; if (parseInt(id) > 0) { url += '&id=' + id; - console.log('url:' + url); } else { let config = localStorage.getItem('header_' + this.nameLocalStorage); config = recupJson(config); @@ -515,8 +514,10 @@ let monTableau = { Vue.nextTick(() => { this.chargement = false; + console.log(this.filtreselect); if (this.filtreselect) { let Tfiltres = recupJson(decodeURIComponent(this.filtreselect)); + localStorage.setItem('filtreselect_' + this.nameLocalStorage, JSON.stringify(Tfiltres)); Tfiltres.forEach((col) => { this.filtreColSelected[col.champ] = [ ...this.filtreColSelected[col.champ], @@ -524,6 +525,18 @@ let monTableau = { ]; }); this.filtreColModif++; + } else { + let filtreselect = localStorage.getItem('filtreselect_' + this.nameLocalStorage); + if (filtreselect) { + let Tfiltres = JSON.parse(filtreselect); + Tfiltres.forEach((col) => { + this.filtreColSelected[col.champ] = [ + ...this.filtreColSelected[col.champ], + ...col.valeurs, + ]; + }); + this.filtreColModif++; + } } if (parseInt(this._id) > 0) { diff --git a/js/gamutable.js b/js/gamutable.js index a3f8448..893bdce 100644 --- a/js/gamutable.js +++ b/js/gamutable.js @@ -466,7 +466,6 @@ var monTableau = { if (parseInt(id) > 0) { url += '&id=' + id; - console.log('url:' + url); } else { var config = localStorage.getItem('header_' + this.nameLocalStorage); config = recupJson(config); @@ -588,13 +587,27 @@ var monTableau = { Vue.nextTick(function () { _this4.chargement = false; + console.log(_this4.filtreselect); if (_this4.filtreselect) { var Tfiltres = recupJson(decodeURIComponent(_this4.filtreselect)); + localStorage.setItem('filtreselect_' + _this4.nameLocalStorage, JSON.stringify(Tfiltres)); Tfiltres.forEach(function (col) { _this4.filtreColSelected[col.champ] = [].concat(_toConsumableArray(_this4.filtreColSelected[col.champ]), _toConsumableArray(col.valeurs)); }); _this4.filtreColModif++; + } else { + var filtreselect = localStorage.getItem('filtreselect_' + _this4.nameLocalStorage); + + if (filtreselect) { + var _Tfiltres = JSON.parse(filtreselect); + + _Tfiltres.forEach(function (col) { + _this4.filtreColSelected[col.champ] = [].concat(_toConsumableArray(_this4.filtreColSelected[col.champ]), _toConsumableArray(col.valeurs)); + }); + + _this4.filtreColModif++; + } } if (parseInt(_this4._id) > 0) {