mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add addPersons subcomponent
This commit is contained in:
parent
b1d7e543fc
commit
65ac9a47b4
@ -1,16 +1,54 @@
|
||||
<template>
|
||||
hello
|
||||
|
||||
<teleport to="#add-persons">
|
||||
<add-persons
|
||||
buttonTitle="activities.add_persons"
|
||||
modalTitle="activities.add_persons"
|
||||
v-bind:key="addPersons.key"
|
||||
v-bind:options="addPersons.options"
|
||||
@addNewPersons="addNewPersons"
|
||||
ref="addPersons"> <!-- to cast child method -->
|
||||
</add-persons>
|
||||
</teleport>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
components: {},
|
||||
components: {
|
||||
AddPersons
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: 'activity',
|
||||
options: {
|
||||
type: ['person', 'thirdparty'],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: mapState([
|
||||
'activity'
|
||||
])
|
||||
]),
|
||||
methods: {
|
||||
addNewPersons({ selected, modal }) {
|
||||
console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function(item) {
|
||||
//this.$store.dispatch('addResource', item);
|
||||
console.log('item', item);
|
||||
}, this
|
||||
);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -1,8 +1,15 @@
|
||||
import { personMessages } from 'ChillPersonAssets/vuejs/_js/i18n'
|
||||
|
||||
const appMessages = {
|
||||
fr: {
|
||||
|
||||
activities: {
|
||||
add_persons: "Ajouter des personnes"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign(appMessages.fr, personMessages.fr);
|
||||
|
||||
export {
|
||||
appMessages
|
||||
};
|
||||
|
@ -37,6 +37,8 @@
|
||||
{{ form_row(edit_form.users) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="add-persons"></div>
|
||||
|
||||
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
|
||||
|
||||
{%- if edit_form.date is defined -%}
|
||||
|
@ -38,6 +38,8 @@
|
||||
{{ form_row(form.users) }}
|
||||
{% endif %}
|
||||
|
||||
<div id="add-persons"></div>
|
||||
|
||||
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
|
||||
|
||||
{%- if form.date is defined -%}
|
||||
|
Loading…
x
Reference in New Issue
Block a user