advice.js
3.72 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
93
94
95
96
97
98
99
100
101
/**
 * Created by 王冠伦 on 2018/2/26.
 */
(function () {
    "user strict";
    var railwayController = function($scope,$modal,$http,$interval,$filter,dialogService,railwayService){
        $scope.$emit('navShow', 5);
        $scope.vm = {
            pageSize : 10,
            totalCount : 0,
            pageNumber : 1
        }
        /*$scope.names = [
            {name : "上报时间", value : 0},
            {name : "用户", value : 1},
            {name : "车站名", value : 2},
            {name : "事件类型", value : 3}
        ]
        $scope.change = function(){
            var condition = $scope.condition;
            $scope.date = true;
            if (condition.value != 0){
                $scope.date = !$scope.date;
            }
            $scope.content1 = "";
            $scope.content = "";
        }*/
        $scope.searchByCondition = function(){
            if ($scope.vm.createTime != null){
                var createTime = $scope.vm.createTime;
                $scope.vm.createTime = $filter('date')(createTime, 'yyyy-MM-dd');
            }
            $scope.getList();
        }
        $scope.getList = function(){
            railwayService.findEventByCondition($scope.vm).success(function(data){
                if (data.errors == null || data.errors.length > 0) {
                    dialogService.tip(data.errors);
                }else{
                    $scope.eventList = data.result;
                    for(var i =0 ;i< $scope.eventList.length;i++){
                        if ($scope.eventList[i].isHandled != null) {
                            if($scope.eventList[i].isHandled == "1"){
                                $scope.eventList[i].isHandled = "已处理";
                            }else if($scope.eventList[i].isHandled == "0"){
                                $scope.eventList[i].isHandled = "处理中";
                            }
                        }/*
                        if ($scope.eventList[i].type != null) {
                            if($scope.eventList[i].type == "STATION"){
                                $scope.eventList[i].type = "车站事件";
                            }else if($scope.eventList[i].type == "CARRIAGE"){
                                $scope.eventList[i].type = "车厢事件";
                            }else if($scope.eventList[i].type == "GOOD"){
                                $scope.eventList[i].type = "好人好事";
                            }
                        }*/
                    }
                    $scope.vm.totalCount = data.totalCount;
                    $scope.settingShow = 2;
                }
            })
        }
        $scope.getList();
        $scope.openSubmitTimeFrom = function ($event) {
            $event.preventDefault();
            $event.stopPropagation();
            $scope.submitTimeFrom = true;
        };
        //弹出式日历触发函数
        $scope.openFDate = function($event) {
            $event.preventDefault();
            $event.stopPropagation();
            $scope.fromDate = true;
        };
        $scope.openTDate = function($event) {
            $event.preventDefault();
            $event.stopPropagation();
            $scope.toDate = true;
        };
        $scope.startDate = function ($event) {
            $event.preventDefault();
            $event.stopPropagation();
            $scope.startTime = true;
        };
        $scope.endDate = function ($event) {
            $event.preventDefault();
            $event.stopPropagation();
            $scope.endTime = true;
        };
    }
    angular.module("xn.page", ["xn.directive.form"])
        .controller("RailwayController",["$scope","$modal","$http","$interval","$filter","dialogService","RailwayService",railwayController])
})();