superpositions on map are ok
This commit is contained in:
@@ -97,27 +97,44 @@ export const ConcernementsStore = defineStore({
|
||||
let already_recorded = false;
|
||||
// loop through all already recorded superposition to complete the array instead of create duplicates
|
||||
for(let superposition of this.allSuperpositions) {
|
||||
if (superposition.indexOf(entite_superpose.id) >= 0) {
|
||||
already_recorded = true;
|
||||
if (superposition.indexOf(entite.entite.id) < 0) {
|
||||
superposition.push(entite.entite.id)
|
||||
// if (superposition.indexOf(entite_superpose.id) >= 0) {
|
||||
// already_recorded = true;
|
||||
// if (superposition.indexOf(entite.entite.id) < 0) {
|
||||
// superposition.push(entite.entite.id)
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// if (superposition.indexOf(entite.entite.id) >= 0) {
|
||||
// already_recorded = true;
|
||||
// if (superposition.indexOf(entite_superpose.id) < 0) {
|
||||
// superposition.push(entite_superpose.id)
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
for(let superposition_item of superposition) {
|
||||
if (superposition_item.eid === entite.entite.id && !superposition_item.cid) {
|
||||
console.log(`already_recorded, eid:${entite.entite.id}, teid:${entite_superpose.id}`, entite.entite.title);
|
||||
already_recorded = true;
|
||||
superposition_item.cid = concernement.id;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (superposition.indexOf(entite.entite.id) >= 0) {
|
||||
already_recorded = true;
|
||||
if (superposition.indexOf(entite_superpose.id) < 0) {
|
||||
superposition.push(entite_superpose.id)
|
||||
}
|
||||
if (already_recorded) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if not already recorded, add it to the array
|
||||
if (!already_recorded) {
|
||||
// console.log(`NOT already_recorded, eid:${entite.entite.id}, teid:${entite_superpose.id}`, this.allSuperpositions);
|
||||
console.log(`NOT already_recorded, eid:${entite.entite.id}, teid:${entite_superpose.id}`, entite.entite.title);
|
||||
this.allSuperpositions.push([
|
||||
entite.entite.id, // entite id
|
||||
entite_superpose.id // target id
|
||||
{
|
||||
cid: concernement.id,
|
||||
eid: entite.entite.id
|
||||
},
|
||||
{
|
||||
cid: null,
|
||||
eid: entite_superpose.id
|
||||
}
|
||||
])
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user