github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/server/frontend/directeurs/src/components/inscrits/FormExport.vue (about)

     1  <template>
     2    <v-card>
     3      <v-card-title class="headline">Exporter les inscrits</v-card-title>
     4      <v-card-text>
     5        <v-select
     6          :items="[
     7            { value: 'inscrits', text: 'Inscrits' },
     8            { value: 'finances', text: 'Aperçu financier' }
     9          ]"
    10          v-model="mode"
    11          label="Type de liste"
    12        ></v-select>
    13        <div v-if="mode == 'inscrits'">
    14          <v-row>
    15            <v-col>
    16              <v-checkbox
    17                v-model="options.simple"
    18                label="Liste simplifiée"
    19              ></v-checkbox>
    20              <v-checkbox
    21                v-model="options.with_groupe"
    22                label="Trier par groupe"
    23              ></v-checkbox>
    24            </v-col>
    25            <v-col>
    26              <v-select
    27                :items="busItems"
    28                label="Critère de bus"
    29                v-model="options.bus"
    30              ></v-select>
    31  
    32              <v-checkbox
    33                v-model="options.with_attente"
    34                label="Ajouter la liste d'attente"
    35              ></v-checkbox>
    36              <v-checkbox
    37                v-model="options.show_colors"
    38                label="Afficher les couleurs d'arrière-plan"
    39              ></v-checkbox>
    40            </v-col>
    41          </v-row>
    42        </div>
    43      </v-card-text>
    44      <v-card-actions>
    45        <v-spacer></v-spacer>
    46        <v-btn @click="$emit('accept', mode, options)" class="green--text"
    47          >Valider</v-btn
    48        >
    49      </v-card-actions>
    50    </v-card>
    51  </template>
    52  
    53  <script lang="ts">
    54  import Vue from "vue";
    55  import Component from "vue-class-component";
    56  import { EditFields } from "@/logic/formatter";
    57  import { OptionsExportInscrit } from "@/logic/controller";
    58  import { Bus } from "@/logic/types";
    59  import { Watch } from "vue-property-decorator";
    60  
    61  const FormExportProps = Vue.extend({
    62    props: {
    63      currentBus: String as () => Bus,
    64      currentAttente: Boolean
    65    }
    66  });
    67  
    68  @Component({})
    69  export default class FormExport extends FormExportProps {
    70    mode: "inscrits" | "finances" = "inscrits"; // type de la liste
    71    options: OptionsExportInscrit = {
    72      show_colors: true,
    73      with_attente: this.currentAttente,
    74      bus: this.currentBus
    75    };
    76  
    77    busItems = EditFields.bus;
    78  
    79    @Watch("currentBus")
    80    cb() {
    81      this.options.bus = this.currentBus;
    82    }
    83  
    84    @Watch("currentAttente")
    85    ca() {
    86      this.options.with_attente = this.currentAttente;
    87    }
    88  }
    89  </script>
    90  
    91  <style scoped></style>