ModuleParametersForm.vue 4.09 KB
Newer Older
Quentin David's avatar
Quentin David committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<template>
    <v-form>
        <div
        v-for="param in parameters"
        :key="param.name"
        max-width="50px"
        >
            <div v-if="param.type=='List-Mono'">
                <h3 class="mb-2"> {{ param.label }} 
                    <v-btn icon
                      v-if="param.description !==undefined"
                      @click="showHideDescription(param.name)"
                    >
                        <v-icon>mdi-help-circle</v-icon>
                    </v-btn>
                </h3>
                <v-expand-transition>
                    <div v-show="show_desc[param.name]">
                        <p> {{ param.description }} </p>
                    </div>
                </v-expand-transition>
                <v-select
                label="Entrez un élément parmi la liste"
                :items="param.items"
                outlined
                >
                </v-select>
            </div>
            <div v-if="param.type=='List-Poly'">
                <h3 class="mb-2"> {{ param.label }} 
                    <v-btn icon
                      v-if="param.description !==undefined"
                      @click="showHideDescription(param.name)"
                    >
                        <v-icon>mdi-help-circle</v-icon>
                    </v-btn>
                </h3>
                <v-expand-transition>
                    <div v-show="show_desc[param.name]">
                        <p> {{ param.description }} </p>
                    </div>
                </v-expand-transition>
                <v-select
                label="Entrez un ou plusieurs éléments parmi la liste"
                :items="param.items"
                outlined
                multiple
                >
                </v-select>
            </div>
            <div v-if="param.type=='Int-2'" class="mb-0">
                <h3 class="mb-2"> {{ param.label }} 
                    <v-btn icon
                      v-if="param.description !==undefined"
                      @click="showHideDescription(param.name)"
                    >
                        <v-icon>mdi-help-circle</v-icon>
                    </v-btn>
                </h3>
                <v-expand-transition>
                    <div v-show="show_desc[param.name]">
                        <p> {{ param.description }} </p>
                    </div>
                </v-expand-transition>
                <v-row>
                    <v-col class="py-0">
                        <v-text-field
                            :label="param.items[0]"
                            outlined
                        ></v-text-field>
                    </v-col>
                    <v-col class="py-0">
                        <v-text-field
                            :label="param.items[1]"
                            outlined
                        ></v-text-field>
                    </v-col>
                </v-row>
            </div>
            <div v-if="param.type=='Int'">
                <h3 class="mb-2"> {{ param.label }} 
                    <v-btn icon
                      v-if="param.description !==undefined"
                      @click="showHideDescription(param.name)"
                    >
                        <v-icon>mdi-help-circle</v-icon>
                    </v-btn>
                </h3>
                <v-expand-transition>
                    <div v-show="show_desc[param.name]">
                        <p> {{ param.description }} </p>
                    </div>
                </v-expand-transition>
                <v-text-field
                label="Entrez un nombre"
                outlined
                ></v-text-field>
            </div>
        </div>
    </v-form>
</template>
<script>
export default {
    data: () => ({
        show_desc: {},
    }),
    props: ['parameters'],
    methods: {
        showHideDescription: function (param_name) {
            if (this.show_desc[param_name] === undefined) {
                this.$set(this.show_desc,param_name,true);
            }
            else {
                this.show_desc[param_name] = !this.show_desc[param_name];
            }
        }
    }
}
</script>