|
@@ -5,21 +5,42 @@ import { SearchStore } from '@/stores/search'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
props: [],
|
|
props: [],
|
|
- // data(){
|
|
|
|
- // return {
|
|
|
|
- // block: null
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
|
|
+ data(){
|
|
|
|
+ return {
|
|
|
|
+ value: null,
|
|
|
|
+ content_types: ['concernement', 'entite']
|
|
|
|
+ }
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
- // ...mapState(SearchStore,['loaded', 'statics_byid'])
|
|
|
|
|
|
+ ...mapState(SearchStore,['keys', 'contentTypesFilter', 'results']),
|
|
|
|
+ // value(){
|
|
|
|
+ // return this.keys
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
created () {
|
|
created () {
|
|
console.log("search created");
|
|
console.log("search created");
|
|
|
|
+ this.setContentTypes(this.content_types);
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ value: {
|
|
|
|
+ handler (n,o){
|
|
|
|
+ this.setKeys(n);
|
|
|
|
+ },
|
|
|
|
+ deep: true
|
|
|
|
+ },
|
|
|
|
+ content_types: {
|
|
|
|
+ handler (n,o){
|
|
|
|
+ this.setContentTypes(n);
|
|
|
|
+ },
|
|
|
|
+ deep: true
|
|
|
|
+ },
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions(SearchStore,['loadResults']),
|
|
|
|
|
|
+ ...mapActions(SearchStore,['setKeys','setContentTypes','loadResults']),
|
|
onSubmitSearch (event) {
|
|
onSubmitSearch (event) {
|
|
- console.log("onSubmitSearch", event);
|
|
|
|
|
|
+ console.log("onSubmitSearch", event, this.value);
|
|
|
|
+ // let value = event.target[0].value;
|
|
|
|
+ this.loadResults();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
@@ -33,12 +54,21 @@ export default {
|
|
<section class="search">
|
|
<section class="search">
|
|
<h2>Recherche</h2>
|
|
<h2>Recherche</h2>
|
|
<form action="" @submit.prevent="onSubmitSearch">
|
|
<form action="" @submit.prevent="onSubmitSearch">
|
|
- <input type="text">
|
|
|
|
- <select name="content_type" id="content-type-select">
|
|
|
|
|
|
+ <input type="text" v-model="value">
|
|
|
|
+ <!-- <select name="content_type" id="content-type-select">
|
|
<option value="all">type de contenu</option>
|
|
<option value="all">type de contenu</option>
|
|
<option value="concernement">Concernement</option>
|
|
<option value="concernement">Concernement</option>
|
|
<option value="entite">Entite</option>
|
|
<option value="entite">Entite</option>
|
|
- </select>
|
|
|
|
|
|
+ </select> -->
|
|
|
|
+
|
|
|
|
+ <section class="content-type-checkboxes">
|
|
|
|
+ <input type="checkbox" name="concernement" id="concernement_checkbox" v-model="content_types" value="concernement">
|
|
|
|
+ <label for="concernement">Concernements</label>
|
|
|
|
+ <input type="checkbox" name="entite" id="entite_checkbox" v-model="content_types" value="entite">
|
|
|
|
+ <label for="concernement">Entités</label>
|
|
|
|
+ </section>
|
|
|
|
+
|
|
|
|
+
|
|
<select name="bourgeons" id="content-type-select">
|
|
<select name="bourgeons" id="content-type-select">
|
|
<option value="all">Bourgeon</option>
|
|
<option value="all">Bourgeon</option>
|
|
<option value="bourgeon1">Bourgeon1</option>
|
|
<option value="bourgeon1">Bourgeon1</option>
|
|
@@ -47,7 +77,11 @@ export default {
|
|
|
|
|
|
<input type="submit" value="rechercher">
|
|
<input type="submit" value="rechercher">
|
|
</form>
|
|
</form>
|
|
-
|
|
|
|
|
|
+ <section class="results">
|
|
|
|
+ <ul>
|
|
|
|
+ <li v-for="result in results">{{ result }}</li>
|
|
|
|
+ </ul>
|
|
|
|
+ </section>
|
|
</section>
|
|
</section>
|
|
</template>
|
|
</template>
|
|
|
|
|