-
Notifications
You must be signed in to change notification settings - Fork 0
/
Excel-Sheet-Filters.html
272 lines (238 loc) · 15 KB
/
Excel-Sheet-Filters.html
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/@mdi/[email protected]/css/materialdesignicons.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.min.css" rel="stylesheet" />
<title>Excel Sheet Filters V2.4.1</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vuetify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.5/xlsx.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.9.1/underscore-min.js"></script>
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui" />
<meta charset="UTF-8" />
<style>
.v-btn {
text-transform: unset !important;
}
</style>
<base target="_blank">
</head>
<script>
Date.prototype.getWeek = function () {
var date = new Date(this.getTime());
date.setHours(0, 0, 0, 0);
// Thursday in current week decides the year.
date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);
// January 4 is always in week 1.
var week1 = new Date(date.getFullYear(), 0, 4);
// Adjust to Thursday in week 1 and count number of weeks from date to week1.
return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000
- 3 + (week1.getDay() + 6) % 7) / 7);
}
</script>
<body>
<div id="app">
<v-app id="inspire">
<div>
<v-app-bar app color="blue darken-4" dense dark>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<div>
<!-- 1. Create the button that will be clicked to select a file -->
<v-btn class="ma-1" text outlined :loading="isSelecting" @click="handleFileImport">
CARREGAR ARQUIVO
</v-btn>
<!-- Create a File Input that will be hidden but triggered with JavaScript -->
<input ref="uploader" class="d-none" type="file" @change="onFileChanged"
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
</div>
</template>
<span>Carregar arquivo Excel (.xlsx)</span>
</v-tooltip>
<v-spacer></v-spacer>
<div class="ma-1">SEMANA: {{ new Date().getFullYear()}}{{new Date().getWeek() }}</div>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-btn v-bind="attrs" v-on="on" icon @click="aaa()">
<v-icon>mdi-white-balance-sunny </v-icon>
</v-btn>
</template>
<span>Mudar tema</span>
</v-tooltip>
</v-app-bar>
</div>
<v-main>
<!--{{filtros}}-->
<div class="pa-4">
<v-card>
<v-data-table dense :headers="headers" :items="current_list" :items-per-page="10"
:loading="statusCarregando" class="elevation-1"
loading-text="Aguarde..." :footer-props="{
showFirstLastPage: true,
firstIcon: 'mdi-arrow-collapse-left',
lastIcon: 'mdi-arrow-collapse-right',
prevIcon: 'mdi-minus',
nextIcon: 'mdi-plus',
'items-per-page-all-text': 'Todas',
'items-per-page-text': 'Itens por página:'
}">>
<template v-slot:top>
<div v-show="nofilters == true">
<div class="text-center" style="padding:20px">
<v-btn color="primary" class="mx-2" @click="mostra1()">
ADICIONAR FILTRO
</v-btn>
</div>
</div>
<!-- {{filtros}}-->
<!-- FILTRO 0 -->
<div v-show="filtros[0].state == true">
<v-row class="m-1" justify="center">
<v-col lg="2" style="padding:5px">
<v-select :items="items" @input='changed_campo_filtro0' item-text="state"
v-model="filtrocampo0" label="SELECIONE O CAMPO" return-object>
</v-select>
</v-col>
<v-col lg="2" style="padding:5px">
<v-select :items="Tiposfiltro" @input='changed_tipo_filtro_filtro0'
v-model="filtrotipo0" item-text="state" label="SELECIONE O FILTRO"
return-object></v-select>
</v-col>
<v-col lg="2" style="padding:5px">
<v-text-field type="String" label="DIGITE O TEXTO" v-model="filtro0"
@input='changed_text_filtro0'></v-text-field>
</v-col>
<v-col lg="1" style="padding-top:15px">
<v-btn class="mx-2" fab dark x-small color="primary"
@click='removefilter(0)' v-model="minusbttn0">
<v-icon dark>
mdi-minus
</v-icon>
</v-btn>
<v-btn class="mx-2" fab dark x-small @click='addfilter()' color="primary">
<v-icon dark>
mdi-plus
</v-icon>
</v-btn>
</v-col>
</v-row>
</div>
<!-- FILTRO 1 -->
<div v-show="filtros[1].state == true">
<v-row class="mb-1" justify="center">
<v-col lg="2" style="padding:5px">
<v-select :items="items" @input='changed_campo_filtro1' item-text="state"
v-model="filtrocampo1" label="SELECIONE O CAMPO" return-object>
</v-select>
</v-col>
<v-col lg="2" style="padding:5px">
<v-select :items="Tiposfiltro" @input='changed_tipo_filtro_filtro1'
v-model="filtrotipo1" item-text="state" label="SELECIONE O FILTRO"
return-object></v-select>
</v-col>
<v-col lg="2" style="padding:5px">
<v-text-field type="String" label="DIGITE O TEXTO" v-model="filtro1"
@input='changed_text_filtro1'></v-text-field>
</v-col>
<v-col lg="1" style="padding-top:15px">
<v-btn class="mx-2" fab dark x-small @click='removefilter(1)'
v-model="minusbttn1" color="primary">
<v-icon dark>
mdi-minus
</v-icon>
</v-btn>
<v-btn class="mx-2" fab dark x-small @click='addfilter()' color="primary">
<v-icon dark>
mdi-plus
</v-icon>
</v-btn>
</v-col>
</v-row>
</div>
<!-- FILTRO 2 -->
<div v-show="filtros[2].state == true">
<v-row class="mb-1" justify="center">
<v-col lg="2" style="padding:5px">
<v-select :items="items" @input='changed_campo_filtro2' item-text="state"
v-model="filtrocampo2" label="SELECIONE O CAMPO" return-object>
</v-select>
</v-col>
<v-col lg="2" style="padding:5px">
<v-select :items="Tiposfiltro" @input='changed_tipo_filtro_filtro2'
v-model="filtrotipo2" item-text="state" label="SELECIONE O FILTRO"
return-object></v-select>
</v-col>
<v-col lg="2" style="padding:5px">
<v-text-field type="String" label="DIGITE O TEXTO" v-model="filtro2"
@input='changed_text_filtro2'></v-text-field>
</v-col>
<v-col lg="1" style="padding-top:15px">
<v-btn class="mx-2" fab dark x-small @click='removefilter(2)'
v-model="minusbttn2" color="primary">
<v-icon dark>
mdi-minus
</v-icon>
</v-btn>
<v-btn class="mx-2" fab dark x-small @click='addfilter()' color="primary">
<v-icon dark>
mdi-plus
</v-icon>
</v-btn>
</v-col>
</v-row>
</div>
<!-- FILTRO 3 -->
<div v-show="filtros[3].state == true">
<v-row class="mb-1" justify="center">
<v-col lg="2" style="padding:5px">
<v-select :items="items" @input='changed_campo_filtro3' item-text="state"
v-model="filtrocampo3" label="SELECIONE O CAMPO" return-object>
</v-select>
</v-col>
<v-col lg="2" style="padding:5px">
<v-select :items="Tiposfiltro" @input='changed_tipo_filtro_filtro3'
v-model="filtrotipo3" item-text="state" label="SELECIONE O FILTRO"
return-object></v-select>
</v-col>
<v-col lg="2" style="padding:5px">
<v-text-field type="String" label="DIGITE O TEXTO" v-model="filtro3"
@input='changed_text_filtro3'></v-text-field>
</v-col>
<v-col lg="1" style="padding-top:15px">
<v-btn class="mx-2" fab dark x-small @click='removefilter(3)'
v-model="minusbttn3" color="primary">
<v-icon dark>
mdi-minus
</v-icon>
</v-btn>
<v-btn class="mx-2" fab dark x-small @click='addfilter()' color="primary">
<v-icon dark>
mdi-plus
</v-icon>
</v-btn>
</v-col>
</v-row>
</div>
</template>
</v-data-table>
</v-card>
</div>
</v-main>
<v-footer padless color="blue darken-4" dark>
<v-col class="text-center py-1" cols="12">
<small
style="padding-right: 4px; font-family: Helvetica, sans-serif;letter-spacing: normal; font-size: 14px;">
Rafael Henrique da Rosa, 2022.
</small>
</v-col>
</v-footer>
</v-app>
<textarea id="json-result" style="display:none;height:500px;width:350px;"></textarea>
</div>
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------>
<script src="Excel-Sheet-Filters.js"></script>
</body>
</html>