|
|
@@ -58,6 +58,19 @@
|
|
|
:modelValue="benevole.phone"
|
|
|
@input="inputListener($event, 'phone')"
|
|
|
/>
|
|
|
+ <styled-input
|
|
|
+ label="Commentaire"
|
|
|
+ id="comment"
|
|
|
+ type="textarea"
|
|
|
+ :modelValue="benevole.comment"
|
|
|
+ @input="inputListener($event, 'comment')"
|
|
|
+ />
|
|
|
+ <checkbox
|
|
|
+ label="Ne pas ajouter de créneau à ce bénévole"
|
|
|
+ :modelValue="benevole.isFixed"
|
|
|
+ help="Indique au solveur de ne pas changer les affectations de ce bénévole"
|
|
|
+ @input="checkboxListener($event, 'isFixed')"
|
|
|
+ />
|
|
|
<h3 style="padding-bottom: 0.8rem">Propriétés</h3>
|
|
|
<chips-input
|
|
|
label="Préference & compétences"
|
|
|
@@ -75,15 +88,16 @@
|
|
|
<script lang="ts">
|
|
|
import Benevole from "@/models/Benevole";
|
|
|
import Competence from "@/models/Competence";
|
|
|
-import styledInput from "./input.vue";
|
|
|
-import chipsInput from "./SelectChipInput.vue";
|
|
|
+import styledInput from "@/components/input.vue";
|
|
|
+import chipsInput from "@/components/SelectChipInput.vue";
|
|
|
+import checkbox from "@/components/checkBox.vue";
|
|
|
import { defineComponent, PropType } from "vue";
|
|
|
import { MutationTypes } from "@/store/Mutations";
|
|
|
import AutocompleteOptions from "@/models/AutocompleteOptions";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: "EditeurBenevole",
|
|
|
- components: { styledInput, chipsInput },
|
|
|
+ components: { styledInput, chipsInput, checkbox },
|
|
|
props: { benevole: { type: Object as PropType<Benevole> } },
|
|
|
data: function () {
|
|
|
return {
|
|
|
@@ -92,7 +106,7 @@ export default defineComponent({
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
- benevole: function (b: Benevole) {
|
|
|
+ benevole(b: Benevole) {
|
|
|
this.competenceIdList = b.competenceIdList.map((s) => s.toString());
|
|
|
},
|
|
|
competenceIdList(val: Array<string>) {
|
|
|
@@ -121,6 +135,10 @@ export default defineComponent({
|
|
|
inputListener(event: any, field: keyof Benevole) {
|
|
|
this.updateBenevole(field, event.target.value);
|
|
|
},
|
|
|
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
+ checkboxListener(event: any, field: keyof Benevole) {
|
|
|
+ this.updateBenevole(field, event.target.checked);
|
|
|
+ },
|
|
|
updateBenevole<K extends keyof Benevole>(k: K, value: Benevole[K]) {
|
|
|
if (this.benevole) {
|
|
|
this.$store.commit(MutationTypes.editBenevole, {
|