Преглед на файлове

bug fix: open boussole from search failed when mapitem_id different from cid

bach преди 1 месец
родител
ревизия
c90baf9a31
променени са 2 файла, в които са добавени 8 реда и са изтрити 3 реда
  1. 5 0
      src/App.vue
  2. 3 3
      src/stores/concernements.js

+ 5 - 0
src/App.vue

@@ -75,6 +75,7 @@ export default {
       // console.log('App couple_ids', couple_ids);
       // loop through all concernement
       for(let [concernement_id, concernement] of Object.entries(this.concernementsByID)){
+        concernement.mapitems_ids = [];
         // TODO check if more than 3 entities or if connected user if author
         if (concernement.entites.length > 3 || concernement.can_update) {
           // create the main mapitem object
@@ -113,15 +114,19 @@ export default {
                 };
                 this.mapitems.push(mapitem_superposition);
                 this.allMapItems_byid[mapitem_superposition.id] = mapitem_superposition;
+                concernement.mapitems_ids.push(mapitem_superposition.id)
               }
             }
           }
           this.mapitems.push(mapitem)
           this.allMapItems_byid[mapitem.id] = mapitem;
+          concernement.mapitems_ids.push(mapitem.id)
           
         }
       }
       console.log('App mapitems', this.mapitems);
+      console.log('this.allMapItems_byid', this.allMapItems_byid);
+      
     }
   },
   components: {

+ 3 - 3
src/stores/concernements.js

@@ -641,10 +641,10 @@ export const ConcernementsStore = defineStore({
         }
       })
     },
-    openCloseConcernements (cid, id) {
-      console.log(`openCloseConcernements cid: ${cid}, id: ${id}`);
+    openCloseConcernements (cid, mi_id) {
+      console.log(`openCloseConcernements cid: ${cid}, mi_id: ${mi_id}`);
       var state;
-      let mapitem_id = id ? id : cid;
+      let mapitem_id = mi_id ? mi_id : this.concernementsByID[cid].mapitems_ids[0];
       this.opened_concernement = null;
       this.opened_recit = null;
       this.concernements.forEach((c, i) => {