72
72
<q-input
73
73
borderless
74
74
dense
75
- debounce =" 300"
76
75
v-model =" changeFilter"
77
76
placeholder =" Search"
78
77
@keydown.enter.prevent =" queryTable"
83
82
size =" 12px"
84
83
color =" cyan-8"
85
84
icon =" search"
86
- round
87
85
dense
88
86
@click =" queryTable"
89
87
/>
90
88
</template >
91
89
<template v-slot :header =" props " >
92
90
<q-tr :props =" props" >
93
91
<q-th />
94
- <q-th v-for =" col in props.cols" :key =" col.name" :props =" props" >
95
- <div class =" tooltip-wrapper" >
96
- {{ col.label }}
97
- <q-tooltip class =" tooltip-text" anchor =" bottom middle" self =" top middle" :offset =" [0, 5]" >
98
- {{ Feature.toolTipGen(col.name) }}
99
- </q-tooltip >
92
+ <q-th
93
+ v-for =" col in props.cols"
94
+ :key =" col.name"
95
+ :props =" props"
96
+ >
97
+ <div class =" tooltip-wrapper row items-center no-wrap" >
98
+ <span class =" q-mr-xs" >
99
+ <span class =" cursor-pointer" >
100
+ {{ col.label }}
101
+ <q-tooltip
102
+ class =" tooltip-text"
103
+ anchor =" bottom middle"
104
+ self =" top middle"
105
+ :offset =" [0, 5]"
106
+ >
107
+ {{ Feature.toolTipGen(col.name) }}
108
+ </q-tooltip >
109
+ </span >
110
+ </span >
111
+ <template v-if =" col .name === ' lastUpdated' " >
112
+ <q-btn
113
+ size =" 7px"
114
+ color =" cyan-8"
115
+ icon =" bi-funnel-fill"
116
+ style =" padding : 2.5px ; margin-bottom : 1.5px ;"
117
+ dense
118
+ ref =" buttonRef"
119
+ >
120
+ <q-menu
121
+ anchor =" bottom right"
122
+ self =" top right"
123
+ :offset =" [0, 5]"
124
+ >
125
+ <q-card
126
+ style =" max-width : 205px ; padding : 5px ; box-shadow : 0 0 12px rgba (0 , 188 , 212 , 0.6 );"
127
+ class =" q-pa-sm"
128
+ >
129
+ <q-card-section class =" text-center text-subtitle1" style =" font-weight : 550 ;" >
130
+ FILTER DAYS
131
+ </q-card-section >
132
+ <q-separator />
133
+ <q-card-section class =" q-gutter-sm" >
134
+ <div class =" row items-center q-col-gutter-sm" >
135
+ <q-input
136
+ dense
137
+ color =" cyan-8"
138
+ v-model =" search"
139
+ placeholder =" 30"
140
+ @keyup.enter =" queryTable(search)"
141
+ style =" width : 50px ; margin-left : 15px ;"
142
+ input-class =" text-center"
143
+ />
144
+ <q-item-label style =" font-weight : 450 ;" > DAY(S) PRIOR</q-item-label >
145
+ </div >
146
+ </q-card-section >
147
+ <q-separator />
148
+ <q-card-section class =" q-pt-none" >
149
+ <div class =" row items-center q-gutter-sm" style =" margin-top : 15px ;" >
150
+ <q-btn
151
+ dense
152
+ style =" padding : 5px ;"
153
+ size =" 12px"
154
+ label =" Apply"
155
+ color =" cyan-8"
156
+ @click =" queryTable(search)"
157
+ />
158
+ <q-btn
159
+ dense
160
+ style =" padding : 5px ;"
161
+ size =" 12px"
162
+ label =" Clear Filter"
163
+ color =" cyan-8"
164
+ @click =" queryTable()"
165
+ />
166
+ </div >
167
+ </q-card-section >
168
+ </q-card >
169
+ </q-menu >
170
+ </q-btn >
171
+ </template >
100
172
</div >
101
173
</q-th >
102
174
</q-tr >
103
175
</template >
104
176
<template v-slot :body =" props " >
105
177
<q-tr
106
178
:props =" props"
107
- v-if =" Formatters.buttonParse(props.cols, props. row)"
179
+ v-if =" Formatters.buttonParse(props.row)"
108
180
>
109
181
<q-td class =" cell-spacing" >
110
182
<q-btn
@@ -206,6 +278,7 @@ const router = useRouter();
206
278
const changeFilter = ref <string >(' ' );
207
279
const banner = ref <Banner >();
208
280
const system = ref <System >();
281
+ const search = ref (' ' );
209
282
let rows: QTableProps [' rows' ] = [];
210
283
const paginationFront = ref ({
211
284
rowsPerPage: 200 ,
@@ -261,7 +334,10 @@ onMounted(() => {
261
334
return b .lastUpdated - a .lastUpdated ;
262
335
}
263
336
});
264
- rows = Formatters .setVisibility (rows );
337
+ rows = changeFilter .value
338
+ ? Formatters .setVisibility (rows ) // if searched through URL bar, it removes 30 day filter.
339
+ : Formatters .setVisibility (rows , 30 ); // default at 30 days when loaded without '?search=<val>' query.
340
+
265
341
loading .value = false ;
266
342
})
267
343
.catch ((reason ) => {
@@ -333,8 +409,7 @@ function exportTable(this: any) {
333
409
}
334
410
335
411
// Query - Runs through a Search Process as it waits for the user.
336
- async function queryTable(this : any ) {
337
- // Wait Until User Enters...
412
+ async function queryTable(priorDays ? : any ) {
338
413
await waitUp ();
339
414
340
415
// Handles the URL change to reflect when the user searches.
@@ -353,14 +428,14 @@ async function queryTable(this: any) {
353
428
const originalRows = rows ;
354
429
const triggerRefresh = paginationFront .value .rowsPerPage ;
355
430
356
- // 3 - Set the Current Rows to Filtered Value
357
- rows = Formatters .setVisibility (rowsToExport );
431
+ // 3 - Set filtered rows with visibility flags updated
432
+ rows = Formatters .setVisibility (rowsToExport , priorDays );
358
433
359
- // 4 - Trigger the Refresh
434
+ // 4 - Refresh pagination to trigger table update
360
435
paginationFront .value .rowsPerPage = 100 ;
361
436
paginationFront .value .rowsPerPage = triggerRefresh ;
362
437
363
- // 5 - Restore Original Rows for Next Query
438
+ // 5 - Restore original rows for next queries
364
439
rows = originalRows ;
365
440
}
366
441
0 commit comments