|
@@ -257,10 +257,10 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
ressourceChangeHandler(ev: CustomEvent<{ ressources: Array<Ressource> }>) {
|
|
ressourceChangeHandler(ev: CustomEvent<{ ressources: Array<Ressource> }>) {
|
|
|
- this.commit(
|
|
|
|
|
- MutationTypes.reorderCreneauGroup,
|
|
|
|
|
- ev.detail.ressources.map((o) => o.id)
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ const ids = ev.detail.ressources.map((o) => o.id);
|
|
|
|
|
+ const current_id = this.creneauGroupList.map((o) => o.id);
|
|
|
|
|
+ const same_order = current_id.reduce((acc, id, idx) => acc && id == ids[idx], true);
|
|
|
|
|
+ if (!same_order) this.commit(MutationTypes.reorderCreneauGroup, ids);
|
|
|
},
|
|
},
|
|
|
updateCreneauGroup<K extends keyof Ressource>(payload: {
|
|
updateCreneauGroup<K extends keyof Ressource>(payload: {
|
|
|
id: string;
|
|
id: string;
|
|
@@ -394,7 +394,7 @@ export default defineComponent({
|
|
|
this.timeline.setAttribute("start", this.start.toISOString());
|
|
this.timeline.setAttribute("start", this.start.toISOString());
|
|
|
this.timeline.setAttribute("end", this.end.toISOString());
|
|
this.timeline.setAttribute("end", this.end.toISOString());
|
|
|
this.timeline.addRessources(this.creneauGroupList);
|
|
this.timeline.addRessources(this.creneauGroupList);
|
|
|
- this.commit(
|
|
|
|
|
|
|
+ this.$store.commit(
|
|
|
MutationTypes.reorderCreneauGroup,
|
|
MutationTypes.reorderCreneauGroup,
|
|
|
this.timeline.getRessources().map((o) => o.id)
|
|
this.timeline.getRessources().map((o) => o.id)
|
|
|
);
|
|
);
|