Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Asistencia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Billy Larru
Asistencia
Commits
5f36ddb0
Commit
5f36ddb0
authored
Aug 28, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit de borrador para no quitar el ejemplo de prueba de arreglo de promesas
parent
9a0af8e0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
11 deletions
+81
-11
general.js
src/main/webapp/js/general.js
+2
-2
proyectar_asistencia_policias.js
src/main/webapp/js/pages/proyectar_asistencia_policias.js
+77
-8
proyectarAsistenciaPolicias.jsp
src/main/webapp/vistas/proyectarAsistenciaPolicias.jsp
+2
-1
No files found.
src/main/webapp/js/general.js
View file @
5f36ddb0
...
...
@@ -74,7 +74,7 @@ ajaxWebService.interceptors.response.use(function (response) {
message
:
response
.
data
.
message
||
`Operación exitosa`
,
data
:
response
.
data
.
data
||
response
.
data
};
console
.
log
(
respuesta
)
console
.
log
(
respuesta
,
moment
().
format
(
"YYYY/DD/MM HH:MM:SS s"
)
)
return
respuesta
;
},
function
(
error
)
{
// Do something with response error
...
...
@@ -303,7 +303,7 @@ data: [],
classNameForDatatable
:
``
,
footerFilter
:
false
,
highlighting
:
true
})
=>
{
})
=>
{
let
data
=
jsonForDatatable
.
data
;
let
columns
=
jsonForDatatable
.
columns
;
let
columnDefs
=
jsonForDatatable
.
columns
;
...
...
src/main/webapp/js/pages/proyectar_asistencia_policias.js
View file @
5f36ddb0
...
...
@@ -64,7 +64,6 @@ function defaultConfigHandsonTable() {
function
mostrarVistaPrevia
()
{
ajaxWebService
.
get
(
URI_POLICIA_PROYECCION
).
then
((
response
)
=>
{
debugger
if
(
response
.
status
)
{
handsonTable
.
destroy
();
let
container
=
document
.
getElementById
(
"tblProyectado"
);
...
...
@@ -194,15 +193,85 @@ function guardarCambios() {
});
// let mrd = {
// id: 1,
// sede_descripcion: "ARENALES",
// asistencia_entrada: "10:00",
// asistencia_salida: "22:22"
// };
//
// ajaxWebService.patch("http://sistem16:666/proyeccion/1", mrd)
// setInterval(() => {
// console.log(moment().format("YYYY/DD/MM HH:MM:SS s"))
// }, 500)
// let timer1 = () => {
// return new Promise((resolve, reject) => {
// resolve(ajaxWebService.get("https://yts.am/api/v2/list_movies.json"))
// });
// }
//
// let timer2 = () => {
// return new Promise((resolve, reject) => {
// let mrd = {
// id: 2,
// sede_descripcion: "ARENALES",
// asistencia_entrada: "10:00",
// asistencia_salida: "22:22"
// };
//
// resolve(ajaxWebService.get("https://yts.am/api/v2/list_movies.json?sort=seeds&limit=15"))
// })
// }
// Promise.all([ajaxWebService.get("https://yts.am/api/v2/list_movies.json"), ajaxWebService.get("https://yts.am/api/v2/list_movies.json?sort=seeds&limit=15")])
// .then((value) => {
// console.log(`FIN`, moment().format("YYYY/DD/MM HH:MM:SS s"))
// debugger;
// })
Promise
.
all
(
dataRequest
.
map
(
p
=>
ajaxWebService
.
patch
(
`
${
URI_POLICIA_PROYECCION
}
/
${
p
.
id
}
`
,
p
)))
.
then
(
axios
.
spread
(
function
(...
pms
)
{
console
.
log
(
"POR FIN"
)
}))
let
promises
=
[]
dataRequest
.
forEach
(
d
=>
{
promises
.
push
(
ajaxWebService
.
patch
(
`
${
URI_POLICIA_PROYECCION
}
/
${
d
.
id
}
`
,
d
))
});
axios
.
all
(
promises
)
.
then
(
axios
.
spread
(
function
(
acct
,
perms
)
{
debugger
}));
swal
({
title
:
'Está seguro de guardar los cambios?'
,
text
:
""
,
type
:
'warning'
,
showCancelButton
:
true
,
confirmButtonColor
:
'#3085d6'
,
cancelButtonColor
:
'#d33'
,
confirmButtonText
:
'Sí, guardar!'
}).
then
((
result
)
=>
{
if
(
result
.
value
)
{
// dataRequest.forEach(d => {
// promises.push(ajaxWebService.patch(`${URI_POLICIA_PROYECCION}/${d.id}`, d))
// });
// Promise.all([get1(), get2()])
// .then(function ([acct, perms]) {
// swal(
// {
// type: 'success',
// title: '¡Se guardaron los cambios correctamente!',
// showConfirmButton: false,
// timer: 1500
// }
// );
// });
}
})
// ajaxWebService.patch(URI_POLICIA_PROYECCION, dataRequest).then((response) => {
//
...
...
src/main/webapp/vistas/proyectarAsistenciaPolicias.jsp
View file @
5f36ddb0
...
...
@@ -6,7 +6,7 @@
<
%@
include
file=
"templates/header.jsp"
%
>
<!--template-core-->
<!--css de la pagina-->
<link
href=
"../css/lib/sweetalert2.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<!--css-->
</head>
<body>
...
...
@@ -89,6 +89,7 @@
<script
src=
"../plantilla/assets/js/plugins/tables/handsontable/handsontable.min.js"
></script>
<script
src=
"../js/lib/jquery.inputmask.bundle.min.js"
type=
"text/javascript"
></script>
<script
src=
"../js/lib/lodash.js"
type=
"text/javascript"
></script>
<script
src=
"../js/lib/sweetalert2.min.js"
type=
"text/javascript"
></script>
<script
src=
"../js/lib/axios.min.js"
type=
"text/javascript"
></script>
<script
src=
"../plantilla/assets/js/plugins/forms/selects/select2.min.js"
></script>
<script
src=
"../js/pages/proyectar_asistencia_policias.js"
type=
"text/javascript"
></script>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment