Commit f1caad73dbd0ab6edfb3d445260ea546b8f55f02
1 parent
e86ad0a3c1
Exists in
develop
cambio botonera tareas pausadas
Showing
2 changed files
with
66 additions
and
35 deletions
Show diff stats
src/js/controller.js
1 | angular.module('focaBotoneraPrincipal') | 1 | angular.module('focaBotoneraPrincipal') |
2 | .controller('focaBotoneraPrincipalController', [ | 2 | .controller('focaBotoneraPrincipalController', [ |
3 | '$scope', '$rootScope', '$timeout', '$location', '$localStorage', | 3 | '$scope', '$rootScope', '$timeout', '$location', '$localStorage', |
4 | 'botones', 'focaModalService', 'APP', 'focaBotoneraLateralService', | 4 | 'botones', 'focaModalService', 'APP', 'focaBotoneraLateralService', |
5 | function($scope, $rootScope, $timeout, $location, $localStorage, | 5 | function ($scope, $rootScope, $timeout, $location, $localStorage, |
6 | botones, focaModalService, APP, focaBotoneraLateralService) { | 6 | botones, focaModalService, APP, focaBotoneraLateralService) { |
7 | $scope.paginas = []; | 7 | $scope.paginas = []; |
8 | var botonesPorPagina = 10; | 8 | var botonesPorPagina = 10; |
9 | if(APP === 'distribuidor' || APP === 'transportista') { | 9 | if (APP === 'distribuidor' || APP === 'transportista') { |
10 | botonesPorPagina = 3; | 10 | botonesPorPagina = 3; |
11 | } | 11 | } |
12 | for(var i = 0; i < botones.data.length; i += botonesPorPagina) { | 12 | for (var i = 0; i < botones.data.length; i += botonesPorPagina) { |
13 | $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina)); | 13 | $scope.paginas.push(botones.data.slice(i, i + botonesPorPagina)); |
14 | } | 14 | } |
15 | 15 | ||
16 | focaBotoneraLateralService.showGuardar(false); | 16 | focaBotoneraLateralService.showGuardar(false); |
17 | focaBotoneraLateralService.showPausar(false); | 17 | focaBotoneraLateralService.showPausar(false); |
18 | focaBotoneraLateralService.showSalir(false); | 18 | focaBotoneraLateralService.showSalir(false); |
19 | focaBotoneraLateralService.showCancelar(false); | 19 | focaBotoneraLateralService.showCancelar(false); |
20 | 20 | ||
21 | $scope.irA = function(accion) { | 21 | $scope.rutas = $localStorage.rutas? JSON.parse($localStorage.rutas) : []; |
22 | |||
23 | |||
24 | $scope.irA = function (accion) { | ||
22 | $location.path(accion); | 25 | $location.path(accion); |
23 | }; | 26 | }; |
24 | 27 | ||
25 | $scope.logout = function() { | 28 | $scope.logout = function () { |
26 | $location.path('/logout'); | 29 | $location.path('/logout'); |
27 | }; | 30 | }; |
28 | 31 | ||
29 | $scope.showTerminal = function() { | 32 | $scope.showTerminal = function () { |
30 | var key = $localStorage.terminalKey; | 33 | var key = $localStorage.terminalKey; |
31 | focaModalService.info('Su terminal es: ' + key); | 34 | focaModalService.info('Su terminal es: ' + key); |
32 | }; | 35 | }; |
36 | |||
37 | init(); | ||
38 | |||
39 | function init() { | ||
40 | |||
41 | console.log($localStorage); | ||
42 | } | ||
33 | } | 43 | } |
34 | ]); | 44 | ]); |
35 | 45 |
src/views/foca-botonera-principal.html
1 | <div class="botonera-principal"> | 1 | <div class="botonera-principal"> |
2 | <div class="d-flex"> | ||
3 | |||
4 | <!-- <div class="dropdown"> | ||
5 | <button class="btn btn-secondary dropdown-toggle" | ||
6 | type="button" | ||
7 | id="dropdownMenuButton" | ||
8 | data-toggle="dropdown" | ||
9 | aria-haspopup="true" | ||
10 | aria-expanded="false"> | ||
11 | Dropdown button | ||
12 | </button> | ||
13 | <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> | ||
14 | <a class="dropdown-item" href="#">Action</a> | ||
15 | <a class="dropdown-item" href="#">Another action</a> | ||
16 | <a class="dropdown-item" href="#">Something else here</a> | ||
17 | </div> --> | ||
18 | |||
19 | |||
20 | |||
21 | <div ng-if="rutas.length > 0" class="ml-auto dropdown"> | ||
22 | <button class="m-0 btn-tareas-pausadas dropdown-toggle" | ||
23 | type="button" | ||
24 | id="dropdownMenuButton" | ||
25 | data-toggle="dropdown" | ||
26 | aria-haspopup="true" | ||
27 | aria-expanded="false" | ||
28 | > | ||
29 | Tareas Pausadas | ||
30 | </button> | ||
31 | <div class="dropdown-tareas-pausadas dropdown-menu" aria-labelledby="dropdownMenuButton"> | ||
32 | <a | ||
33 | ng-click="irA(ruta)" | ||
34 | ng-repeat="ruta in rutas track by $index" | ||
35 | class="items-dropdown dropdown-item m-1"> | ||
36 | Volver a: {{ruta}} | ||
37 | </a> | ||
38 | </div> | ||
39 | </div> | ||
40 | </div> | ||
2 | <div class="row mt-3 justify-content-center"> | 41 | <div class="row mt-3 justify-content-center"> |
3 | <div class="col-auto p-0"> | 42 | <div class="col-auto p-0"> |
4 | <img src="./img/logoMapa.png"/> | 43 | <img src="./img/logoMapa.png" /> |
5 | </div> | 44 | </div> |
6 | </div> | 45 | </div> |
7 | <div class="row"> | 46 | <div class="row"> |
8 | <div class="col-12 mb-3"> | 47 | <div class="col-12 mb-3"> |
9 | <swiper on-init="inicioSwiper"> | 48 | <swiper on-init="inicioSwiper"> |
10 | <slides> | 49 | <slides> |
11 | <slide ng-repeat="(keyPagina, pagina) in paginas"> | 50 | <slide ng-repeat="(keyPagina, pagina) in paginas"> |
12 | <menu class="botonera-principal-menu"> | 51 | <menu class="botonera-principal-menu"> |
13 | <menuitem | 52 | <menuitem ng-class="boton.clase" ng-repeat="(keyBoton, boton) in pagina" |
14 | ng-class="boton.clase" | ||
15 | ng-repeat="(keyBoton, boton) in pagina" | ||
16 | ng-show="boton.accion != '/venta-hoja-ruta/lista'"> | 53 | ng-show="boton.accion != '/venta-hoja-ruta/lista'"> |
17 | <button | 54 | <button foca-focus="keyPagina === 0 && keyBoton === 0" ng-click="irA(boton.accion)"> |
18 | foca-focus="keyPagina === 0 && keyBoton === 0" | 55 | <span ng-bind="boton.texto"></span> |
19 | ng-click="irA(boton.accion)"> | 56 | </button> |
20 | <span ng-bind="boton.texto"></span> | ||
21 | </button> | ||
22 | </menuitem> | 57 | </menuitem> |
23 | </menu> | 58 | </menu> |
24 | </slide> | 59 | </slide> |
25 | </slides> | 60 | </slides> |
26 | <prev></prev> | 61 | <prev></prev> |
27 | <next></next> | 62 | <next></next> |
28 | <pagination></pagination> | 63 | <pagination></pagination> |
29 | </swiper> | 64 | </swiper> |
30 | <div class="d-none d-sm-block"> | 65 | <div class="d-none d-sm-block"> |
31 | <a | 66 | <a class="btn btn-outline-dark mt-5 btn-lg" href="javascript:void()" ng-click="showTerminal()"> |
32 | class="btn btn-outline-dark mt-5 btn-lg" | ||
33 | href="javascript:void()" | ||
34 | ng-click="showTerminal()" | ||
35 | > | ||
36 | <i class="fa fa-info-circle" aria-hidden="true"></i> | 67 | <i class="fa fa-info-circle" aria-hidden="true"></i> |
37 | </a> | 68 | </a> |
38 | <a class="btn btn-outline-dark mt-5 btn-lg" | 69 | <a class="btn btn-outline-dark mt-5 btn-lg" href="javascript:void()" ng-click="logout()"> |
39 | href="javascript:void()" | ||
40 | ng-click="logout()" | ||
41 | > | ||
42 | <i class="fa fa-power-off" aria-hidden="true"></i> | 70 | <i class="fa fa-power-off" aria-hidden="true"></i> |
43 | </a> | 71 | </a> |
44 | </div> | 72 | </div> |
45 | </div> | 73 | </div> |
46 | </div> | 74 | </div> |