mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
v-for loop on add-evaluation subcomponent
This commit is contained in:
parent
436d583f65
commit
f5c5038fda
@ -85,7 +85,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- list evaluations -->
|
<!-- list evaluations -->
|
||||||
<add-evaluation v-if="hasEvaluationsForAction"></add-evaluation>
|
<add-evaluation
|
||||||
|
v-for="e in pickedEvaluations"
|
||||||
|
v-bind:key="e.id"
|
||||||
|
v-bind:evaluation="e">
|
||||||
|
</add-evaluation>
|
||||||
|
|
||||||
<!-- box to add new evaluation -->
|
<!-- box to add new evaluation -->
|
||||||
<div class="add_evaluation">
|
<div class="add_evaluation">
|
||||||
@ -309,7 +313,6 @@ export default {
|
|||||||
]),
|
]),
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'hasResultsForAction',
|
'hasResultsForAction',
|
||||||
'hasEvaluationsForAction',
|
|
||||||
'hasHandlingThirdParty',
|
'hasHandlingThirdParty',
|
||||||
'hasThirdParties',
|
'hasThirdParties',
|
||||||
]),
|
]),
|
||||||
@ -352,6 +355,9 @@ export default {
|
|||||||
let pickedIds = this.$store.state.evaluationsPicked.map(e => e.evaluation.id);
|
let pickedIds = this.$store.state.evaluationsPicked.map(e => e.evaluation.id);
|
||||||
return this.$store.state.evaluationsForAction.filter(e => !pickedIds.includes(e.id));
|
return this.$store.state.evaluationsForAction.filter(e => !pickedIds.includes(e.id));
|
||||||
},
|
},
|
||||||
|
pickedEvaluations() {
|
||||||
|
return this.$store.state.evaluationsPicked;
|
||||||
|
},
|
||||||
personsPicked: {
|
personsPicked: {
|
||||||
get() {
|
get() {
|
||||||
let s = this.$store.state.personsPicked.map(p => p.id);
|
let s = this.$store.state.personsPicked.map(p => p.id);
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-for="e in pickedEvaluations">
|
<div>
|
||||||
<div class="item-title" @click="removeEvaluation(e)">
|
<div class="item-title" @click="removeEvaluation(e)">
|
||||||
<i class="fa fa-fw fa-times"></i>
|
<i class="fa fa-fw fa-times"></i>
|
||||||
{{ e.evaluation.title.fr }}
|
{{ evaluation.evaluation.title.fr }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!editEvaluation">
|
<div v-if="!editEvaluation">
|
||||||
<dl class="item-details definition-inline">
|
<dl class="item-details definition-inline">
|
||||||
|
|
||||||
<dt v-if="e.startDate">{{ $t('startDate') }} :</dt>
|
<dt v-if="evaluation.startDate">{{ $t('startDate') }} :</dt>
|
||||||
<dd v-if="e.startDate">{{ $d(e.startDate.datetime, 'short') }}</dd>
|
<dd v-if="evaluation.startDate">{{ $d(evaluation.startDate.datetime, 'short') }}</dd>
|
||||||
|
|
||||||
<dt v-if="e.endDate">{{ $t('endDate') }} :</dt>
|
<dt v-if="evaluation.endDate">{{ $t('endDate') }} :</dt>
|
||||||
<dd v-if="e.endDate">{{ $d(e.endDate.datetime, 'short') }}</dd>
|
<dd v-if="evaluation.endDate">{{ $d(evaluation.endDate.datetime, 'short') }}</dd>
|
||||||
|
|
||||||
<dt v-if="e.maxDate">{{ $t('maxDate') }} :</dt>
|
<dt v-if="evaluation.maxDate">{{ $t('maxDate') }} :</dt>
|
||||||
<dd v-if="e.maxDate">{{ $d(e.maxDate.datetime, 'short') }}</dd>
|
<dd v-if="evaluation.maxDate">{{ $d(evaluation.maxDate.datetime, 'short') }}</dd>
|
||||||
|
|
||||||
<dt v-if="e.warningInterval">{{ $t('warningInterval') }} :</dt>
|
<dt v-if="evaluation.warningInterval">{{ $t('warningInterval') }} :</dt>
|
||||||
<dd v-if="e.warningInterval">{{ e.warningInterval }}</dd>
|
<dd v-if="evaluation.warningInterval">{{ evaluation.warningInterval }}</dd>
|
||||||
|
|
||||||
<dt v-if="e.documents && e.documents.length > 0">{{ $t('documents') }} :</dt>
|
<dt v-if="evaluation.documents && evaluation.documents.length > 0">{{ $t('documents') }} :</dt>
|
||||||
<dd v-if="e.documents && e.documents.length > 0">{{ e.documents.length }}</dd>
|
<dd v-if="evaluation.documents && evaluation.documents.length > 0">{{ evaluation.documents.length }}</dd>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
<dl class="item-details">
|
<dl class="item-details">
|
||||||
|
|
||||||
<dt v-if="e.comment">{{ $t('comment') }} :</dt>
|
<dt v-if="evaluation.comment">{{ $t('comment') }} :</dt>
|
||||||
<dd v-if="e.comment">{{ e.comment }}</dd>
|
<dd v-if="evaluation.comment">{{ evaluation.comment }}</dd>
|
||||||
|
|
||||||
</dl>
|
</dl>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="editEvaluation">
|
<div v-if="editEvaluation">
|
||||||
<form-evaluation ref="FormEvaluation" :key="e.id" :evaluation="e"></form-evaluation>
|
<form-evaluation ref="FormEvaluation" :key="evaluation.id" :evaluation="evaluation"></form-evaluation>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-sm btn-update" @click="submitForm">{{ $t('action.save') }}</button>
|
<button class="btn btn-sm btn-update" @click="submitForm">{{ $t('action.save') }}</button>
|
||||||
@ -70,7 +70,7 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
FormEvaluation
|
FormEvaluation
|
||||||
},
|
},
|
||||||
props: [],
|
props: ['evaluation'],
|
||||||
i18n,
|
i18n,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -47,9 +47,6 @@ const store = createStore({
|
|||||||
|
|
||||||
return found === undefined ? [] : found.results;
|
return found === undefined ? [] : found.results;
|
||||||
},
|
},
|
||||||
hasEvaluationsForAction(state) {
|
|
||||||
return state.evaluationsForAction.length > 0;
|
|
||||||
},
|
|
||||||
hasHandlingThirdParty(state) {
|
hasHandlingThirdParty(state) {
|
||||||
return state.handlingThirdParty !== null;
|
return state.handlingThirdParty !== null;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user