cercle po: active steo is visualy focused

This commit is contained in:
Bachir Soussi Chiadmi 2025-02-26 16:48:30 +01:00
parent 55b213af64
commit a33104e402

View File

@ -395,6 +395,13 @@ export default {
},
deep: true
},
'concernement.opened_doleance': {
handler (n, o) {
console.log(`${this.id} watch concernement.opened_doleance o, n`, o, n);
this.focusOpenedDoleanceStep();
},
deep: true
},
wait: {
handler (n, o){
// when we are reloading entites par exemple
@ -2209,8 +2216,9 @@ export default {
} else if(!this.doleance_transition) {
this.concernement.doleances.forEach((d) => {
this.paper_main_object.children.doleances.children[`doleance_${d.id}`].visible = d.id === this.concernement.opened_doleance.id;
})
})
}
}
} else {
// this.paper_main_object.children.doleance_icon.visible = false;
@ -2252,6 +2260,44 @@ export default {
}
},
focusOpenedDoleanceStep(){
console.log('focusOpenedDoleanceStep', this.concernement.opened_doleance);
if (this.concernement.has_doleance) {
if (this.map_mode === "doleancer") {
if (this.is_open) {
// focus on opened doleance step
if (this.concernement.opened_doleance.field) {
let paper_doleance = this.paper_main_object.children.doleances.children[`doleance_${this.concernement.opened_doleance.id}`];
console.log('paper_doleance', paper_doleance);
paper_doleance.children.forEach((step) =>{
// console.log('step.item_type', step.item_type);
let active = false;
if (step.field === this.concernement.opened_doleance.field) {
if(typeof this.concernement.opened_doleance.field_index != 'undefined'){
// we have an index, let find if we have the right step here
if (this.concernement.opened_doleance.field_index === step.field_index) {
active = true;
}
}else{
// we do not have a field index, so it is a single step, so it is active no matter the index
active = true
}
}
if (active) {
// step.data.prevStrokeColor is for hover_elmt wtahc in MapConcernements.vue
step.data.prevStrokeColor = step.strokeColor = "#01ffe2";
} else {
step.data.prevStrokeColor = step.strokeColor = "#fff";
}
});
}
}
}
}
},
initDoleanceTransition(from, to){
if (!this.doleance_transition) {