Commit aa62e637 authored by Rémy Marronnier's avatar Rémy Marronnier

result page wip

parent d307baec
<template>
<v-card>
Vous pouvez bénéficier de
**tout déplier**
<v-expansion-panels>
<v-expansion-panel>
<v-expansion-panel-header>Item</v-expansion-panel-header>
<v-expansion-panel-content v-for="(item,i) in 5" :key="i">
<Contract v-for="aid in aids" :key="aid"></Contract>
<v-expansion-panel-header>Vous pouvez bénéficier de**tout déplier**</v-expansion-panel-header>
<v-expansion-panel-content>
<Contract
v-for="(aids, contractType) in contracts"
:key="(contractType)"
v-bind:aids="aids"
v-bind:contractType="contractType"
></Contract>
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
......@@ -19,13 +22,15 @@ export default {
components: {
Contract
},
data() {
return {
aids: []
};
},
beforeCreate() {
this.aids = this.$store.state.results.eligible;
// data() {
// return {
// contracts: {}
// };
// },
computed: {
contracts() {
return this.$store.state.results.eligible;
}
}
};
</script>
......
<template>
<v-list-item two-line>
<v-list-item-content>
<v-list-item-title>Titre de l'aide</v-list-item-title>
<v-list-item-subtitle>Résumé</v-list-item-subtitle>
<v-btn></v-btn>
<v-list-item-title>Titre de l'aide {{aid.name}}</v-list-item-title>
<v-list-item-subtitle>{{aid.short_description}}</v-list-item-subtitle>
<v-chip v-for="filter in filters" :key="filter.desciption">{{filter.description}}</v-chip>
<v-btn right>
<v-icon left>mdi-eye</v-icon>Voir
</v-btn>
</v-list-item-content>
</v-list-item>
</template>
<script>
export default {
name: "AidSummary"
name: "AidSummary",
props: {
aid: {
type: Object
}
},
computed: {
filters() {
return this.aid.filters;
}
}
};
</script>
......
<template>
<v-expansion-panels>
<v-expansion-panel>
<v-expansion-panel-header>Nom du type d'aide</v-expansion-panel-header>
<v-expansion-panel-header>
<v-img src="@/assets/contracts/alternance.svg"></v-img>
{{ contractType }}
</v-expansion-panel-header>
<v-expansion-panel-content>
<AidSummary></AidSummary>
<v-btn right>
<v-icon left>mdi-eye</v-icon>Voir
</v-btn>
<AidSummary v-for="aid in aids" :key="aid.name" v-bind:aid="aid"></AidSummary>
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
......@@ -19,8 +19,11 @@ export default {
components: {
AidSummary
},
data() {
return {};
props: {
contractType: String,
aids: {
type: Array
}
}
};
</script>
......
......@@ -137,7 +137,7 @@ function fakeAidSummaryGenerator() {
var short_description = lorem.generateParagraphs(1);
let allFilters = filtersService();
let contracts = contractsService();
var contract = contracts[Math.floor(Math.random() * contracts.length)];
var contract = contracts[Math.floor(Math.random() * contracts.length)].name;
let random_filter = Math.floor(Math.random() * allFilters.length);
var filters = [allFilters[random_filter], allFilters[random_filter - 1]];
......@@ -160,12 +160,14 @@ export function aidsService(quantity) {
aidsArray[i] = fakeAidSummaryGenerator();
}
let aidsSortedByContract = [];
let aidsSortedByContract = {}
contractsService().forEach(contract => {
aidsSortedByContract[contract.name] = []
});
aidsArray.forEach(aid => {
aidsSortedByContract[aid.contract].push(aid)
});
return aidsSortedByContract;
......
......@@ -41,10 +41,10 @@ export default {
NonEligible
},
beforeCreate() {
if (this.$store.state.results.filters_quantity == 0) {
if (this.$store.state.results.filters_quantity === 0) {
this.$store.dispatch("getFilters");
}
if (this.$store.state.results.contracts_quantity == 0) {
if (this.$store.state.results.contracts_quantity === 0) {
this.$store.dispatch("getContracts");
}
if (this.$store.state.situation.changed) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment