competitionStore.js
2.95 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
(function(angular) {
function competitionStore($scope, aiNicheService, Utils) {
$scope.displayTable = true;
$scope.timePicked = '';
$scope.timePick = function (timePicked) {
this.timePicked = timePicked;
};
// 这边定义一个 init 方法
$scope.umcInstance = {
init: function () {
//$scope.umcInstance.setMapStyle();
$scope.umcInstance.setMapFeatures();
var shopPoint,info;
//点
aiNicheService.getLngLatShop(function (response) {
if(response.data && response.data.lngLatShop != null){
shopPoint = response.data.lngLatShop;
info = response.data.store_name;
$scope.umcInstance.residenceCircle(shopPoint,info);
}
});
getCarPermanentInfoWay();
$scope.tableSearch = function(){
$scope.umcInstance.clearMarker();
getCarPermanentInfoWay();
};
}
};
//常驻地标点
var LngLat = {};
var getCarPermanentInfoWay = function () {
$scope.carPermanentInfo = [];
var params = getParams();
//清空之前的点,初始化
LngLat = {};
aiNicheService.getCarPermanentInfo(params,function(response) {
$scope.carPermanentInfo = response.data;
// angular.forEach(response.data,function (item) {
// LngLat.push(item.location);
// LngLat.push(item.id);
// LngLat.push(item.name);
// });
LngLat = response.data;
$scope.umcInstance.residenceMarkers(LngLat);
});
};
function getParams() {
var obj = {};
if($scope.timePicked==4){
obj.minDistance = 0;
obj.maxDistance = 5;
}
if($scope.timePicked==3){
obj.minDistance = 5;
obj.maxDistance = 10;
}
if($scope.timePicked==2){
obj.minDistance = 10;
obj.maxDistance = 20;
}
if($scope.timePicked==1){
obj.minDistance = 20;
obj.maxDistance = 300;
}
return obj;
}
$scope.exportExcel = function () {
if ($scope.isExporting) return;
var params = getParams();
var options = {
url: "carPermanent/exportCarPermanent"
};
Utils.exportExcel(options, params, function () {
$scope.$apply(function () {
$scope.isExporting = false
})
});
};
}
angular.module('AIniche', ['map']).controller('competitionStore', competitionStore)
})(angular);