mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
automatic rearrange code (indentation: 3)
This commit is contained in:
parent
d0fa28db2a
commit
8d98a144fd
@ -1,220 +1,223 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="workEditor" class="my-4">
|
<div id="workEditor" class="my-4">
|
||||||
|
|
||||||
<div id="title">
|
<div id="title">
|
||||||
<label class="action_title_label">{{ $t('action_title') }}</label>
|
<label class="action_title_label">{{ $t('action_title') }}</label>
|
||||||
<p class="action_title">{{ work.socialAction.text }}</p>
|
<p class="action_title">{{ work.socialAction.text }}</p>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="startDate">
|
|
||||||
<label>{{ $t('startDate') }}</label>
|
|
||||||
<input type="date" v-model="startDate" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="endDate">
|
|
||||||
<label>{{ $t('endDate') }}</label>
|
|
||||||
<input type="date" v-model="endDate" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="comment">
|
|
||||||
<label>{{ $t('comments') }}</label>
|
|
||||||
<ckeditor
|
|
||||||
:editor="editor"
|
|
||||||
v-model="note"
|
|
||||||
tag-name="textarea"
|
|
||||||
></ckeditor>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="objectives" class="objectives_list">
|
|
||||||
<div class="title" aria="hidden">
|
|
||||||
<div><h3>{{ $t('goals_title') }}</h3></div>
|
|
||||||
<div><h3>{{ $t('results_title') }}</h3></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- results which are not attached to an objective -->
|
<div id="startDate">
|
||||||
<div v-if="hasResultsForAction">
|
<label>{{ $t('startDate') }}</label>
|
||||||
<div class="results_without_objective">
|
<input v-model="startDate" type="date"/>
|
||||||
{{ $t('results_without_objective') }}
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<add-result :availableResults="resultsForAction" destination="action"></add-result>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- results which **are** attached to an objective -->
|
<div id="endDate">
|
||||||
<div v-for="g in goalsPicked">
|
<label>{{ $t('endDate') }}</label>
|
||||||
<div>
|
<input v-model="endDate" type="date"/>
|
||||||
<div @click="removeGoal(g)" class="objective-title">
|
|
||||||
<i class="fa fa-times"></i>
|
|
||||||
{{ g.goal.title.fr }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<add-result destination="goal" :goal="g.goal"></add-result>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- box to add goal -->
|
<div id="comment">
|
||||||
<div class="add_goal">
|
<label>{{ $t('comments') }}</label>
|
||||||
<div>
|
<ckeditor
|
||||||
<div v-if="showAddObjective">
|
v-model="note"
|
||||||
|
:editor="editor"
|
||||||
|
tag-name="textarea"
|
||||||
|
></ckeditor>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p>{{ $t('available_goals_text')}}</p>
|
<div id="objectives" class="objectives_list">
|
||||||
|
<div aria="hidden" class="title">
|
||||||
|
<div><h3>{{ $t('goals_title') }}</h3></div>
|
||||||
|
<div><h3>{{ $t('results_title') }}</h3></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul class="list-objectives">
|
<!-- results which are not attached to an objective -->
|
||||||
<li v-for="g in availableForCheckGoal" @click="addGoal(g)" class="badge bg-primary">
|
<div v-if="hasResultsForAction">
|
||||||
<i class="fa fa-plus"></i>
|
<div class="results_without_objective">
|
||||||
{{ g.title.fr }}
|
{{ $t('results_without_objective') }}
|
||||||
</li>
|
</div>
|
||||||
|
<div>
|
||||||
|
<add-result :availableResults="resultsForAction" destination="action"></add-result>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- results which **are** attached to an objective -->
|
||||||
|
<div v-for="g in goalsPicked">
|
||||||
|
<div>
|
||||||
|
<div class="objective-title" @click="removeGoal(g)">
|
||||||
|
<i class="fa fa-times"></i>
|
||||||
|
{{ g.goal.title.fr }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<add-result :goal="g.goal" destination="goal"></add-result>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- box to add goal -->
|
||||||
|
<div class="add_goal">
|
||||||
|
<div>
|
||||||
|
<div v-if="showAddObjective">
|
||||||
|
|
||||||
|
<p>{{ $t('available_goals_text') }}</p>
|
||||||
|
|
||||||
|
<ul class="list-objectives">
|
||||||
|
<li v-for="g in availableForCheckGoal" class="badge bg-primary" @click="addGoal(g)">
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
{{ g.title.fr }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<button :title="$t('add_an_objective')" class="btn btn-create"
|
||||||
|
@click="toggleAddObjective"></button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div><!-- empty for results --></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="evaluations">
|
||||||
|
<div aria="hidden" class="title">
|
||||||
|
<div><h3>{{ $t('Evaluations') }}</h3></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- list evaluations -->
|
||||||
|
<div v-if="hasEvaluationsForAction">
|
||||||
|
<add-evaluation
|
||||||
|
:availableEvaluations="evaluationsForAction">
|
||||||
|
</add-evaluation>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- box to add new evaluation -->
|
||||||
|
<div class="add_evaluation">
|
||||||
|
<div v-if="showAddEvaluation">
|
||||||
|
<new-evaluation>
|
||||||
|
</new-evaluation>
|
||||||
|
</div>
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
:title="$t('add_an_evaluation')"
|
||||||
|
class="btn btn-create"
|
||||||
|
@click="toggleAddEvaluation">
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<ul class="record_actions">
|
</div>
|
||||||
<li>
|
|
||||||
<button @click="toggleAddObjective" class="btn btn-create" :title="$t('add_an_objective')"></button>
|
<div id="persons">
|
||||||
|
<h3>{{ $t('persons_involved') }}</h3>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li v-for="p in personsReachables" :key="p.id">
|
||||||
|
<input v-model="personsPicked" :value="p.id" type="checkbox">
|
||||||
|
<person :person="p"></person>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
<div><!-- empty for results --></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="evaluations">
|
|
||||||
<div class="title" aria="hidden">
|
|
||||||
<div><h3>{{ $t('Evaluations') }}</h3></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- list evaluations -->
|
<div id="handlingThirdParty">
|
||||||
<div v-if="hasEvaluationsForAction">
|
<h3>{{ $t('handling_thirdparty') }}</h3>
|
||||||
<add-evaluation
|
|
||||||
:availableEvaluations="evaluationsForAction">
|
|
||||||
</add-evaluation>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- box to add new evaluation -->
|
<div v-if="!hasHandlingThirdParty">
|
||||||
<div class="add_evaluation">
|
<p class="chill-no-data-statement">
|
||||||
<div v-if="showAddEvaluation">
|
{{ $t('no_handling_thirdparty') }}
|
||||||
<new-evaluation>
|
</p>
|
||||||
</new-evaluation>
|
|
||||||
</div>
|
|
||||||
<ul class="record_actions">
|
|
||||||
<li>
|
|
||||||
<button
|
|
||||||
class="btn btn-create"
|
|
||||||
@click="toggleAddEvaluation"
|
|
||||||
:title="$t('add_an_evaluation')">
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="persons">
|
|
||||||
<h3>{{ $t('persons_involved') }}</h3>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li v-for="p in personsReachables" :key="p.id">
|
|
||||||
<input type="checkbox" :value="p.id" v-model="personsPicked">
|
|
||||||
<person :person="p"></person>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="handlingThirdParty">
|
|
||||||
<h3>{{ $t('handling_thirdparty') }}</h3>
|
|
||||||
|
|
||||||
<div v-if="!hasHandlingThirdParty">
|
|
||||||
<p class="chill-no-data-statement">
|
|
||||||
{{ $t('no_handling_thirdparty') }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<ul class="record_actions">
|
|
||||||
<li>
|
|
||||||
<add-persons
|
|
||||||
v-bind:buttonTitle="$t('precise_handling_thirdparty')"
|
|
||||||
v-bind:modalTitle="$t('choose_a_thirdparty')"
|
|
||||||
v-bind:key="handlingThirdPartyPicker.key"
|
|
||||||
v-bind:options="handlingThirdPartyPicker.options"
|
|
||||||
@addNewPersons="setHandlingThirdParty"
|
|
||||||
ref="handlingThirdPartyPicker"> <!-- to cast child method -->
|
|
||||||
</add-persons>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<p>{{ handlingThirdParty.text }}</p>
|
|
||||||
<show-address :address="handlingThirdParty.address"></show-address>
|
|
||||||
|
|
||||||
<ul class="record_actions">
|
|
||||||
<li>
|
|
||||||
<button class="btn btn-remove" @click="removeHandlingThirdParty" :title="$t('remove_handling_thirdparty')"></button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="thirdParties">
|
|
||||||
<h3>{{ $t('thirdparty_intervener') }}</h3>
|
|
||||||
|
|
||||||
<div v-if="!hasThirdParties">
|
|
||||||
<p class="chill-no-data-statement">{{ $t('no_thirdparty_intervener') }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else>
|
|
||||||
<ul>
|
|
||||||
<li v-for="t in thirdParties">
|
|
||||||
<p>{{ t.text }}</p>
|
|
||||||
<show-address :address="t.address"></show-address>
|
|
||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<button class="btn btn-remove" @click="removeThirdParty(t)" :title="$t('remove_thirdparty')"></button>
|
<li>
|
||||||
|
<add-persons
|
||||||
|
ref="handlingThirdPartyPicker"
|
||||||
|
v-bind:key="handlingThirdPartyPicker.key"
|
||||||
|
v-bind:buttonTitle="$t('precise_handling_thirdparty')"
|
||||||
|
v-bind:modalTitle="$t('choose_a_thirdparty')"
|
||||||
|
v-bind:options="handlingThirdPartyPicker.options"
|
||||||
|
@addNewPersons="setHandlingThirdParty"> <!-- to cast child method -->
|
||||||
|
</add-persons>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</div>
|
||||||
</ul>
|
<div v-else>
|
||||||
|
<p>{{ handlingThirdParty.text }}</p>
|
||||||
|
<show-address :address="handlingThirdParty.address"></show-address>
|
||||||
|
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<button :title="$t('remove_handling_thirdparty')" class="btn btn-remove"
|
||||||
|
@click="removeHandlingThirdParty"></button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="record_actions">
|
<div id="thirdParties">
|
||||||
<li>
|
<h3>{{ $t('thirdparty_intervener') }}</h3>
|
||||||
<add-persons
|
|
||||||
v-bind:buttonTitle="$t('add_thirdparties')"
|
|
||||||
v-bind:modalTitle="$t('choose_thirdparties')"
|
|
||||||
v-bind:key="thirdPartyPicker.key"
|
|
||||||
v-bind:options="thirdPartyPicker.options"
|
|
||||||
@addNewPersons="addThirdParties"
|
|
||||||
ref="thirdPartyPicker"> <!-- to cast child method -->
|
|
||||||
</add-persons>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="errors" v-if="errors.length > 0">
|
<div v-if="!hasThirdParties">
|
||||||
<p>{{ $t('fix_these_errors') }}</p>
|
<p class="chill-no-data-statement">{{ $t('no_thirdparty_intervener') }}</p>
|
||||||
<ul>
|
</div>
|
||||||
<li v-for="e in errors">{{ e }}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
<div v-else>
|
||||||
<ul class="record_actions sticky-form-buttons">
|
<ul>
|
||||||
|
<li v-for="t in thirdParties">
|
||||||
|
<p>{{ t.text }}</p>
|
||||||
|
<show-address :address="t.address"></show-address>
|
||||||
|
|
||||||
<li v-if="!isPosting">
|
<ul class="record_actions">
|
||||||
<button class="btn btn-save" @click="submit">
|
<button :title="$t('remove_thirdparty')" class="btn btn-remove"
|
||||||
{{ $t('action.save') }}
|
@click="removeThirdParty(t)"></button>
|
||||||
</button>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<li v-if="isPosting">
|
<ul class="record_actions">
|
||||||
<button class="btn btn-save" disabled>
|
<li>
|
||||||
{{ $t('action.save') }}
|
<add-persons
|
||||||
</button>
|
ref="thirdPartyPicker"
|
||||||
</li>
|
v-bind:key="thirdPartyPicker.key"
|
||||||
|
v-bind:buttonTitle="$t('add_thirdparties')"
|
||||||
|
v-bind:modalTitle="$t('choose_thirdparties')"
|
||||||
|
v-bind:options="thirdPartyPicker.options"
|
||||||
|
@addNewPersons="addThirdParties"> <!-- to cast child method -->
|
||||||
|
</add-persons>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
</ul>
|
<div v-if="errors.length > 0" id="errors">
|
||||||
|
<p>{{ $t('fix_these_errors') }}</p>
|
||||||
|
<ul>
|
||||||
|
<li v-for="e in errors">{{ e }}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
|
||||||
|
<li v-if="!isPosting">
|
||||||
|
<button class="btn btn-save" @click="submit">
|
||||||
|
{{ $t('action.save') }}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li v-if="isPosting">
|
||||||
|
<button class="btn btn-save" disabled>
|
||||||
|
{{ $t('action.save') }}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapGetters, } from 'vuex';
|
import {mapState, mapGetters,} from 'vuex';
|
||||||
import { dateToISO, ISOToDate, ISOToDatetime } from 'ChillMainAssets/chill/js/date.js';
|
import {dateToISO, ISOToDate, ISOToDatetime} from 'ChillMainAssets/chill/js/date.js';
|
||||||
import CKEditor from '@ckeditor/ckeditor5-vue';
|
import CKEditor from '@ckeditor/ckeditor5-vue';
|
||||||
import ClassicEditor from 'ChillMainAssets/module/ckeditor5/index.js';
|
import ClassicEditor from 'ChillMainAssets/module/ckeditor5/index.js';
|
||||||
import AddResult from './components/AddResult.vue';
|
import AddResult from './components/AddResult.vue';
|
||||||
@ -225,180 +228,180 @@ import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
|||||||
import ShowAddress from 'ChillMainAssets/vuejs/Address/components/ShowAddress.vue';
|
import ShowAddress from 'ChillMainAssets/vuejs/Address/components/ShowAddress.vue';
|
||||||
|
|
||||||
const i18n = {
|
const i18n = {
|
||||||
messages: {
|
messages: {
|
||||||
fr: {
|
fr: {
|
||||||
action_title: "Action d'accompagnement",
|
action_title: "Action d'accompagnement",
|
||||||
comments: "Commentaire",
|
comments: "Commentaire",
|
||||||
startDate: "Date de début",
|
startDate: "Date de début",
|
||||||
endDate: "Date de fin",
|
endDate: "Date de fin",
|
||||||
goals_title: "Motifs - objectifs - dispositifs",
|
goals_title: "Motifs - objectifs - dispositifs",
|
||||||
available_goals_text: "Motifs, objectifs et dispositifs disponibles pour ajout :",
|
available_goals_text: "Motifs, objectifs et dispositifs disponibles pour ajout :",
|
||||||
results_title: "Orientations - résultats",
|
results_title: "Orientations - résultats",
|
||||||
results_without_objective: "Résultats - orientations sans objectifs",
|
results_without_objective: "Résultats - orientations sans objectifs",
|
||||||
add_objectif: "Ajouter un motif - objectif - dispositif",
|
add_objectif: "Ajouter un motif - objectif - dispositif",
|
||||||
add_an_objective: "Ajouter un objectif",
|
add_an_objective: "Ajouter un objectif",
|
||||||
Evaluations: "Évaluations",
|
Evaluations: "Évaluations",
|
||||||
add_an_evaluation: "Ajouter une évaluation",
|
add_an_evaluation: "Ajouter une évaluation",
|
||||||
persons_involved: "Usagers concernés",
|
persons_involved: "Usagers concernés",
|
||||||
handling_thirdparty: "Tiers traitant",
|
handling_thirdparty: "Tiers traitant",
|
||||||
no_handling_thirdparty: "Aucun tiers traitant",
|
no_handling_thirdparty: "Aucun tiers traitant",
|
||||||
precise_handling_thirdparty: "Indiquer un tiers traitant",
|
precise_handling_thirdparty: "Indiquer un tiers traitant",
|
||||||
choose_a_thirdparty: "Choisir un tiers",
|
choose_a_thirdparty: "Choisir un tiers",
|
||||||
remove_thirdparty: "Enlever le tiers",
|
remove_thirdparty: "Enlever le tiers",
|
||||||
remove_handling_thirdparty: "Enlever le tiers traitant",
|
remove_handling_thirdparty: "Enlever le tiers traitant",
|
||||||
thirdparty_intervener: "Tiers intervenants",
|
thirdparty_intervener: "Tiers intervenants",
|
||||||
no_thirdparty_intervener: "Aucun tiers intervenant",
|
no_thirdparty_intervener: "Aucun tiers intervenant",
|
||||||
add_thirdparties: "Ajouter des tiers",
|
add_thirdparties: "Ajouter des tiers",
|
||||||
choose_thirdparties: "Choisir des tiers",
|
choose_thirdparties: "Choisir des tiers",
|
||||||
fix_these_errors: "Veuillez corriger les erreurs suivantes :",
|
fix_these_errors: "Veuillez corriger les erreurs suivantes :",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
components: {
|
components: {
|
||||||
ckeditor: CKEditor.component,
|
ckeditor: CKEditor.component,
|
||||||
AddResult,
|
AddResult,
|
||||||
AddEvaluation,
|
AddEvaluation,
|
||||||
NewEvaluation,
|
NewEvaluation,
|
||||||
AddPersons,
|
AddPersons,
|
||||||
Person,
|
Person,
|
||||||
ShowAddress,
|
ShowAddress,
|
||||||
},
|
},
|
||||||
i18n,
|
i18n,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
editor: ClassicEditor,
|
editor: ClassicEditor,
|
||||||
showAddObjective: false,
|
showAddObjective: false,
|
||||||
showAddEvaluation: false,
|
showAddEvaluation: false,
|
||||||
handlingThirdPartyPicker: {
|
handlingThirdPartyPicker: {
|
||||||
key: 'handling-third-party',
|
key: 'handling-third-party',
|
||||||
options: {
|
options: {
|
||||||
type: [ 'thirdparty' ],
|
type: ['thirdparty'],
|
||||||
priority: null,
|
priority: null,
|
||||||
uniq: true,
|
uniq: true,
|
||||||
button: {
|
button: {
|
||||||
display: false
|
display: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
thirdPartyPicker: {
|
||||||
|
key: 'third-party',
|
||||||
|
options: {
|
||||||
|
type: ['thirdparty'],
|
||||||
|
priority: null,
|
||||||
|
uniq: false,
|
||||||
|
button: {
|
||||||
|
display: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState([
|
||||||
|
'work',
|
||||||
|
'resultsForAction',
|
||||||
|
'evaluationsForAction',
|
||||||
|
'goalsPicked',
|
||||||
|
'personsReachables',
|
||||||
|
'handlingThirdParty',
|
||||||
|
'thirdParties',
|
||||||
|
'isPosting',
|
||||||
|
'errors',
|
||||||
|
]),
|
||||||
|
...mapGetters([
|
||||||
|
'hasResultsForAction',
|
||||||
|
'hasEvaluationsForAction',
|
||||||
|
'hasHandlingThirdParty',
|
||||||
|
'hasThirdParties',
|
||||||
|
]),
|
||||||
|
startDate: {
|
||||||
|
get() {
|
||||||
|
console.log('get start date', this.$store.state.startDate);
|
||||||
|
return dateToISO(this.$store.state.startDate);
|
||||||
|
},
|
||||||
|
set(v) {
|
||||||
|
this.$store.commit('setStartDate', ISOToDate(v));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
thirdPartyPicker: {
|
endDate: {
|
||||||
key: 'third-party',
|
get() {
|
||||||
options: {
|
console.log('get end date', this.$store.state.endDate);
|
||||||
type: [ 'thirdparty' ],
|
return dateToISO(this.$store.state.endDate);
|
||||||
priority: null,
|
},
|
||||||
uniq: false,
|
set(v) {
|
||||||
button: {
|
this.$store.commit('setEndDate', ISOToDate(v));
|
||||||
display: false
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState([
|
|
||||||
'work',
|
|
||||||
'resultsForAction',
|
|
||||||
'evaluationsForAction',
|
|
||||||
'goalsPicked',
|
|
||||||
'personsReachables',
|
|
||||||
'handlingThirdParty',
|
|
||||||
'thirdParties',
|
|
||||||
'isPosting',
|
|
||||||
'errors',
|
|
||||||
]),
|
|
||||||
...mapGetters([
|
|
||||||
'hasResultsForAction',
|
|
||||||
'hasEvaluationsForAction',
|
|
||||||
'hasHandlingThirdParty',
|
|
||||||
'hasThirdParties',
|
|
||||||
]),
|
|
||||||
startDate: {
|
|
||||||
get() {
|
|
||||||
console.log('get start date', this.$store.state.startDate);
|
|
||||||
return dateToISO(this.$store.state.startDate);
|
|
||||||
},
|
},
|
||||||
set(v) {
|
note: {
|
||||||
this.$store.commit('setStartDate', ISOToDate(v));
|
get() {
|
||||||
}
|
return this.$store.state.note;
|
||||||
},
|
},
|
||||||
endDate: {
|
set(v) {
|
||||||
get() {
|
this.$store.commit('setNote', v);
|
||||||
console.log('get end date', this.$store.state.endDate);
|
}
|
||||||
return dateToISO(this.$store.state.endDate);
|
|
||||||
},
|
},
|
||||||
set(v) {
|
availableForCheckGoal() {
|
||||||
this.$store.commit('setEndDate', ISOToDate(v));
|
let pickedIds = this.$store.state.goalsPicked.map(g => g.goal.id);
|
||||||
}
|
console.log('pickeds goals id', pickedIds);
|
||||||
},
|
console.log(this.$store.state.goalsForAction);
|
||||||
note: {
|
|
||||||
get() {
|
|
||||||
return this.$store.state.note;
|
|
||||||
},
|
|
||||||
set(v) {
|
|
||||||
this.$store.commit('setNote', v);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
availableForCheckGoal() {
|
|
||||||
let pickedIds = this.$store.state.goalsPicked.map(g => g.goal.id);
|
|
||||||
console.log('pickeds goals id', pickedIds);
|
|
||||||
console.log(this.$store.state.goalsForAction);
|
|
||||||
|
|
||||||
return this.$store.state.goalsForAction.filter(g => !pickedIds.includes(g.id));
|
return this.$store.state.goalsForAction.filter(g => !pickedIds.includes(g.id));
|
||||||
},
|
|
||||||
personsPicked: {
|
|
||||||
get() {
|
|
||||||
let s = this.$store.state.personsPicked.map(p => p.id);
|
|
||||||
console.log('persons picked', s);
|
|
||||||
|
|
||||||
return s;
|
|
||||||
},
|
},
|
||||||
set(v) {
|
personsPicked: {
|
||||||
console.log('persons picked', v);
|
get() {
|
||||||
this.$store.commit('setPersonsPickedIds', v);
|
let s = this.$store.state.personsPicked.map(p => p.id);
|
||||||
}
|
console.log('persons picked', s);
|
||||||
},
|
|
||||||
},
|
return s;
|
||||||
methods: {
|
},
|
||||||
toggleAddObjective() {
|
set(v) {
|
||||||
this.showAddObjective = !this.showAddObjective;
|
console.log('persons picked', v);
|
||||||
},
|
this.$store.commit('setPersonsPickedIds', v);
|
||||||
addGoal(g) {
|
}
|
||||||
console.log('add Goal', g);
|
},
|
||||||
this.$store.commit('addGoal', g);
|
},
|
||||||
},
|
methods: {
|
||||||
removeGoal(g) {
|
toggleAddObjective() {
|
||||||
console.log('remove goal', g);
|
this.showAddObjective = !this.showAddObjective;
|
||||||
this.$store.commit('removeGoal', g);
|
},
|
||||||
},
|
addGoal(g) {
|
||||||
toggleAddEvaluation() {
|
console.log('add Goal', g);
|
||||||
this.showAddEvaluation = !this.showAddEvaluation;
|
this.$store.commit('addGoal', g);
|
||||||
},
|
},
|
||||||
setHandlingThirdParty({ selected, modal }) {
|
removeGoal(g) {
|
||||||
console.log('setHandlingThirdParty', selected);
|
console.log('remove goal', g);
|
||||||
this.$store.commit('setHandlingThirdParty', selected.shift().result);
|
this.$store.commit('removeGoal', g);
|
||||||
this.$refs.handlingThirdPartyPicker.resetSearch();
|
},
|
||||||
modal.showModal = false;
|
toggleAddEvaluation() {
|
||||||
},
|
this.showAddEvaluation = !this.showAddEvaluation;
|
||||||
removeHandlingThirdParty() {
|
},
|
||||||
console.log('removeHandlingThirdParty');
|
setHandlingThirdParty({selected, modal}) {
|
||||||
this.$store.commit('setHandlingThirdParty', null);
|
console.log('setHandlingThirdParty', selected);
|
||||||
},
|
this.$store.commit('setHandlingThirdParty', selected.shift().result);
|
||||||
addThirdParties({ selected, modal}) {
|
this.$refs.handlingThirdPartyPicker.resetSearch();
|
||||||
console.log('addThirdParties', selected);
|
modal.showModal = false;
|
||||||
this.$store.commit('addThirdParties', selected.map(r => r.result));
|
},
|
||||||
this.$refs.thirdPartyPicker.resetSearch();
|
removeHandlingThirdParty() {
|
||||||
modal.showModal = false;
|
console.log('removeHandlingThirdParty');
|
||||||
},
|
this.$store.commit('setHandlingThirdParty', null);
|
||||||
removeThirdParty(t) {
|
},
|
||||||
console.log('remove third party', t);
|
addThirdParties({selected, modal}) {
|
||||||
this.$store.commit('removeThirdParty', t);
|
console.log('addThirdParties', selected);
|
||||||
},
|
this.$store.commit('addThirdParties', selected.map(r => r.result));
|
||||||
submit() {
|
this.$refs.thirdPartyPicker.resetSearch();
|
||||||
this.$store.dispatch('submit');
|
modal.showModal = false;
|
||||||
},
|
},
|
||||||
}
|
removeThirdParty(t) {
|
||||||
|
console.log('remove third party', t);
|
||||||
|
this.$store.commit('removeThirdParty', t);
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$store.dispatch('submit');
|
||||||
|
},
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -434,21 +437,26 @@ export default {
|
|||||||
.action_title_label {
|
.action_title_label {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action_title {
|
.action_title {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#startDate {
|
#startDate {
|
||||||
grid-area: startDate;
|
grid-area: startDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endDate {
|
#endDate {
|
||||||
grid-area: endDate;
|
grid-area: endDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
#comment {
|
#comment {
|
||||||
grid-area: comment;
|
grid-area: comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
#objectives {
|
#objectives {
|
||||||
grid-area: objectives;
|
grid-area: objectives;
|
||||||
|
|
||||||
@ -528,6 +536,7 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#objectives, #evaluations {
|
#objectives, #evaluations {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
@ -540,22 +549,28 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#evaluations {
|
#evaluations {
|
||||||
grid-area: evaluations;
|
grid-area: evaluations;
|
||||||
|
|
||||||
& > div {
|
& > div {
|
||||||
@include border-collapse;
|
@include border-collapse;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#persons {
|
#persons {
|
||||||
grid-area: persons;
|
grid-area: persons;
|
||||||
}
|
}
|
||||||
|
|
||||||
#handlingThirdParty {
|
#handlingThirdParty {
|
||||||
grid-area: handling;
|
grid-area: handling;
|
||||||
}
|
}
|
||||||
|
|
||||||
#thirdParties {
|
#thirdParties {
|
||||||
grid-area: tparties;
|
grid-area: tparties;
|
||||||
}
|
}
|
||||||
|
|
||||||
#errors {
|
#errors {
|
||||||
grid-area: errors;
|
grid-area: errors;
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
affiche les évaluations
|
affiche les évaluations
|
||||||
<div class="addEvaluation" v-if="hasEvaluation">
|
<div v-if="hasEvaluation" class="addEvaluation">
|
||||||
|
|
||||||
<p class="chill-no-data-statement" v-if="pickedEvaluations.length === 0">
|
<p v-if="pickedEvaluations.length === 0" class="chill-no-data-statement">
|
||||||
{{ $t('no_evaluation_associated') }}
|
{{ $t('no_evaluation_associated') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<ul class="list-evaluations">
|
<ul class="list-evaluations">
|
||||||
<li v-for="e in pickedEvaluations" @click="removeEvaluation(e)" class="badge bg-primary">
|
<li v-for="e in pickedEvaluations" class="badge bg-primary" @click="removeEvaluation(e)">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
{{ e.id }}
|
{{ e.id }}
|
||||||
</li>
|
</li>
|
||||||
<template v-if="isExpanded">
|
<template v-if="isExpanded">
|
||||||
<li v-for="e in availableForCheckEvaluations" @click="addEvaluation(e)" class="badge bg-primary">
|
<li v-for="e in availableForCheckEvaluations" class="badge bg-primary" @click="addEvaluation(e)">
|
||||||
<i class="fa fa-plus"></i>
|
<i class="fa fa-plus"></i>
|
||||||
{{ e.id }}
|
{{ e.id }}
|
||||||
</li>
|
</li>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="noEvaluation" v-if="!hasEvaluation">
|
<div v-if="!hasEvaluation" class="noEvaluation">
|
||||||
<div class="chill-no-data-statement">
|
<div class="chill-no-data-statement">
|
||||||
{{ $t('evaluation_has_no_evaluation') }}
|
{{ $t('evaluation_has_no_evaluation') }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,128 +1,128 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="addResult" v-if="hasResult">
|
<div v-if="hasResult" class="addResult">
|
||||||
<p class="chill-no-data-statement" v-if="pickedResults.length ===0">
|
<p v-if="pickedResults.length ===0" class="chill-no-data-statement">
|
||||||
Aucun résultat associé
|
Aucun résultat associé
|
||||||
</p>
|
</p>
|
||||||
<ul class="list-results">
|
<ul class="list-results">
|
||||||
<li v-for="r in pickedResults" @click="removeResult(r)" class="badge bg-primary">
|
<li v-for="r in pickedResults" class="badge bg-primary" @click="removeResult(r)">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
{{ r.title.fr }}
|
{{ r.title.fr }}
|
||||||
</li>
|
</li>
|
||||||
<template v-if="isExpanded">
|
<template v-if="isExpanded">
|
||||||
<li v-for="r in availableForCheckResults" @click="addResult(r)" class="badge bg-primary">
|
<li v-for="r in availableForCheckResults" class="badge bg-primary" @click="addResult(r)">
|
||||||
<i class="fa fa-plus"></i>
|
<i class="fa fa-plus"></i>
|
||||||
{{ r.title.fr }}
|
{{ r.title.fr }}
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li v-if="isExpanded">
|
<li v-if="isExpanded">
|
||||||
<button @click="toggleSelect" class="btn btn-hide" >
|
<button class="btn btn-hide" @click="toggleSelect">
|
||||||
<i class="fa fa-eye-slash"></i>
|
<i class="fa fa-eye-slash"></i>
|
||||||
Masquer résultats et orientations disponibles
|
Masquer résultats et orientations disponibles
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li v-else>
|
<li v-else>
|
||||||
<button @click="toggleSelect" class="btn btn-show">
|
<button class="btn btn-show" @click="toggleSelect">
|
||||||
Afficher résultats et orientations disponibles
|
Afficher résultats et orientations disponibles
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="noResult" v-if="!hasResult">
|
<div v-if="!hasResult" class="noResult">
|
||||||
<div class="chill-no-data-statement">
|
<div class="chill-no-data-statement">
|
||||||
{{ $t('goal_has_no_result') }}
|
{{ $t('goal_has_no_result') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const i18n = {
|
const i18n = {
|
||||||
messages: {
|
messages: {
|
||||||
fr: {
|
fr: {
|
||||||
add_a_result: "Résultat - orientation disponibles",
|
add_a_result: "Résultat - orientation disponibles",
|
||||||
goal_has_no_result: "Aucun résultat - orientation disponible",
|
goal_has_no_result: "Aucun résultat - orientation disponible",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AddResult",
|
name: "AddResult",
|
||||||
props: [ 'destination', 'goal', 'availableResults' ],
|
props: ['destination', 'goal', 'availableResults'],
|
||||||
i18n,
|
i18n,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isExpanded: false,
|
isExpanded: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
hasResult() {
|
hasResult() {
|
||||||
if (this.destination === 'action') {
|
if (this.destination === 'action') {
|
||||||
return this.$store.state.resultsForAction.length > 0;
|
return this.$store.state.resultsForAction.length > 0;
|
||||||
} else if (this.destination === 'goal') {
|
} else if (this.destination === 'goal') {
|
||||||
return this.$store.getters.resultsForGoal(this.goal).length > 0;
|
return this.$store.getters.resultsForGoal(this.goal).length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw Error(`this.destination is not implemented: ${this.destination}`);
|
throw Error(`this.destination is not implemented: ${this.destination}`);
|
||||||
},
|
},
|
||||||
pickedResults() {
|
pickedResults() {
|
||||||
console.log('get checked');
|
console.log('get checked');
|
||||||
console.log('this.destination', this.destination);
|
console.log('this.destination', this.destination);
|
||||||
console.log('this.goal', this.goal);
|
console.log('this.goal', this.goal);
|
||||||
if (this.destination === 'action') {
|
if (this.destination === 'action') {
|
||||||
return this.$store.state.resultsPicked;
|
return this.$store.state.resultsPicked;
|
||||||
} else if (this.destination === 'goal') {
|
} else if (this.destination === 'goal') {
|
||||||
return this.$store.getters.resultsPickedForGoal(this.goal);
|
return this.$store.getters.resultsPickedForGoal(this.goal);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw Error(`this.destination is not implemented: ${this.destination}`);
|
throw Error(`this.destination is not implemented: ${this.destination}`);
|
||||||
},
|
},
|
||||||
availableForCheckResults() {
|
availableForCheckResults() {
|
||||||
console.log('availableForCheckResults');
|
console.log('availableForCheckResults');
|
||||||
console.log('this.destination', this.destination);
|
console.log('this.destination', this.destination);
|
||||||
console.log('this.goal', this.goal);
|
console.log('this.goal', this.goal);
|
||||||
if (this.destination === 'action') {
|
if (this.destination === 'action') {
|
||||||
let pickedIds = this.$store.state.resultsPicked.map(r => r.id);
|
let pickedIds = this.$store.state.resultsPicked.map(r => r.id);
|
||||||
console.log('picked ids', pickedIds);
|
console.log('picked ids', pickedIds);
|
||||||
|
|
||||||
return this.$store.state.resultsForAction.filter(r => !pickedIds.includes(r.id));
|
return this.$store.state.resultsForAction.filter(r => !pickedIds.includes(r.id));
|
||||||
} else if (this.destination === 'goal') {
|
} else if (this.destination === 'goal') {
|
||||||
console.log('results picked for goal', this.$store.getters.resultsPickedForGoal(this.goal));
|
console.log('results picked for goal', this.$store.getters.resultsPickedForGoal(this.goal));
|
||||||
let pickedIds = this.$store.getters.resultsPickedForGoal(this.goal).map(r => r.id);
|
let pickedIds = this.$store.getters.resultsPickedForGoal(this.goal).map(r => r.id);
|
||||||
|
|
||||||
return this.$store.getters.resultsForGoal(this.goal).filter(r => !pickedIds.includes(r.id));
|
return this.$store.getters.resultsForGoal(this.goal).filter(r => !pickedIds.includes(r.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
throw Error(`this.destination is not implemented: ${this.destination}`);
|
throw Error(`this.destination is not implemented: ${this.destination}`);
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
toggleSelect() {
|
|
||||||
this.isExpanded = !this.isExpanded;
|
|
||||||
},
|
|
||||||
addResult(r) {
|
|
||||||
console.log('addResult', r);
|
|
||||||
if (this.destination === 'action') {
|
|
||||||
this.$store.commit('addResultPicked', r);
|
|
||||||
return;
|
|
||||||
} else if (this.destination === 'goal') {
|
|
||||||
this.$store.commit('addResultForGoalPicked', { goal: this.goal, result: r });
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
throw Error(`this.destination is not implemented: ${this.destination}`);
|
},
|
||||||
},
|
methods: {
|
||||||
removeResult(r) {
|
toggleSelect() {
|
||||||
console.log('removeresult', r);
|
this.isExpanded = !this.isExpanded;
|
||||||
if (this.destination === 'action') {
|
},
|
||||||
this.$store.commit('removeResultPicked', r);
|
addResult(r) {
|
||||||
return;
|
console.log('addResult', r);
|
||||||
} else if (this.destination === 'goal') {
|
if (this.destination === 'action') {
|
||||||
this.$store.commit('removeResultForGoalPicked', { goal: this.goal, result: r });
|
this.$store.commit('addResultPicked', r);
|
||||||
return;
|
return;
|
||||||
|
} else if (this.destination === 'goal') {
|
||||||
|
this.$store.commit('addResultForGoalPicked', {goal: this.goal, result: r});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw Error(`this.destination is not implemented: ${this.destination}`);
|
||||||
|
},
|
||||||
|
removeResult(r) {
|
||||||
|
console.log('removeresult', r);
|
||||||
|
if (this.destination === 'action') {
|
||||||
|
this.$store.commit('removeResultPicked', r);
|
||||||
|
return;
|
||||||
|
} else if (this.destination === 'goal') {
|
||||||
|
this.$store.commit('removeResultForGoalPicked', {goal: this.goal, result: r});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw Error(`this.destination is not implemented: ${this.destination}`);
|
||||||
}
|
}
|
||||||
throw Error(`this.destination is not implemented: ${this.destination}`);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h3>
|
<h3>
|
||||||
{{ $t('evaluation_title') }}
|
{{ $t('evaluation_title') }}
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<pre>
|
<pre>
|
||||||
{{ $t('evaluation_status') }}
|
{{ $t('evaluation_status') }}
|
||||||
{{ $t('evaluation_choose_a_status') }}
|
{{ $t('evaluation_choose_a_status') }}
|
||||||
{{ $t('evaluation_startdate') }}
|
{{ $t('evaluation_startdate') }}
|
||||||
@ -47,9 +47,7 @@ export default {
|
|||||||
props: [],
|
props: [],
|
||||||
i18n,
|
i18n,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {}
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {}
|
methods: {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user