mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
addpersons component, doesnt hear emitted event...
This commit is contained in:
parent
eebe1d669a
commit
c7caa2ba76
@ -5,9 +5,6 @@
|
|||||||
<teleport to="#visgraph-legend">
|
<teleport to="#visgraph-legend">
|
||||||
<div class="post-menu">
|
<div class="post-menu">
|
||||||
<div class="list-group mt-4">
|
<div class="list-group mt-4">
|
||||||
<button type="button" class="list-group-item list-group-item-action btn btn-create">
|
|
||||||
{{ $t('visgraph.add_person') }}
|
|
||||||
</button>
|
|
||||||
<button type="button" class="list-group-item list-group-item-action btn btn-create" @click="createRelationship">
|
<button type="button" class="list-group-item list-group-item-action btn btn-create" @click="createRelationship">
|
||||||
{{ $t('visgraph.add_link') }}
|
{{ $t('visgraph.add_link') }}
|
||||||
</button>
|
</button>
|
||||||
@ -116,7 +113,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</modal>
|
</modal>
|
||||||
</teleport>
|
</teleport>
|
||||||
|
<div style="float: right;">
|
||||||
|
<add-persons
|
||||||
|
buttonTitle="visgraph.add_person"
|
||||||
|
modalTitle="visgraph.add_person"
|
||||||
|
v-bind:key="addPersons.key"
|
||||||
|
v-bind:options="addPersons.options"
|
||||||
|
@addNewPersons="addNewPersons"
|
||||||
|
ref="addPersons">
|
||||||
|
</add-persons>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -127,12 +133,14 @@ import VueMultiselect from 'vue-multiselect'
|
|||||||
import { getRelationsList, postRelationship, patchRelationship, deleteRelationship } from "./api"
|
import { getRelationsList, postRelationship, patchRelationship, deleteRelationship } from "./api"
|
||||||
import { splitId, getAge } from "./vis-network"
|
import { splitId, getAge } from "./vis-network"
|
||||||
import { visMessages } from "./i18n";
|
import { visMessages } from "./i18n";
|
||||||
|
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "App",
|
name: "App",
|
||||||
components: {
|
components: {
|
||||||
Modal,
|
Modal,
|
||||||
VueMultiselect
|
VueMultiselect,
|
||||||
|
AddPersons
|
||||||
},
|
},
|
||||||
props: ['household_id'],
|
props: ['household_id'],
|
||||||
data() {
|
data() {
|
||||||
@ -162,8 +170,34 @@ export default {
|
|||||||
},
|
},
|
||||||
canvas: null,
|
canvas: null,
|
||||||
link: null,
|
link: null,
|
||||||
|
addPersons: {
|
||||||
|
key: 'filiation',
|
||||||
|
options: {
|
||||||
|
type: ['person'],
|
||||||
|
priority: null,
|
||||||
|
uniq: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
addNewPersons({ selected, modal }) {
|
||||||
|
console.log('@@@ CLICK button addNewPersons', selected);
|
||||||
|
// selected.forEach(function(item) {
|
||||||
|
// this.$store.dispatch('addPerson', item)
|
||||||
|
// .catch(({name, violations}) => {
|
||||||
|
// if (name === 'ValidationException' || name === 'AccessException') {
|
||||||
|
// violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||||
|
// } else {
|
||||||
|
// this.$toast.open({message: violations})
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }, this
|
||||||
|
// );
|
||||||
|
// this.$refs.addPersons.resetSearch(); // to cast child method
|
||||||
|
// modal.showModal = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['nodes', 'edges',
|
...mapGetters(['nodes', 'edges',
|
||||||
// not used 'isInWhitelist', 'isHouseholdLoading', 'isCourseLoaded', 'isRelationshipLoaded', 'isPersonLoaded', 'isExcludedNode', 'countLinksByNode', 'getParticipationsByCourse', 'getMembersByHousehold', 'getPersonsGroup',
|
// not used 'isInWhitelist', 'isHouseholdLoading', 'isCourseLoaded', 'isRelationshipLoaded', 'isPersonLoaded', 'isExcludedNode', 'countLinksByNode', 'getParticipationsByCourse', 'getMembersByHousehold', 'getPersonsGroup',
|
||||||
@ -238,6 +272,7 @@ export default {
|
|||||||
this.initGraph()
|
this.initGraph()
|
||||||
this.listenOnGraph()
|
this.listenOnGraph()
|
||||||
this.getRelationsList()
|
this.getRelationsList()
|
||||||
|
console.log(this.persons);
|
||||||
|
|
||||||
this.canvas = document.getElementById('visgraph').querySelector('canvas')
|
this.canvas = document.getElementById('visgraph').querySelector('canvas')
|
||||||
this.link = document.getElementById('exportCanvasBtn')
|
this.link = document.getElementById('exportCanvasBtn')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user