mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
when passed option uniq, suggestions are with radio button, not checkbox
This commit is contained in:
parent
4fb487dcef
commit
6da8f1c107
@ -104,10 +104,7 @@ export default {
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function(item) {
|
||||
this.$store.dispatch('addRequestor', item);
|
||||
}, this
|
||||
);
|
||||
this.$store.dispatch('addRequestor', selected);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-body" v-if="checkUniq === 'checkbox'">
|
||||
<div class="count">
|
||||
<span>
|
||||
<a v-if="suggestedCounter > 2" @click="selectAll">
|
||||
@ -57,6 +57,7 @@
|
||||
v-bind:key="itemKey(item)"
|
||||
v-bind:item="item"
|
||||
v-bind:search="search"
|
||||
v-bind:type="checkUniq"
|
||||
@updateSelected="updateSelected">
|
||||
</person-suggestion>
|
||||
|
||||
@ -71,7 +72,6 @@
|
||||
@click.prevent="$emit('addNewPersons', { selected, modal })">
|
||||
<i class="fa fa-plus fa-fw"></i>{{ $t('action.add')}}
|
||||
</button>
|
||||
{{ $t(checkUniq) }}
|
||||
</template>
|
||||
|
||||
</modal>
|
||||
@ -148,10 +148,10 @@ export default {
|
||||
return this.options;
|
||||
},
|
||||
checkUniq() {
|
||||
if (this.options.uniq === true && this.selectedCounter > 1) {
|
||||
return "error_only_one_person";
|
||||
if (this.options.uniq === true) {
|
||||
return 'radio';
|
||||
}
|
||||
return '';
|
||||
return 'checkbox';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -180,6 +180,7 @@ export default {
|
||||
}, this);
|
||||
},
|
||||
updateSelected(value) {
|
||||
console.log('value', value);
|
||||
this.search.selected = value;
|
||||
},
|
||||
resetSearch() {
|
||||
|
@ -2,8 +2,8 @@
|
||||
<div class="list-item" :class="{ checked: isChecked }">
|
||||
|
||||
<div class="container">
|
||||
<input type="checkbox"
|
||||
v-model="selected"
|
||||
<input v-model="selected"
|
||||
:type="type"
|
||||
:value="item" />
|
||||
</div>
|
||||
|
||||
@ -32,12 +32,14 @@ export default {
|
||||
},
|
||||
props: [
|
||||
'item',
|
||||
'search'
|
||||
'search',
|
||||
'type'
|
||||
],
|
||||
emits: ['updateSelected'],
|
||||
computed: {
|
||||
selected: {
|
||||
set(value) {
|
||||
console.log('value', value);
|
||||
this.$emit('updateSelected', value);
|
||||
},
|
||||
get() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user