@@ -13,16 +13,16 @@ q-select(
1313 @add ="addFilter($event)"
1414 @remove ="removeFilter($event)"
1515)
16- template( v-slot:option ="{ index, itemProps, opt, selected, toggleOption }" )
17- q-item-label( v-bind ="itemProps" v-if ="opt.header" header ) {{ opt.label }}
18- //@click.capture='addFilter({index, value: opt})'
19- q-item( v-bind ="itemProps" v-else )
20- q-item-section( side )
21- q-icon( :name ="opt.icon" : color= "opt.color" size ="xs" )
22- q-item-section
23- q-item-label( v-html ="opt.label" )
24- q-item-section( side )
25- q-toggle( :model-value ="selected" @update:model-value ="toggleOption" )
16+ template( v-slot:option ="{ index, itemProps, opt, selected, toggleOption }" )
17+ q-item-label( v-bind ="itemProps" v-if ="opt.header" header ) {{ opt.label }}
18+ //@click.capture='addFilter({index, value: opt})'
19+ q-item( v-bind ="itemProps" v-else )
20+ q-item-section( side )
21+ q-icon( :name ="opt.icon" : color= "opt.color" size ="xs" )
22+ q-item-section
23+ q-item-label( v-html ="opt.label" )
24+ q-item-section( side )
25+ q-toggle( :model-value ="selected" @update:model-value ="toggleOption" )
2626
2727</template >
2828
@@ -32,7 +32,7 @@ import type { Ref } from 'vue'
3232import { useHttpApi } from " ~/composables/useHttpApi" ;
3333import type { components } from ' #build/types/service-api'
3434import { useRoute , useRouter } from ' nuxt/app' ;
35-
35+ import { ticketType , lifeSteps } from " #imports " ;
3636type Category = components [' schemas' ][' CategoriesDto' ]
3737type State = components [' schemas' ][' StatesDto' ]
3838
@@ -49,12 +49,7 @@ const router = useRouter()
4949
5050const { data : statesData } = inject (' stateFetch' )
5151const { data : categoriesData } = inject (' categoriesFetch' )
52- const ticketType: {
53- label: string ,
54- value: number ,
55- icon: string ,
56- color: string
57- }[] | undefined = inject (' ticketType' )
52+
5853onMounted (() => {
5954 getFilters ()
6055})
@@ -88,12 +83,6 @@ const getFilters = () => {
8883
8984
9085const filters = ref <Option []>([])
91- const lifeSteps = ref <Option []>([
92- { label: ' Lifestep' , header: true },
93- { label: ' Ouvert' , value: ' 1' , group: ' lifestep' , icon: ' mdi-circle' , color: " green" },
94- { label: ' Clos' , value: ' 0' , group: ' lifestep' , icon: ' mdi-circle' , color: " red" },
95- ])
96-
9786const options = computed (() => {
9887 // const categories: Option[] = categoriesData.value.data.map((category: Category) => {
9988 // return {
@@ -103,7 +92,7 @@ const options = computed(() => {
10392 // }
10493 // }) ?? []
10594 // categories.unshift({ label: 'Catégories', header: true })
106- const ticketTypeOptions: Option [] = ticketType .value . map ((type ) => {
95+ const ticketTypeOptions: Option [] = ticketType .map ((type ) => {
10796 return {
10897 label: type .label ,
10998 value: type .value .toString (),
@@ -123,8 +112,9 @@ const options = computed(() => {
123112 }
124113 }) ?? []
125114 states .unshift ({ label: ' États' , header: true })
115+ lifeSteps .unshift ({ label: ' Étapes de vie' , header: true })
126116 return [
127- ... lifeSteps . value ,
117+ ... lifeSteps ,
128118 ... ticketTypeOptions ,
129119 // ...categories,
130120 ... states
0 commit comments