historicalData.js
1.77 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
/**
* Created by cjl on 2018/4/23.
*/
(function () {
"user strict";
var railwayController = function($scope,$modal,$http,$interval,dialogService,railwayService){
$scope.settingShow = 1;
$scope.vm = {
totalCount : 0,
pageNumber : 1,
pageSize : 10,
userId : ''
}
$scope.getList = function(){
railwayService.findEscortAttendanceHistory($scope.vm).success(function(data){
if (data.errors == null || data.errors.length > 0) {
dialogService.tip(data.errors);
}else{
$scope.escortAttendanceList = data.result;
for(var i =0 ;i< $scope.escortAttendanceList.length;i++){
if ($scope.escortAttendanceList[i].laidTime != null) {
var time = new Date(Number($scope.escortAttendanceList[i].laidTime));
$scope.escortAttendanceList[i].laidTime = time.format("yyyy-MM-dd hh:mm:ss ");
}
}
// debugger
$scope.vm.totalCount = data.totalCount;
}
})
}
$scope.getList();
// var timer=$interval(function(){
// $scope.getList();
// },10000); //间隔2秒定时执行
// timer.then(function(){ console.log('查询成功')},
// function(){ console.log('查询不成功')});
$scope.doSearch = function(){
$scope.vm.pageNumber = 1;
$scope.getList();
}
}
angular.module("xn.page", ["xn.directive.form"])
.controller("RailwayController",["$scope","$modal","$http","$interval","dialogService","RailwayService",railwayController])
})();