mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
remove from multiselect when adding social issues + disable accompanyingcourse issues loading
This commit is contained in:
parent
3a81124e04
commit
e06aded1ec
@ -15,12 +15,17 @@
|
|||||||
@updateSelected="updateSelected">
|
@updateSelected="updateSelected">
|
||||||
</check-social-issue>
|
</check-social-issue>
|
||||||
|
|
||||||
<div class="mt-4">
|
<div class="mt-3">
|
||||||
<VueMultiselect
|
<VueMultiselect
|
||||||
name="otherIssues"
|
name="otherIssues"
|
||||||
label="text"
|
label="text"
|
||||||
track-by="id"
|
track-by="id"
|
||||||
|
open-direction="bottom"
|
||||||
v-bind:close-on-select="true"
|
v-bind:close-on-select="true"
|
||||||
|
v-bind:preserve-search="false"
|
||||||
|
v-bind:reset-after="true"
|
||||||
|
v-bind:hide-selected="true"
|
||||||
|
v-bind:taggable="false"
|
||||||
v-bind:multiple="false"
|
v-bind:multiple="false"
|
||||||
v-bind:searchable="true"
|
v-bind:searchable="true"
|
||||||
v-bind:allow-empty="true"
|
v-bind:allow-empty="true"
|
||||||
@ -30,9 +35,12 @@
|
|||||||
v-model="value"
|
v-model="value"
|
||||||
@select="updateSocialIssuesList"
|
@select="updateSocialIssuesList"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<template v-slot:selection="{ values, search, isOpen }"><!-- {{ values.length }} {{ isOpen }} -->
|
||||||
|
<span v-if="values.length > 0" class="multiselect__single"></span>
|
||||||
|
</template>
|
||||||
|
|
||||||
</VueMultiselect>
|
</VueMultiselect>
|
||||||
<!--
|
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -86,29 +94,30 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadSocialIssues();
|
//this.loadSocialIssues();
|
||||||
this.loadOthersSocialIssues();
|
this.loadOthersSocialIssues();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadSocialIssues() {
|
loadSocialIssues() {
|
||||||
|
console.log('when mounted load socialIssues');
|
||||||
this.socialIssues.list = this.accompanyingCourseSocialIssues;
|
this.socialIssues.list = this.accompanyingCourseSocialIssues;
|
||||||
// TODO ajouter les issues déjà liées à activity
|
// TODO ajouter les issues déjà liées à activity
|
||||||
},
|
},
|
||||||
loadOthersSocialIssues() {
|
loadOthersSocialIssues() {
|
||||||
getSocialIssues().then(response => new Promise((resolve, reject) => {
|
getSocialIssues().then(response => new Promise((resolve, reject) => {
|
||||||
|
console.log('load others issues in multiselect');
|
||||||
this.otherIssues = response.results;
|
this.otherIssues = response.results;
|
||||||
// TODO remove double checkbox results from select
|
|
||||||
resolve();
|
resolve();
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
updateSocialIssuesList(value) {
|
updateSocialIssuesList(value) {
|
||||||
console.log('updateSocialIssuesList', value);
|
console.log('updateSocialIssuesList', value);
|
||||||
// TODO ajouter la valeur cochée dans les checkbox
|
this.socialIssues.list.push(value);
|
||||||
//this.socialIssues.list.push(value); !?? l'ajoute dans vuex le store !!?
|
this.socialIssues.selected.push(value);
|
||||||
//this.socialIssues.selected.push(value);
|
this.otherIssues = this.otherIssues.filter(item => item !== value);
|
||||||
},
|
},
|
||||||
updateSelected(value) {
|
updateSelected(value) {
|
||||||
console.log('updateSelected', value);
|
console.log('updateSelected issue', value);
|
||||||
this.socialIssues.selected = value;
|
this.socialIssues.selected = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,5 +125,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
|
span.multiselect__single {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -5,7 +5,7 @@ const appMessages = {
|
|||||||
activity: {
|
activity: {
|
||||||
//
|
//
|
||||||
social_issues: "Problématiques sociales",
|
social_issues: "Problématiques sociales",
|
||||||
choose_other_social_issue: "sélectionner une nouvelle problématique sociale...",
|
choose_other_social_issue: "ajouter une nouvelle problématique sociale...",
|
||||||
accompanying_actions: "Actions d'accompagnement",
|
accompanying_actions: "Actions d'accompagnement",
|
||||||
//
|
//
|
||||||
add_persons: "Ajouter des personnes concernées",
|
add_persons: "Ajouter des personnes concernées",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user