entite are opening well in all modes
This commit is contained in:
@@ -5,6 +5,12 @@ import { ConcernementsStore } from '@stores/concernements'
|
||||
import { UserStore } from '@/stores/user'
|
||||
// import { CommonStore } from '@/stores/common'
|
||||
|
||||
import { print } from 'graphql/language/printer'
|
||||
import gql from 'graphql-tag'
|
||||
import GQL from '@api/graphql-axios'
|
||||
import EntiteFields from '@api/gql/entite.fragment.gql'
|
||||
|
||||
|
||||
import CartoucheLayout from '@components/layout/CartoucheLayout.vue';
|
||||
import Entite from '@components/contents/Entite.vue';
|
||||
|
||||
@@ -16,10 +22,11 @@ import { mdiChevronRight } from '@mdi/js';
|
||||
import { mdiChevronDown } from '@mdi/js';
|
||||
|
||||
export default {
|
||||
props: ['cid', 'eid', 'entite'],
|
||||
props: ['cid', 'eid'],
|
||||
data(){
|
||||
return {
|
||||
concernement: null,
|
||||
entite: null,
|
||||
history_value: 0,
|
||||
history_slider_ops: null,
|
||||
infos_opened: false,
|
||||
@@ -53,8 +60,12 @@ export default {
|
||||
|
||||
console.log(`terraindevie created, cid: ${this.cid}, eid: ${this.eid}, this.concernement:`, this.concernement);
|
||||
|
||||
// revisions
|
||||
|
||||
//entite
|
||||
if (this.eid) {
|
||||
this.loadEntite()
|
||||
}
|
||||
|
||||
// revisions
|
||||
let data=[];
|
||||
this.concernement.revisions.forEach(rev => {
|
||||
if (rev.entites.length > 3) {
|
||||
@@ -87,12 +98,37 @@ export default {
|
||||
this.setActiveRevision(this.concernement.id, n);
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
eid: {
|
||||
handler (n, o) {
|
||||
console.log(`TerrainDeVie watch eid o:${o}, n:${n}`);
|
||||
this.loadEntite()
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(ConcernementsStore, ['setActiveRevision']), // 'loadConcernementsRevisions'
|
||||
onClickInfos(){
|
||||
this.infos_opened = !this.infos_opened;
|
||||
},
|
||||
loadEntite(){
|
||||
const ast = gql`{
|
||||
entite (id: ${this.eid}) {
|
||||
...EntiteFields
|
||||
}
|
||||
}
|
||||
${EntiteFields}
|
||||
`
|
||||
console.log('ast', ast);
|
||||
GQL.post('', { query: print(ast) })
|
||||
.then(({data: { data: { entite }}}) => {
|
||||
console.log('load entite loaded', entite)
|
||||
this.entite = entite
|
||||
})
|
||||
.catch(error => {
|
||||
console.warn('Issue with load entite', error)
|
||||
})
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -130,7 +166,7 @@ export default {
|
||||
</template>
|
||||
|
||||
<!-- entite -->
|
||||
<Entite v-if="entite" :entite="entite" :eid="eid"/>
|
||||
<Entite v-if="entite" :concernement="concernement" :entite="entite" :eid="eid"/>
|
||||
</template>
|
||||
|
||||
<template v-slot:footer>
|
||||
|
||||
Reference in New Issue
Block a user