range chaine #4

Merged
vincent merged 3 commits from dev into master 2019-05-09 13:31:14 +00:00
Showing only changes of commit d08edaa007 - Show all commits

View File

@ -92,10 +92,17 @@ export default {
} }
this.$store.state.arrayresultchaines = []; this.$store.state.arrayresultchaines = [];
const arraychaine = [...new Set(this.chaine.split(" "))]; const arraychaine = [...new Set(this.chaine.split(" "))];
const re = new RegExp("^[0-9]*-[0-9]*$");
arraychaine.forEach(element => { arraychaine.forEach(element => {
if (element != "") { if (element != "") {
this.$store.dispatch('getchaine',{num:element}); if(re.test(element)){
var range=element.split("-")
for (var i = range[0]; i <= range[1]; i++) {
this.$store.dispatch('getchaine',{num:i});
}
}else{
this.$store.dispatch('getchaine',{num:element});
}
} }
}); });
}, },