user.js 1.46 KB
/**
 * Created by cjl on 2018/4/23.
 */
(function () {
    "user strict";

    var userController = function($scope,$modal,$http,$interval,dialogService,railwayService){
        $scope.$emit('settingShow', 1);
        $scope.vm = {
            totalCount : 0,
            pageNumber : 1,
            pageSize : 10,
            userId : ''
        }
        $scope.getList = function(){
            railwayService.findUserList($scope.vm).success(function(data){
                if (data.errors == null || data.errors.length > 0) {
                    dialogService.tip(data.errors);
                }else{
                    $scope.userList = data.result;
                    /*for(var i =0 ;i< $scope.userList.length;i++){
                        if ($scope.userList[i].laidTime != null) {
                            var time = new Date(Number($scope.userList[i].laidTime));
                            $scope.userList[i].laidTime = time.format("yyyy-MM-dd hh:mm:ss ");
                        }
                    }*/
                    // debugger
                    $scope.vm.totalCount = data.totalCount;
                }
            })
        }
        $scope.getList();

        $scope.doSearch = function(){
            $scope.vm.pageNumber = 1;
            $scope.getList();
        }
    }

    angular.module("xn.page", ["xn.directive.form"])
        .controller("UserController",["$scope","$modal","$http","$interval","dialogService","RailwayService",userController])
})();