Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit bf9c35e4
authored
2024-07-31 10:51:10 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Agrege cambios al buscador
1 parent
f9473c3a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
protected_static/buscador.js
protected_static/buscador.js
View file @
bf9c35e
...
@@ -32,21 +32,34 @@ function CargarLista() {
...
@@ -32,21 +32,34 @@ function CargarLista() {
};
};
// Function to create the list items
// Function to create the list items
// Function to create the list items
function
createHistoricoList
(
data
)
{
function
createHistoricoList
(
data
)
{
//console.log(data)
const
historicoDiv
=
document
.
getElementById
(
'div_historico'
);
const
historicoDiv
=
document
.
getElementById
(
'div_historico'
);
historicoDiv
.
innerHTML
=
""
;
historicoDiv
.
innerHTML
=
""
;
//historicoDiv.innerText = "Dominios del dia"
data
.
inspecciones
.
forEach
(
inspeccion
=>
{
data
.
inspecciones
.
forEach
(
inspeccion
=>
{
// Crear un campo oculto para almacenar el objeto data como JSON string
const
hiddenInput
=
document
.
createElement
(
'input'
);
hiddenInput
.
type
=
'hidden'
;
hiddenInput
.
id
=
inspeccion
.
numeroplanilla
+
'data-json'
;
hiddenInput
.
value
=
JSON
.
stringify
(
inspeccion
);
//historicoDiv.appendChild(hiddenInput);
const
button
=
document
.
createElement
(
'button'
);
const
button
=
document
.
createElement
(
'button'
);
button
.
className
=
'PDFButton'
;
button
.
className
=
'PDFButton'
;
button
.
id
=
inspeccion
.
n
ame
;
button
.
id
=
inspeccion
.
n
umeroplanilla
;
button
.
textContent
=
'Ir dominio '
;
button
.
textContent
=
'Ir dominio '
;
button
.
addEventListener
(
'click'
,
()
=>
{
handleButtonClick
(
inspeccion
);
});
const
div
=
document
.
createElement
(
'div'
);
const
div
=
document
.
createElement
(
'div'
);
//div.textContent = inspeccion.name + " " + inspeccion.resultado + " " + inspeccion.fecha + " ";
const
titulo
=
document
.
createElement
(
'H4'
);
const
titulo
=
document
.
createElement
(
'H4'
);
titulo
.
textContent
=
inspeccion
.
name
+
" "
+
inspeccion
.
resultado
;
titulo
.
textContent
=
inspeccion
.
name
+
" "
+
inspeccion
.
resultado
;
const
ftl
=
document
.
createElement
(
'H6'
);
const
ftl
=
document
.
createElement
(
'H6'
);
ftl
.
textContent
=
"Linea "
+
inspeccion
.
linea
+
", Planilla "
+
inspeccion
.
numeroplanilla
+
", Categoria "
+
inspeccion
.
categoria
;
ftl
.
textContent
=
"Linea "
+
inspeccion
.
linea
+
", Planilla "
+
inspeccion
.
numeroplanilla
+
", Categoria "
+
inspeccion
.
categoria
;
...
@@ -54,13 +67,21 @@ function createHistoricoList(data) {
...
@@ -54,13 +67,21 @@ function createHistoricoList(data) {
div
.
appendChild
(
titulo
);
div
.
appendChild
(
titulo
);
div
.
appendChild
(
ftl
);
div
.
appendChild
(
ftl
);
div
.
appendChild
(
button
);
div
.
appendChild
(
button
);
const
separador
=
document
.
createElement
(
'hr'
)
div
.
appendChild
(
hiddenInput
);
const
separador
=
document
.
createElement
(
'hr'
);
separador
.
className
=
'custom-hr'
;
separador
.
className
=
'custom-hr'
;
historicoDiv
.
appendChild
(
div
);
historicoDiv
.
appendChild
(
div
);
historicoDiv
.
appendChild
(
separador
);
historicoDiv
.
appendChild
(
separador
);
});
});
}
}
function
handleButtonClick
(
inspeccion
)
{
// Aquí puedes definir lo que quieres que suceda cuando se haga clic en el botón
console
.
log
(
'Botón clicado para:'
,
inspeccion
);
// Por ejemplo, podrías redirigir a una página basada en el dominio de inspección
// window.location.href = `http://ejemplo.com/dominio/${inspeccion.name}`;
}
async
function
fetchChat
()
{
async
function
fetchChat
()
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment