highlighting opened entite on canvas

This commit is contained in:
2023-04-19 16:36:50 +02:00
parent 45e8f31bd8
commit fb8903a9ce
3 changed files with 25 additions and 12 deletions

View File

@@ -17,15 +17,17 @@ export default {
},
computed: {
...mapState(ConcernementsStore,['opened']),
// ...mapState(ConcernementsStore,['opened_entity_id']),
...mapState(ConcernementsStore,['concernements_loaded']),
...mapState(ConcernementsStore,['ct_concernement'])
},
created () {
console.log(`Concernement view created, id: ${this.id}, eid: ${this.eid}, opened:${this.opened}`);
// when we arrived directly to the entite, load the entite
// when we arrived directly to the url, load the entite
// this.eid provided by route params
if (!this.entity && this.eid) {
this.loadEntite();
this.openEntity();
}
},
watch: {
@@ -43,9 +45,10 @@ export default {
eid: {
handler (n, o){
if(n){
this.loadEntite()
this.openEntity()
}else{
this.entite = false;
this.setOpenedEntityId(null);
}
},
deep: true
@@ -53,6 +56,11 @@ export default {
},
methods: {
...mapActions(ConcernementsStore,['openCloseConcernements']),
...mapActions(ConcernementsStore,['setOpenedEntityId']),
openEntity(){
this.setOpenedEntityId(parseInt(this.eid))
this.loadEntite()
},
loadEntite(){
const ast = gql`{
entite (id: ${this.eid}) {