Commit bd3a040f8206329d42d206e1ff7086087e42dd21
1 parent
b944d384c3
Exists in
master
Regional Pap pricing UI
Showing
3 changed files
with
89 additions
and
9 deletions
Show diff stats
app/partials/analytics/analytics.controller.js
1 | 1 | 'use strict'; |
2 | 2 | angular.module('acufuel') |
3 | - .controller('analyticsController', ['$scope','analyticsService',function($scope, analyticsService) { | |
3 | + .controller('analyticsController', ['$scope','analyticsService',function($scope,analyticsService) { | |
4 | 4 | |
5 | 5 | $(document).ready(function(){ |
6 | 6 | $(function(){ |
7 | - new jvm.MultiMap({ | |
7 | + /*map = new jvm.MultiMap({ | |
8 | 8 | container: $('#map'), |
9 | 9 | maxLevel: 1, |
10 | 10 | main: { |
... | ... | @@ -12,20 +12,57 @@ |
12 | 12 | backgroundColor: '#ffce99', |
13 | 13 | }, |
14 | 14 | mapUrlByCode: function(code, multiMap){ |
15 | - console.log('-----s-----s-s--',code.toLowerCase()) | |
15 | + console.log('dddd---',code); | |
16 | + console.log('----------',map.getRegionName(code)); | |
17 | + getRegionPap(label); | |
16 | 18 | return '/js/us-counties/jquery-jvectormap-data-'+ |
17 | 19 | code.toLowerCase()+'-'+ |
18 | 20 | multiMap.defaultProjection+'-en.js'; |
19 | 21 | }, |
20 | - onRegionClick:function(event, code) { | |
22 | + onRegionClick:function(event, code) { | |
23 | + //console.log('----------',map.getRegionName(code)); | |
21 | 24 | var name = (code); |
22 | 25 | alert(name); |
23 | 26 | } |
27 | + });*/ | |
28 | + | |
29 | + jQuery('#map').vectorMap({ | |
30 | + map: 'us_lcc', | |
31 | + backgroundColor: '#ffce99', | |
32 | + color: '#dfdfdd', | |
33 | + hoverOpacity: 0, | |
34 | + selectedColor: '#5f8b98', | |
35 | + hoverColor: '#5f8b98', | |
36 | + enableZoom: true, | |
37 | + showTooltip: true, | |
38 | + scaleColors: ['#dfdfdd'], | |
39 | + //values: sample_data | |
40 | + onRegionClick: function (event, code) { | |
41 | + var map = $('#map').vectorMap('get', 'mapObject'); | |
42 | + var name = map.getRegionName(code); | |
43 | + getRegionPap(name); | |
44 | + }, | |
45 | + normalizeFunction: 'polynomial' | |
24 | 46 | }); |
25 | 47 | |
26 | 48 | }); |
27 | 49 | }) |
28 | 50 | |
51 | + function getRegionPap(code){ | |
52 | + $scope.showLoader = true; | |
53 | + analyticsService.getRPP(code).then(function(result) { | |
54 | + $scope.rppData = result; | |
55 | + $scope.showLoader = false; | |
56 | + $('#popup1').css('display', 'block'); | |
57 | + | |
58 | + }) | |
59 | + | |
60 | + } | |
61 | + $scope.cancelStatus = function() { | |
62 | + $('#popup1').css('display', 'none'); | |
63 | + | |
64 | + } | |
65 | + | |
29 | 66 | |
30 | 67 | $scope.drf = {}; |
31 | 68 | $scope.hfp = {}; |
... | ... | @@ -297,7 +334,7 @@ |
297 | 334 | $scope.getCS = function(){ |
298 | 335 | //var makeId = makeId; |
299 | 336 | analyticsService.getCS().then(function(result) { |
300 | - console.log("==cs values==",result) | |
337 | + //console.log("==cs values==",result) | |
301 | 338 | $scope.csValues = result; |
302 | 339 | //console.log("cs data kd --- ",$scope.csValues) |
303 | 340 | $scope.optionscs = { |
... | ... | @@ -502,9 +539,6 @@ |
502 | 539 | |
503 | 540 | /*Date Range Filter for Customer Sources*/ |
504 | 541 | $scope.submitDateCs = function(){ |
505 | - console.log("==fromdate===",$scope.cs.fromDate) | |
506 | - console.log("====todate=====",$scope.cs.toDate) | |
507 | - | |
508 | 542 | if ($scope.cs.fromDate === undefined) { |
509 | 543 | |
510 | 544 | $scope.fillForm = true; | ... | ... |
app/partials/analytics/analytics.html
... | ... | @@ -150,6 +150,36 @@ |
150 | 150 | </div> |
151 | 151 | </div> |
152 | 152 | <!-- /container --> |
153 | - </div> | |
153 | + </div> | |
154 | 154 | <!-- /main --> |
155 | + <div class="customConfirmPopBackdrop" id="popup1"> | |
156 | + <div class="customModalInner" style="max-width: 400px;"> | |
157 | + <div class="customModelBody" style="border-radius: 5px 5px 0 0;max-height: 200px;overflow: hidden;overflow-y: auto;""> | |
158 | + <table border="1"> | |
159 | + | |
160 | + <tr> | |
161 | + <th style="padding: 5px">Average PAP</th> | |
162 | + <th style="padding: 5px">Region</th> | |
163 | + </tr> | |
164 | + <tr ng-repeat="data in rppData"> | |
165 | + <td data-title="'Average PAP'" style="padding: 5px"> | |
166 | + <!-- <img src="img/info.png" style="width: 50px;"> --> | |
167 | + {{data.averagePAP | number :4 }} | |
168 | + </td> | |
169 | + <td data-title="'Region'" style="padding: 5px"> | |
170 | + {{data.region}} | |
171 | + </td> | |
172 | + </tr> | |
173 | + </table> | |
174 | + </div> | |
175 | + <div class="customModelFooter text-right" style="border-top: 0px !important"> | |
176 | + <!-- <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="companyStatus()">Accept</button> --> | |
177 | + <button class="btn btn-primary" style="padding: 4px 0; width: 80px;" ng-click="cancelStatus()">Close</button> | |
178 | + </div> | |
179 | + </div> | |
180 | + </div> | |
181 | + <div class="myLoader" ng-show="showLoader"> | |
182 | + <img src="../img/hourglass.gif" width="50px;"> | |
183 | + </div> | |
184 | + | |
155 | 185 | ... | ... |
app/partials/analytics/analytics.service.js
... | ... | @@ -40,6 +40,22 @@ |
40 | 40 | return deferred.promise; |
41 | 41 | } |
42 | 42 | |
43 | + this.getRPP = function(code){ | |
44 | + var deferred = $q.defer(); | |
45 | + $http({ | |
46 | + method : 'GET', | |
47 | + url : BASE_URL.url +'/fuelerlinx/getAircrafts/'+code | |
48 | + }) | |
49 | + .then(function (result){ | |
50 | + deferred.resolve(result.data); | |
51 | + },function (result){ | |
52 | + console.log(result) | |
53 | + deferred.resolve(result.data); | |
54 | + }) | |
55 | + return deferred.promise; | |
56 | + } | |
57 | + | |
58 | + | |
43 | 59 | /*---date filter for Monthly fuel sales chart - dates are sending to the api */ |
44 | 60 | this.getDRFChart = function(fd,td){ |
45 | 61 | var deferred = $q.defer(); | ... | ... |