mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 17:44:58 +00:00
form as carrousel finalized
This commit is contained in:
@@ -1,118 +1,41 @@
|
||||
<template>
|
||||
<h2 class="mt-4">{{ $t('household_members_editor.concerned.title') }}</h2>
|
||||
|
||||
<h3 v-if="needsPositionning">
|
||||
{{ $t('household_members_editor.concerned.persons_to_positionnate') }}
|
||||
</h3>
|
||||
<h3 v-else>
|
||||
{{ $t('household_members_editor.concerned.persons_leaving') }}
|
||||
</h3>
|
||||
|
||||
<div v-if="noPerson">
|
||||
<div class="alert alert-info">
|
||||
{{ $t('household_members_editor.add_at_least_onePerson') }}
|
||||
{{ $t('household_members_editor.concerned.add_at_least_onePerson') }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="allPersonsPositionnated">
|
||||
<span class="chill-no-data-statement">{{ $t('household_members_editor.all_positionnated') }}</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="flex-table list-household-members">
|
||||
<div v-for="conc in concUnpositionned"
|
||||
class="item-bloc"
|
||||
v-bind:key="conc.person.id"
|
||||
>
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div>
|
||||
<person-render-box render="badge" :options="{}" :person="conc.person"></person-render-box>
|
||||
</div>
|
||||
<div v-if="conc.person.birthdate !== null">
|
||||
{{ $t('person.born', {'gender': conc.person.gender} ) }}
|
||||
{{ $d(conc.person.birthdate.datetime, 'short') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="item-col">
|
||||
<ul class="list-content fa-ul">
|
||||
<li>
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<span class="chill-no-data-statement">Sans adresse</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="needsPositionning" class="item-row move_to">
|
||||
<div class="item-col">
|
||||
|
||||
<p class="move_hint">{{ $t('household_members_editor.concerned.move_to') }}:</p>
|
||||
|
||||
<template
|
||||
v-for="position in positions"
|
||||
>
|
||||
|
||||
<button
|
||||
class="btn btn-outline-primary"
|
||||
@click="moveToPosition(conc.person.id, position.id)"
|
||||
>
|
||||
{{ position.label.fr }}
|
||||
</button>
|
||||
|
||||
</template>
|
||||
|
||||
<button v-if="conc.allowRemove" @click="removeConcerned(conc)" class="btn btn-primary">
|
||||
{{ $t('household_members_editor.remove_concerned') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
{{ $t('household_members_editor.concerned.persons_will_be_moved') }} :
|
||||
<span v-for="c in concerned">
|
||||
<person-render-box render="badge" :options="{addLink: false}" :person="c.person"></person-render-box>
|
||||
<button class="btn" @click="removePerson(c.person)" v-if="c.allowRemove" style="padding-left:0;">
|
||||
<span class="fa-stack fa-lg" :title="$t('household_members_editor.concerned.remove_concerned')">
|
||||
<i class="fa fa-circle fa-stack-1x text-danger"></i>
|
||||
<i class="fa fa-times fa-stack-1x"></i>
|
||||
</span>
|
||||
</button>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<add-persons
|
||||
buttonTitle="household_members_editor.concerned.add_persons"
|
||||
modalTitle="household_members_editor.concerned.search"
|
||||
v-bind:key="addPersons.key"
|
||||
v-bind:options="addPersons.options"
|
||||
@addNewPersons="addNewPersons"
|
||||
ref="addPersons"> <!-- to cast child method -->
|
||||
</add-persons>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="needsPositionning" class="positions">
|
||||
<div
|
||||
v-for="position in positions"
|
||||
>
|
||||
<h3>{{ position.label.fr }}</h3>
|
||||
|
||||
<div v-if="concByPosition(position.id).length > 0" class="flex-table list-household-members">
|
||||
<member-details
|
||||
v-for="conc in concByPosition(position.id)"
|
||||
v-bind:key="conc.person.id"
|
||||
v-bind:conc="conc"
|
||||
>
|
||||
</member-details>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<p class="chill-no-data-statement">{{ $t('household_members_editor.concerned.no_person_in_position') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<add-persons
|
||||
buttonTitle="household_members_editor.concerned.add_persons"
|
||||
modalTitle="household_members_editor.concerned.search"
|
||||
v-bind:key="addPersons.key"
|
||||
v-bind:options="addPersons.options"
|
||||
@addNewPersons="addNewPersons"
|
||||
ref="addPersons"> <!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
div.person {
|
||||
cursor: move;
|
||||
|
||||
* {
|
||||
cursor: move
|
||||
}
|
||||
}
|
||||
|
||||
.move_to {
|
||||
.move_hint {
|
||||
@@ -124,33 +47,26 @@ div.person {
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
|
||||
import MemberDetails from './MemberDetails.vue';
|
||||
import { ISOToDatetime } from 'ChillMainAssets/chill/js/date.js';
|
||||
|
||||
export default {
|
||||
name: 'Concerned',
|
||||
components: {
|
||||
AddPersons,
|
||||
MemberDetails,
|
||||
PersonRenderBox,
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
'concerned'
|
||||
]),
|
||||
...mapGetters([
|
||||
'concUnpositionned',
|
||||
'positions',
|
||||
'concByPosition',
|
||||
'needsPositionning'
|
||||
'persons',
|
||||
]),
|
||||
noPerson () {
|
||||
return this.$store.getters.persons.length === 0;
|
||||
},
|
||||
allPersonsPositionnated () {
|
||||
return this.$store.getters.persons.length > 0
|
||||
&& this.$store.getters.concUnpositionned.length === 0;
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -172,11 +88,9 @@ export default {
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
moveToPosition(person_id, position_id) {
|
||||
this.$store.dispatch('markPosition', { person_id, position_id });
|
||||
},
|
||||
removeConcerned(conc) {
|
||||
this.$store.dispatch('removeConcerned', conc);
|
||||
removePerson(person) {
|
||||
console.log('remove person in concerned', person);
|
||||
this.$store.dispatch('removePerson', person);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@@ -1,28 +1,19 @@
|
||||
<template>
|
||||
|
||||
<div v-if="hasWarnings" class="alert alert-warning">
|
||||
<div v-if="hasWarning" class="alert alert-warning">
|
||||
{{ $t('household_members_editor.confirmation.there_are_warnings') }}
|
||||
</div>
|
||||
|
||||
<p v-if="hasWarnings">
|
||||
<p v-if="hasWarning">
|
||||
{{ $t('household_members_editor.confirmation.check_those_items') }}
|
||||
</p>
|
||||
|
||||
|
||||
<ul>
|
||||
<li v-for="(msg, index) in warnings">
|
||||
<li v-for="(msg, index) in warnings" class="warning">
|
||||
{{ $t(msg.m, msg.a) }}
|
||||
</li>
|
||||
<li v-for="msg in errors">
|
||||
<li v-for="msg in errors" class="error">
|
||||
{{ msg }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li>
|
||||
<button class="btn btn-save" :disabled="hasWarnings" @click="confirm">
|
||||
{{ $t('household_members_editor.confirmation.save') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
@@ -36,17 +27,11 @@ export default {
|
||||
name: 'Confirmation',
|
||||
computed: {
|
||||
...mapState({
|
||||
hasWarnings: (state) => state.warnings.length > 0 || state.errors.length > 0,
|
||||
warnings: (state) => state.warnings,
|
||||
errors: (state) => state.errors,
|
||||
hasNoWarnings: (state) => state.warnings.length === 0 && state.errors.length === 0,
|
||||
hasWarnings: (state) => state.warnings.length > 0 || state.errors.length > 0,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
confirm() {
|
||||
this.$store.dispatch('confirm');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<div class="flex-table" v-if="hasHousehold">
|
||||
<div class="item-bloc">
|
||||
<household-render-box :household="fakeHouseholdWithConcerned"></household-render-box>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import HouseholdRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/HouseholdRenderBox.vue';
|
||||
|
||||
export default {
|
||||
name: "CurrentHousehold",
|
||||
components: {
|
||||
HouseholdRenderBox,
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
]),
|
||||
...mapGetters([
|
||||
'hasHousehold',
|
||||
'fakeHouseholdWithConcerned',
|
||||
])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<h2>{{ $t('household_members_editor.dates_title') }}</h2>
|
||||
|
||||
<current-household></current-household>
|
||||
|
||||
<h2>{{ $t('household_members_editor.dates.dates_title') }}</h2>
|
||||
|
||||
<p>
|
||||
<label for="start_date">
|
||||
@@ -11,8 +14,13 @@
|
||||
|
||||
<script>
|
||||
|
||||
import CurrentHousehold from "./CurrentHousehold";
|
||||
|
||||
export default {
|
||||
name: 'Dates',
|
||||
components: {
|
||||
CurrentHousehold
|
||||
},
|
||||
computed: {
|
||||
startDate: {
|
||||
get() {
|
||||
@@ -23,10 +31,10 @@ export default {
|
||||
].join('-');
|
||||
},
|
||||
set(value) {
|
||||
let
|
||||
let
|
||||
[year, month, day] = value.split('-'),
|
||||
dValue = new Date(year, month-1, day);
|
||||
|
||||
|
||||
this.$store.dispatch('setStartDate', dValue);
|
||||
}
|
||||
}
|
||||
|
@@ -2,116 +2,56 @@
|
||||
|
||||
<h2 class="mt-4">{{ $t('household_members_editor.household_part') }}</h2>
|
||||
|
||||
<div>
|
||||
<div class="alert alert-info" v-if="!hasHousehold">
|
||||
{{ $t('household_members_editor.household.no_household_choose_one') }}
|
||||
</div>
|
||||
<template v-else>
|
||||
<current-household></current-household>
|
||||
</template>
|
||||
|
||||
<div class="alert alert-info">{{ $t('household_members_editor.household.no_household_choose_one') }}</div>
|
||||
|
||||
<div class="flex-table householdSuggestionList">
|
||||
<!-- mode new is allowed and no mode is checked -->
|
||||
<div v-if="isModeNewAllowed && !isHouseholdNew" class="item-bloc">
|
||||
<div>
|
||||
<section :class="{filtered: isHouseholdNewDesactivated}">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div class="h4">
|
||||
<i class="fa fa-home"></i> {{ $t('household_members_editor.household.new_household') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<ul :class="{filteredButActive: isHouseholdNewDesactivated}" class="record_actions">
|
||||
<li>
|
||||
<button @click="setModeNew" class="btn btn-sm btn-create">{{ $t('household_members_editor.household.create_household') }}</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- mode new is allowed and checked -->
|
||||
<div>
|
||||
<div v-if="isModeNewAllowed && isHouseholdNew" class="item-bloc" >
|
||||
<div>
|
||||
<household-render-box :household="household" :isAddressMultiline="true"></household-render-box>
|
||||
<ul class="record_actions" v-if="isHouseholdNew">
|
||||
<li>
|
||||
<add-address
|
||||
:context="getAddressContext"
|
||||
:key="addAddress.key"
|
||||
:options="addAddress.options"
|
||||
:addressChangedCallback="addressChanged"
|
||||
></add-address>
|
||||
</li>
|
||||
<li v-if="hasHouseholdAddress">
|
||||
<button class="btn btn-remove"
|
||||
@click="removeHouseholdAddress">
|
||||
{{ $t('household_members_editor.household.remove_address') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- if allow leave household -->
|
||||
<div v-if="isModeLeaveAllowed" class="item-bloc">
|
||||
<div>
|
||||
<section :class="{filtered: isHouseholdNewDesactivated}">
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<div class="h4">
|
||||
<span class="fa-stack fa-lg">
|
||||
<i class="fa fa-home fa-stack-1x"></i>
|
||||
<i class="fa fa-ban fa-stack-2x text-danger"></i>
|
||||
</span>
|
||||
{{ $t('household_members_editor.household.leave_without_household') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
{{ $t('household_members_editor.household.will_leave_any_household_explanation')}}
|
||||
</div>
|
||||
</section>
|
||||
<ul class="record_actions" :class="{filteredButActive: isHouseholdNewDesactivated}">
|
||||
<li>
|
||||
<button @click="setModeLeave" class="btn btn-sm">
|
||||
<i class="fa fa-sign-out"></i>
|
||||
{{ $t('household_members_editor.household.leave') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-for="item in getSuggestions">
|
||||
<div class="item-bloc">
|
||||
<household-render-box :household="item.household"></household-render-box>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-sm btn-choose" @click="selectHousehold(item.household)">
|
||||
{{ $t('household_members_editor.select_household') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="flex-table householdSuggestionList">
|
||||
<div v-for="item in getSuggestions">
|
||||
<div class="item-bloc">
|
||||
<household-render-box :household="item.household"></household-render-box>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-sm btn-choose" @click="selectHousehold(item.household)">
|
||||
{{ $t('household_members_editor.select_household') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li v-if="hasHousehold">
|
||||
<button @click="resetMode" class="btn btn-sm btn-misc">{{ $t('household_members_editor.household.reset_mode')}}</button>
|
||||
</li>
|
||||
<li v-if="!hasHousehold">
|
||||
<button @click="setModeNew" class="btn btn-sm btn-create">{{ $t('household_members_editor.household.create_household') }}</button>
|
||||
</li>
|
||||
<li v-if="isModeLeaveAllowed && !hasHousehold">
|
||||
<button @click="setModeLeave" class="btn btn-sm">
|
||||
<i class="fa fa-sign-out"></i>
|
||||
{{ $t('household_members_editor.household.leave') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapState } from 'vuex';
|
||||
import HouseholdRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/HouseholdRenderBox.vue';
|
||||
import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue';
|
||||
import AddAddress from 'ChillMainAssets/vuejs/Address/components/AddAddress.vue';
|
||||
import CurrentHousehold from './CurrentHousehold';
|
||||
|
||||
export default {
|
||||
name: 'Household',
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
HouseholdRenderBox,
|
||||
AddressRenderBox,
|
||||
AddAddress,
|
||||
},
|
||||
emits: ['readyToGo'],
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
@@ -154,6 +94,7 @@ export default {
|
||||
'getAddressContext',
|
||||
]),
|
||||
...mapState([
|
||||
'household',
|
||||
'showHouseholdSuggestion',
|
||||
'showAddressSuggestion',
|
||||
'mode',
|
||||
@@ -175,9 +116,11 @@ export default {
|
||||
methods: {
|
||||
setModeNew() {
|
||||
this.$store.dispatch('createHousehold');
|
||||
this.$emit('readyToGo');
|
||||
},
|
||||
setModeLeave() {
|
||||
this.$store.dispatch('forceLeaveWithoutHousehold');
|
||||
this.$emit('readyToGo');
|
||||
},
|
||||
resetMode() {
|
||||
this.$store.commit('resetMode');
|
||||
@@ -188,6 +131,7 @@ export default {
|
||||
},
|
||||
selectHousehold(h) {
|
||||
this.$store.dispatch('selectHousehold', h);
|
||||
this.$emit('readyToGo');
|
||||
},
|
||||
removeHouseholdAddress() {
|
||||
this.$store.commit('removeHouseholdAddress');
|
||||
|
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<current-household></current-household>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li v-if="!hasHouseholdAddress && !isHouseholdForceAddress">
|
||||
<button class="btn" @click="markNoAddress">
|
||||
{{ $t('household_members_editor.household_address.mark_no_address') }}
|
||||
</button>
|
||||
</li>
|
||||
<li v-if="!hasHouseholdAddress">
|
||||
<add-address
|
||||
:context="getAddressContext"
|
||||
:key="addAddress.key"
|
||||
:options="addAddress.options"
|
||||
:addressChangedCallback="addressChanged"
|
||||
></add-address>
|
||||
</li>
|
||||
<li v-if="hasHouseholdAddress">
|
||||
<button class="btn btn-remove"
|
||||
@click="removeHouseholdAddress">
|
||||
{{ $t('household_members_editor.household_address.remove_address') }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddAddress from 'ChillMainAssets/vuejs/Address/components/AddAddress.vue';
|
||||
import CurrentHousehold from './CurrentHousehold';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: "HouseholdAddress.vue",
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
AddAddress,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
key: 'household_new',
|
||||
options: {
|
||||
useDate: {
|
||||
validFrom: false,
|
||||
validTo: false,
|
||||
},
|
||||
onlyButton: true,
|
||||
button: {
|
||||
text: {
|
||||
create: 'household_members_editor.household_address.set_address',
|
||||
edit: 'household_members_editor.household_address.update_address',
|
||||
}
|
||||
},
|
||||
title: {
|
||||
create: 'household_members_editor.household_address.create_new_address',
|
||||
edit: 'household_members_editor.household_address.update_address_title',
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'isHouseholdNew',
|
||||
'hasHouseholdAddress',
|
||||
'getAddressContext',
|
||||
'isHouseholdForceNoAddress'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
addressChanged(payload) {
|
||||
console.log("addressChanged", payload);
|
||||
this.$store.dispatch('setHouseholdNewAddress', payload.address);
|
||||
},
|
||||
markNoAddress() {
|
||||
this.$store.commit('markHouseholdNoAddress');
|
||||
},
|
||||
removeHouseholdAddress() {
|
||||
this.$store.commit('removeHouseholdAddress');
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<current-household></current-household>
|
||||
|
||||
<h2>{{ $t('household_members_editor.positioning.persons_to_positionnate')}}</h2>
|
||||
|
||||
<div class="list-household-members">
|
||||
<div
|
||||
v-for="conc in concerned"
|
||||
class="item-bloc"
|
||||
v-bind:key="conc.person.id"
|
||||
>
|
||||
<div class="pick-position">
|
||||
<div class="person">
|
||||
<person-render-box render="badge" :options="{}" :person="conc.person"></person-render-box>
|
||||
</div>
|
||||
<div class="holder">
|
||||
<button
|
||||
class="btn"
|
||||
:disabled="!allowHolderForConcerned(conc)"
|
||||
:class="{'btn-outline-chill-green': !conc.holder, 'btn-chill-green': conc.holder }"
|
||||
@click="toggleHolder(conc)"
|
||||
>
|
||||
{{ $t('household_members_editor.positioning.holder') }}
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-for="position in positions"
|
||||
class="position"
|
||||
>
|
||||
<button
|
||||
class="btn"
|
||||
:class="{ 'btn-primary': conc.position === position, 'btn-outline-primary': conc.position !== position }"
|
||||
@click="moveToPosition(conc.person.id, position.id)"
|
||||
>
|
||||
{{ position.label.fr }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MemberDetails from './MemberDetails.vue';
|
||||
import {mapGetters, mapState} from "vuex";
|
||||
import CurrentHousehold from "./CurrentHousehold";
|
||||
import PersonRenderBox from 'ChillPersonAssets/vuejs/_components/Entity/PersonRenderBox.vue';
|
||||
|
||||
export default {
|
||||
name: "Positioning",
|
||||
components: {
|
||||
CurrentHousehold,
|
||||
PersonRenderBox,
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
'concerned'
|
||||
]),
|
||||
...mapGetters([
|
||||
'persons',
|
||||
'concUnpositionned',
|
||||
'positions',
|
||||
'concByPosition',
|
||||
]),
|
||||
allPersonsPositionnated () {
|
||||
return this.$store.getters.persons.length > 0
|
||||
&& this.$store.getters.concUnpositionned.length === 0;
|
||||
},
|
||||
allowHolderForConcerned: (app) => (conc) => {
|
||||
console.log('allow holder for concerned', conc);
|
||||
if (conc.position === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return conc.position.allowHolder;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
moveToPosition(person_id, position_id) {
|
||||
this.$store.dispatch('markPosition', { person_id, position_id });
|
||||
},
|
||||
toggleHolder(conc) {
|
||||
console.log('toggle holder', conc);
|
||||
this.$store.dispatch('toggleHolder', conc);
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.pick-position {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
.person {
|
||||
margin-right: auto;
|
||||
}
|
||||
.holder {
|
||||
margin-right: 1.2rem;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user