puissance d'agir almost ok

This commit is contained in:
2023-06-01 17:01:15 +02:00
parent a324ffc806
commit 6d91dcc86d
7 changed files with 170 additions and 27 deletions

View File

@@ -212,7 +212,7 @@ export default {
this.salientPoints.push(farest)
}
}
console.log(`this.salientPoints ${this.concernement.id}`, this.salientPoints);
// console.log(`this.salientPoints ${this.concernement.id}`, this.salientPoints);
},
initCanvasMap (){
// console.log(`ConcernementsMapItem ${this.concernement.id} initCanvasMap`);
@@ -375,6 +375,7 @@ export default {
this.body_parts.push(Matter.Bodies.circle(rx, ry, 0.8, {
item_type: 'reponse',
field: res_fields[f],
id: this.concernement.besoins[i].reponses[j].id,
bid: this.concernement.besoins[i].id,
cid: this.concernement.id,

View File

@@ -13,19 +13,25 @@ export default {
dom: null,
type: null,
concernement: null,
entite: null
entite: null,
besoin: null,
reponse: null
}
},
created () {
// console.log(`popup created type: ${this.infos.type}`);
// console.log(`popup created type: ${this.infos.type}`, this.infos);
if (this.infos.type === 'concernement') {
this.concernement = this.concernementsByID[this.infos.id];
} else if(this.infos.type === 'entite') {
this.entite = this.allEntitesById[this.infos.id];
} else if (this.infos.type === 'besoin') {
this.besoin = this.allBesoinsById[this.infos.id];
} else if (this.infos.type === 'reponse') {
for (let i = 0; i < this.allBesoinsById[this.infos.bid].reponses.length; i++) {
if (this.allBesoinsById[this.infos.bid].reponses[i].id === this.infos.id) {
this.reponse = this.allBesoinsById[this.infos.bid].reponses[i][this.infos.field];
}
}
}
},
mounted () {
@@ -36,7 +42,8 @@ export default {
computed: {
...mapState(ConcernementsStore,['concernements']),
...mapState(ConcernementsStore,['concernementsByID']),
...mapState(ConcernementsStore,['allEntitesById'])
...mapState(ConcernementsStore,['allEntitesById']),
...mapState(ConcernementsStore,['allBesoinsById'])
},
watch: {
infos: {
@@ -112,10 +119,10 @@ export default {
<h1>{{ entite.entite.title }}</h1>
</section>
<section v-if="infos.type === 'besoin'" class="besoin-map-popup">
<h1>Besoin</h1>
<div v-html="besoin.description"></div>
</section>
<section v-if="infos.type === 'reponse'" class="reponse-map-popup">
<h1>ponse</h1>
<div v-html="reponse"></div>
</section>
</div>
</div>

View File

@@ -173,7 +173,10 @@ export default {
&& this.opened) { // if a concernement is opened
hover_elmt = {
type: 'reponse',
id: body.id
field: body.field,
id: body.id,
bid: body.bid,
cid: body.cid
};
}
}