Contract.vue 1.33 KB
Newer Older
Rémy Marronnier's avatar
wip  
Rémy Marronnier committed
1 2 3
 <template>
  <v-expansion-panels>
    <v-expansion-panel>
Rémy Marronnier's avatar
Rémy Marronnier committed
4
      <v-expansion-panel-header>
Rémy Marronnier's avatar
Rémy Marronnier committed
5 6 7 8 9 10 11 12 13 14 15
        <v-img
          :src="require('@/assets/contracts/' + contractType + '.svg')"
          aspect-ratio="1"
          maxWidth="50px"
          maxHeight="50px"
          class="mr-5"
        ></v-img>
        <h3>
          {{aids.length}}
          {{ contractDescription }}
        </h3>
Rémy Marronnier's avatar
Rémy Marronnier committed
16
      </v-expansion-panel-header>
Rémy Marronnier's avatar
wip  
Rémy Marronnier committed
17
      <v-expansion-panel-content>
Rémy Marronnier's avatar
Rémy Marronnier committed
18
        <AidSummary v-for="aid in aids" :key="aid.name" v-bind:aid="aid"></AidSummary>
Rémy Marronnier's avatar
wip  
Rémy Marronnier committed
19 20 21 22 23 24 25 26 27 28 29
      </v-expansion-panel-content>
    </v-expansion-panel>
  </v-expansion-panels>
</template>
 
 <script>
import AidSummary from "@/components/results/aids/AidSummary";
export default {
  name: "Contract",
  components: {
    AidSummary
Rémy Marronnier's avatar
Rémy Marronnier committed
30
  },
Rémy Marronnier's avatar
Rémy Marronnier committed
31 32 33 34 35
  props: {
    contractType: String,
    aids: {
      type: Array
    }
Rémy Marronnier's avatar
Rémy Marronnier committed
36
  },
Rémy Marronnier's avatar
Rémy Marronnier committed
37 38 39 40 41
  computed: {
    contractDescription() {
      return this.$store.state.results.contracts.find(
        contract => contract.name === this.contractType
      ).description;
Rémy Marronnier's avatar
Rémy Marronnier committed
42
    }
Rémy Marronnier's avatar
Rémy Marronnier committed
43 44 45 46 47 48 49 50 51 52 53 54 55
  },
  filters: {
    // filtered(aid) {
    //   let values = [];
    //   aid.filters.forEach(filter => {
    //     values.push(filter.value);
    //   });
    //   if (values.includes(true)) {
    //     return aid;
    //   } else {
    //     return null;
    //   }
    // }
Rémy Marronnier's avatar
wip  
Rémy Marronnier committed
56 57 58 59 60 61
  }
};
</script>
 
 <style>
</style>