-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
54 lines (48 loc) · 3.14 KB
/
index.js
File metadata and controls
54 lines (48 loc) · 3.14 KB
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
// Data extracted from R.D.O of 12/02/26
const dadosRDO = [
// Each object represents a worker, their role, tasks, and status
{ funcao: "Engenheiro: Douglas", mat: "Supervisão", stM: "Ok", vesp: "Supervisão", cM: "Sol", cT: "" },
{ funcao: "Encarregado: Serrinha", mat: "Gestão de equipe", stM: "Ok", vesp: "Gestão de Equipe", cM: "Sol", cT: "" },
{ funcao: "Serralheiro: Daniel", mat: "Montando Brise ; Studio 06", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Serralheiro: Jairo", mat: "Montando Brise ; Studio 06", stM: "", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Pedreiro: Messias", mat: "Meio fio ; Assentamento pedras", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Pedreiro: Luis", mat: "Alvenaria ; Painéis elétricos", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Pedreiro: Claudio", mat: "Armando ferragens", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Pedreiro: Evandro", mat: "Trabalhando na sereia", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Pintor: Jorge", mat: "Acabamento da fachada studio 08", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Carpinteiro: Raimundo", mat: "Alinhamento e nivelamento", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Ajudante: Albert", mat: "Carregando carro de mão", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Ajudante: Rubens", mat: "Ajudando Luiz ; Evandro com a sereia", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Ajudante: Domingos", mat: "Ajudando Evandro com a sereia", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Ajudante: Everson", mat: "Carregando carro de mão", stM: "Ok", vesp: "", cM: "Sol", cT: "" },
{ funcao: "Equipe Sr. Afonso (Adenilton)", mat: "Colocando as pedras", stM: "-", vesp: "-", cM: "-", cT: "-" }
];
// Get the table body element where rows will be rendered
const tabela = document.getElementById('tabelaCorpo');
// Function to render the table with given list of data
function renderizarTabela(lista) {
tabela.innerHTML = lista.map(item => `
<tr>
<td><strong>${item.funcao}</strong></td> <!-- Worker role and name -->
<td>${item.mat}</td> <!-- Task description -->
<td class="status-ok">${item.stM}</td> <!-- Morning status -->
<td>${item.vesp}</td> <!-- Afternoon task -->
<td class="text-center">${item.cM}</td> <!-- Weather condition -->
<td class="text-center">${item.cT}</td> <!-- Additional notes -->
</tr>
`).join('');
}
// Function to filter data based on search input
function filtrarRDO() {
const termo = document.getElementById('inputBusca').value.toLowerCase();
const filtrados = dadosRDO.filter(item => {
// Smart search: looks into role, task, or afternoon activity
return item.funcao.toLowerCase().includes(termo) ||
item.mat.toLowerCase().includes(termo) ||
item.vesp.toLowerCase().includes(termo);
});
// Render filtered results
renderizarTabela(filtrados);
}
// Initialize table with all data on page load
renderizarTabela(dadosRDO);