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

@@ -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>