superposition : resolved the three stage rocket pushaside syndrome
This commit is contained in:
parent
aa087e6694
commit
9c5db8527d
@ -35,6 +35,7 @@ export default {
|
|||||||
'concernements_loaded',
|
'concernements_loaded',
|
||||||
'concernementsByID',
|
'concernementsByID',
|
||||||
'allSuperpositions_byid',
|
'allSuperpositions_byid',
|
||||||
|
'allMapItems_byid',
|
||||||
'opened_recit']),
|
'opened_recit']),
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -104,17 +105,20 @@ export default {
|
|||||||
if (i === 1) {
|
if (i === 1) {
|
||||||
mapitem.superposition_ids.push(superposition_id)
|
mapitem.superposition_ids.push(superposition_id)
|
||||||
}else{
|
}else{
|
||||||
this.mapitems.push({
|
let mapitem_superposition = {
|
||||||
id: `${concernement.id}___${superposition_id}`,
|
id: `${concernement.id}___${superposition_id}`,
|
||||||
concernement: concernement,
|
concernement: concernement,
|
||||||
superposition_ids: [superposition_id],
|
superposition_ids: [superposition_id],
|
||||||
clone: true
|
clone: true
|
||||||
});
|
};
|
||||||
|
this.mapitems.push(mapitem_superposition);
|
||||||
|
this.allMapItems_byid[mapitem_superposition.id] = mapitem_superposition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.mapitems.push(mapitem)
|
this.mapitems.push(mapitem)
|
||||||
|
this.allMapItems_byid[mapitem.id] = mapitem;
|
||||||
}
|
}
|
||||||
console.log('App mapitems', this.mapitems);
|
console.log('App mapitems', this.mapitems);
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,7 @@ export default {
|
|||||||
...mapState(ConcernementsStore,['map_mode',
|
...mapState(ConcernementsStore,['map_mode',
|
||||||
'concernementsByID',
|
'concernementsByID',
|
||||||
'allSuperpositions_byid',
|
'allSuperpositions_byid',
|
||||||
|
'allMapItems_byid',
|
||||||
'opened_concernement',
|
'opened_concernement',
|
||||||
'opened_entite_id']),
|
'opened_entite_id']),
|
||||||
...mapState(CommonStore,['hover_elmt',
|
...mapState(CommonStore,['hover_elmt',
|
||||||
@ -68,7 +69,7 @@ export default {
|
|||||||
'paper_symbol_definitions'])
|
'paper_symbol_definitions'])
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
console.log('ConcernementMapItem', this.mapitem);
|
console.log('ConcernementMapItem created', this.mapitem);
|
||||||
// this.id = this.superposition_id ? `${this.cid}___${this.superposition_id}` : this.cid;
|
// this.id = this.superposition_id ? `${this.cid}___${this.superposition_id}` : this.cid;
|
||||||
this.id = this.mapitem.id;
|
this.id = this.mapitem.id;
|
||||||
this.concernement = this.mapitem.concernement;
|
this.concernement = this.mapitem.concernement;
|
||||||
@ -1722,15 +1723,33 @@ export default {
|
|||||||
if (this.opened_concernement) {
|
if (this.opened_concernement) {
|
||||||
// console.log("try to push aside", this.opened_concernement.opened_mapitem_id, this.id, this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id]);
|
// console.log("try to push aside", this.opened_concernement.opened_mapitem_id, this.id, this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id]);
|
||||||
// console.log(this.id, this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id].indexOf(this.id));
|
// console.log(this.id, this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id].indexOf(this.id));
|
||||||
if (
|
if (this.opened_concernement.opened_mapitem_id !== this.id) {
|
||||||
// this.opened_concernement.id !== this.cid &&
|
// push all aside mapitems not superposed the the opened mapitem
|
||||||
this.opened_concernement.opened_mapitem_id !== this.id
|
let pushaside = true;
|
||||||
// && (!this.opened_concernement.all_superposed_concernements_id || this.opened_concernement.all_superposed_concernements_id.indexOf(this.id) < 0)
|
|
||||||
&& (!this.opened_concernement.superposed_mapitem_id_by_mapitem_id
|
// BUT NOT push aside mapitems superposed to superposed mapitems
|
||||||
|| !this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id] // when we are not in superposition mode
|
// opened_mapitem <-- superposed_mapitems <-- superposed_mapitem
|
||||||
|| this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id].indexOf(this.id) < 0) // this mapitem is not superposed to the opened mapitem
|
if (this.opened_concernement.superposed_mapitem_id_by_mapitem_id
|
||||||
) {
|
&& this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id])
|
||||||
this.pushAside()
|
{ // if opened mapitem has superposed mapitems
|
||||||
|
let superposed_ids = this.opened_concernement.superposed_mapitem_id_by_mapitem_id[this.opened_concernement.opened_mapitem_id]
|
||||||
|
if (superposed_ids.indexOf(this.id) >= 0) { //this mapitem is directly superposed to the opened mapitem
|
||||||
|
pushaside = false;
|
||||||
|
} else { // else we look for second stage of the rockette ... superposed to superposed to opened
|
||||||
|
superposed_ids.forEach(mapitem_id => { // for each superposed map_item, check if this mapitem is in their superposed
|
||||||
|
let mapitem = this.allMapItems_byid[mapitem_id]; // get the superposed (stage 1) mapitem
|
||||||
|
mapitem.superposition_ids.forEach(sup_id => { // for each superposed (stage 2) of the superposed (stage 1)
|
||||||
|
if (this.mapitem.superposition_ids.indexOf(sup_id) >= 0) {
|
||||||
|
pushaside = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pushaside) {
|
||||||
|
this.pushAside()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (!this.is_hover){
|
} else if (!this.is_hover){
|
||||||
if (this.map_mode === 'proximite'
|
if (this.map_mode === 'proximite'
|
||||||
|
@ -23,7 +23,7 @@ export const ConcernementsStore = defineStore({
|
|||||||
allBesoinsById: {},
|
allBesoinsById: {},
|
||||||
allSuperpositions: [],
|
allSuperpositions: [],
|
||||||
allSuperpositions_byid: {},
|
allSuperpositions_byid: {},
|
||||||
// allSuperpositions_bycid: {},
|
allMapItems_byid: {},
|
||||||
allProximites: [],
|
allProximites: [],
|
||||||
opened_concernement: false,
|
opened_concernement: false,
|
||||||
opened_entite_id: null,
|
opened_entite_id: null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user