third version of superpositions is almost done
This commit is contained in:
@@ -30,7 +30,7 @@ export default {
|
||||
return {
|
||||
// entite: null,
|
||||
proximite_cid_eid: null,
|
||||
superposition_id: null,
|
||||
superposition_cluster_index: null,
|
||||
superposition: null,
|
||||
opened_besoin_id: null,
|
||||
arrowup_path: mdiArrowUp
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
...mapState(ConcernementsStore,['map_mode',
|
||||
'opened_concernement',
|
||||
'concernements_loaded',
|
||||
'allSuperpositions_bycids']),
|
||||
'allSuperpositions_clustered']),
|
||||
...mapState(CommonStore,['cartouch_width']),
|
||||
//
|
||||
main_cid_eid () {
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
},
|
||||
created () {
|
||||
console.log(`Concernement view created, id: ${this.cid}, eid: ${this.eid}, opened_concernement:${this.opened_concernement}`);
|
||||
console.log('Concernement view created, allSuperpositions_bycids', this.allSuperpositions_bycids);
|
||||
console.log('Concernement view created, allSuperpositions_clustered', this.allSuperpositions_clustered);
|
||||
console.log("superposition", this.superposition);
|
||||
|
||||
if(this.map_mode === "proximite" && this.$route.query.proximite_cid && this.$route.query.proximite_eid){
|
||||
@@ -93,7 +93,7 @@ export default {
|
||||
// as we have two content to show multiply the cartouch with by 2
|
||||
// necessary for mapitem opening scale and position
|
||||
this.setCartoucheWidth(2)
|
||||
}else if(this.map_mode === "superposition" && this.$route.query.superposition_id){
|
||||
}else if(this.map_mode === "superposition" && this.$route.query.superposition_cluster_index){
|
||||
this.getSuperposition()
|
||||
// as we have two content to show multiply the cartouch with by 2
|
||||
// necessary for mapitem opening scale and position
|
||||
@@ -131,7 +131,7 @@ export default {
|
||||
$route: {
|
||||
handler (n, o) {
|
||||
console.log("concernement view $route watcher o, n", o, n);
|
||||
if (n.query && n.query.superposition_id) {
|
||||
if (n.query && n.query.superposition_cluster_index) {
|
||||
this.getSuperposition()
|
||||
}
|
||||
if (n.query && n.query.proximite_cid && n.query.proximite_eid) {
|
||||
@@ -157,17 +157,28 @@ export default {
|
||||
...mapActions(CommonStore,['setCartoucheWidth']),
|
||||
getSuperposition(){
|
||||
console.log('getSuperposition');
|
||||
// get superposition_id and superposition object
|
||||
if (this.$route.query.superposition_id) {
|
||||
this.superposition_id = this.$route.query.superposition_id;
|
||||
console.log('this.superposition_id', this.superposition_id);
|
||||
if(this.superposition_id){
|
||||
let ids = this.superposition_id.match(/(\d+)_(\d+)__(\d+)_(\d+)/i)
|
||||
let couple_key = `${ids[1]}-${ids[3]}`
|
||||
// console.log('superposition_id', this.superposition_id, couple_key, ids);
|
||||
if (this.allSuperpositions_bycids[couple_key][this.superposition_id]) {
|
||||
this.superposition = this.allSuperpositions_bycids[couple_key][this.superposition_id]
|
||||
console.log("this.superposition", this.superposition);
|
||||
// get superposition_cluster_id and superposition object
|
||||
if (this.$route.query.superposition_cluster_index) {
|
||||
this.superposition_cluster_index = this.$route.query.superposition_cluster_index;
|
||||
console.log('this.superposition_cluster_index', this.superposition_cluster_index);
|
||||
if(this.superposition_cluster_index){
|
||||
// let ids = this.superposition_id.match(/(\d+)_(\d+)__(\d+)_(\d+)/i)
|
||||
// let couple_key = `${ids[1]}-${ids[3]}`
|
||||
// // console.log('superposition_id', this.superposition_id, couple_key, ids);
|
||||
// if (this.allSuperpositions_bycids[couple_key][this.superposition_id]) {
|
||||
// this.superposition = this.allSuperpositions_bycids[couple_key][this.superposition_id]
|
||||
// console.log("this.superposition", this.superposition);
|
||||
// }
|
||||
let cluster = this.allSuperpositions_clustered[this.superposition_cluster_index];
|
||||
this.superposition = []
|
||||
for(let cid_eid of cluster){
|
||||
if (cid_eid.cid === this.cid) {
|
||||
this.superposition.push(cid_eid)
|
||||
}
|
||||
if (cid_eid.cid === parseInt(this.$route.query.superposed_cid)){
|
||||
this.superposition.push(cid_eid)
|
||||
// console.log('this.superposition', this.superposition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user