Commit b8a8a3e2be0433dae26acd1edc896e1e90f1f380
1 parent
952112f4
update
Showing
6 changed files
with
243 additions
and
55 deletions
src/main/resources/static/pages/scheduleApp/module/core/busConfig/list.html
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/edit.html
0 → 100644
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/employeeConfig.js
| 1 | // 人员配置管理 service controller 等写在一起 | 1 | // 人员配置管理 service controller 等写在一起 |
| 2 | 2 | ||
| 3 | -angular.module('ScheduleApp').factory('EmployeeConfigService', ['$resource', function($resource) { | ||
| 4 | - // TODO:测试 | ||
| 5 | - return $resource( | ||
| 6 | - '/cci', | ||
| 7 | - {}, | ||
| 8 | - { | ||
| 9 | - list: { | ||
| 10 | - method: 'GET' | 3 | +angular.module('ScheduleApp').factory('EmployeeConfigService', ['EmployeeConfigService_g', function(service) { |
| 4 | + /** 当前的查询条件信息 */ | ||
| 5 | + var currentSearchCondition = {}; | ||
| 6 | + | ||
| 7 | + /** 当前第几页 */ | ||
| 8 | + var currentPageNo = 1; | ||
| 9 | + | ||
| 10 | + return { | ||
| 11 | + /** | ||
| 12 | + * 获取查询条件信息, | ||
| 13 | + * 用于给controller用来和页面数据绑定。 | ||
| 14 | + */ | ||
| 15 | + getSearchCondition: function() { | ||
| 16 | + return currentSearchCondition; | ||
| 17 | + }, | ||
| 18 | + /** | ||
| 19 | + * 重置查询条件信息。 | ||
| 20 | + */ | ||
| 21 | + resetSearchCondition: function() { | ||
| 22 | + var key; | ||
| 23 | + for (key in currentSearchCondition) { | ||
| 24 | + currentSearchCondition[key] = ""; | ||
| 11 | } | 25 | } |
| 26 | + }, | ||
| 27 | + /** | ||
| 28 | + * 设置当前页码。 | ||
| 29 | + * @param cpn 从1开始,后台是从0开始的 | ||
| 30 | + */ | ||
| 31 | + setCurrentPageNo: function(cpn) { | ||
| 32 | + currentPageNo = cpn; | ||
| 33 | + }, | ||
| 34 | + /** | ||
| 35 | + * 组装查询参数,返回一个promise查询结果。 | ||
| 36 | + * @param params 查询参数 | ||
| 37 | + * @return 返回一个 promise | ||
| 38 | + */ | ||
| 39 | + getPage: function() { | ||
| 40 | + var params = currentSearchCondition; // 查询条件 | ||
| 41 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | ||
| 42 | + return service.list(params).$promise; | ||
| 43 | + }, | ||
| 44 | + /** | ||
| 45 | + * 获取明细信息。 | ||
| 46 | + * @param id 车辆id | ||
| 47 | + * @return 返回一个 promise | ||
| 48 | + */ | ||
| 49 | + getDetail: function(id) { | ||
| 50 | + var params = {id: id}; | ||
| 51 | + return service.get(params).$promise; | ||
| 52 | + }, | ||
| 53 | + /** | ||
| 54 | + * 保存信息。 | ||
| 55 | + * @param obj 车辆详细信息 | ||
| 56 | + * @return 返回一个 promise | ||
| 57 | + */ | ||
| 58 | + saveDetail: function(obj) { | ||
| 59 | + return service.save(obj).$promise; | ||
| 12 | } | 60 | } |
| 13 | - ); | 61 | + }; |
| 14 | }]); | 62 | }]); |
| 15 | 63 | ||
| 16 | -angular.module('ScheduleApp').controller('EmployeeConfigCtrl', ['EmployeeConfigService', function(employeeConfigService) { | 64 | +angular.module('ScheduleApp').controller('EmployeeConfigCtrl', ['EmployeeConfigService', '$state', function(employeeConfigService, $state) { |
| 65 | + var self = this; | ||
| 17 | 66 | ||
| 67 | + // 切换到form状态 | ||
| 68 | + self.goForm = function() { | ||
| 69 | + //alert("切换"); | ||
| 70 | + $state.go("employeeConfig_form"); | ||
| 71 | + } | ||
| 18 | }]); | 72 | }]); |
| 19 | 73 | ||
| 20 | angular.module('ScheduleApp').controller('EmployeeConfigListCtrl', ['EmployeeConfigService', function(employeeConfigService) { | 74 | angular.module('ScheduleApp').controller('EmployeeConfigListCtrl', ['EmployeeConfigService', function(employeeConfigService) { |
| 21 | - // TODO:模拟数据 | ||
| 22 | var self = this; | 75 | var self = this; |
| 23 | - self.totalItems = 64; | ||
| 24 | - self.currentPage = 4; | ||
| 25 | - self.infos = {}; | ||
| 26 | - self.pageChanaged = function() { | ||
| 27 | - console.log("页面跳转到:" + currentPage.currentPage); | ||
| 28 | - } | ||
| 29 | -}]); | 76 | + self.pageInfo = { |
| 77 | + totalItems : 0, | ||
| 78 | + currentPage : 1, | ||
| 79 | + infos: [] | ||
| 80 | + }; | ||
| 81 | + | ||
| 82 | + // 初始创建的时候,获取一次列表数据 | ||
| 83 | + employeeConfigService.getPage().then( | ||
| 84 | + function(result) { | ||
| 85 | + self.pageInfo.totalItems = result.totalElements; | ||
| 86 | + self.pageInfo.currentPage = result.number + 1; | ||
| 87 | + self.pageInfo.infos = result.content; | ||
| 88 | + employeeConfigService.setCurrentPageNo(result.number + 1); | ||
| 89 | + }, | ||
| 90 | + function(result) { | ||
| 91 | + alert("出错啦!"); | ||
| 92 | + } | ||
| 93 | + ); | ||
| 30 | 94 | ||
| 31 | -angular.module('ScheduleApp').controller('EmployeeConfigFormCtrl', ['EmployeeConfigService', function(employeeConfigService) { | 95 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { |
| 96 | + // alert("dfdfdf"); | ||
| 97 | + //}); | ||
| 32 | 98 | ||
| 99 | + // 翻页的时候调用 | ||
| 100 | + self.pageChanaged = function() { | ||
| 101 | + employeeConfigService.setCurrentPageNo(self.pageInfo.currentPage); | ||
| 102 | + employeeConfigService.getPage().then( | ||
| 103 | + function(result) { | ||
| 104 | + self.pageInfo.totalItems = result.totalElements; | ||
| 105 | + self.pageInfo.currentPage = result.number + 1; | ||
| 106 | + self.pageInfo.infos = result.content; | ||
| 107 | + employeeConfigService.setCurrentPageNo(result.number + 1); | ||
| 108 | + }, | ||
| 109 | + function(result) { | ||
| 110 | + alert("出错啦!"); | ||
| 111 | + } | ||
| 112 | + ); | ||
| 113 | + }; | ||
| 114 | + // 获取查询条件数据 | ||
| 115 | + self.searchCondition = function() { | ||
| 116 | + return employeeConfigService.getSearchCondition(); | ||
| 117 | + }; | ||
| 118 | + // 重置查询条件 | ||
| 119 | + self.resetSearchCondition = function() { | ||
| 120 | + return employeeConfigService.resetSearchCondition(); | ||
| 121 | + }; | ||
| 33 | }]); | 122 | }]); |
| 34 | 123 | ||
| 35 | -angular.module('ScheduleApp').controller('EmployeeConfigDetailCtrl', ['EmployeeConfigService', function(employeeConfigService) { | 124 | +angular.module('ScheduleApp').controller('EmployeeConfigFormCtrl', ['EmployeeConfigService', '$stateParams', '$state', function(employeeConfigService, $stateParams, $state) { |
| 125 | + // TODO: | ||
| 126 | +}]); | ||
| 36 | 127 | ||
| 128 | +angular.module('ScheduleApp').controller('EmployeeConfigDetailCtrl', ['EmployeeConfigService', '$stateParams', function(employeeConfigService, $stateParams) { | ||
| 129 | + // TODO: | ||
| 37 | }]); | 130 | }]); |
| 38 | 131 |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/index.html
| 1 | <div class="page-head"> | 1 | <div class="page-head"> |
| 2 | <div class="page-title"> | 2 | <div class="page-title"> |
| 3 | - <h1>人员配置</h1> | 3 | + <h1>人员配置管理</h1> |
| 4 | </div> | 4 | </div> |
| 5 | </div> | 5 | </div> |
| 6 | 6 | ||
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | <i class="fa fa-circle"></i> | 14 | <i class="fa fa-circle"></i> |
| 15 | </li> | 15 | </li> |
| 16 | <li> | 16 | <li> |
| 17 | - <span class="active">人员配置</span> | 17 | + <span class="active">人员配置管理</span> |
| 18 | </li> | 18 | </li> |
| 19 | </ul> | 19 | </ul> |
| 20 | 20 | ||
| @@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
| 27 | <span class="caption-subject bold uppercase">配置表</span> | 27 | <span class="caption-subject bold uppercase">配置表</span> |
| 28 | </div> | 28 | </div> |
| 29 | <div class="actions"> | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue"> | 30 | + <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> |
| 31 | <i class="fa fa-plus"></i> | 31 | <i class="fa fa-plus"></i> |
| 32 | 添加配置 | 32 | 添加配置 |
| 33 | </a> | 33 | </a> |
| @@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
| 58 | </div> | 58 | </div> |
| 59 | 59 | ||
| 60 | <div class="portlet-body"> | 60 | <div class="portlet-body"> |
| 61 | - <div ui-view="list"></div> | 61 | + <div ui-view="employeeConfig_list"></div> |
| 62 | </div> | 62 | </div> |
| 63 | </div> | 63 | </div> |
| 64 | </div> | 64 | </div> |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/list.html
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <div ng-controller="EmployeeConfigListCtrl as ctrl"> | 2 | <div ng-controller="EmployeeConfigListCtrl as ctrl"> |
| 3 | <table class="table table-striped table-bordered table-hover table-checkable order-column"> | 3 | <table class="table table-striped table-bordered table-hover table-checkable order-column"> |
| 4 | <thead> | 4 | <thead> |
| 5 | - <tr> | 5 | + <tr role="row" class="heading"> |
| 6 | <th> | 6 | <th> |
| 7 | <input type="checkbox" class="group-checkable"/> | 7 | <input type="checkbox" class="group-checkable"/> |
| 8 | </th> | 8 | </th> |
| @@ -13,17 +13,37 @@ | @@ -13,17 +13,37 @@ | ||
| 13 | <th>驾驶员</th> | 13 | <th>驾驶员</th> |
| 14 | <th>售票员工号</th> | 14 | <th>售票员工号</th> |
| 15 | <th>售票员</th> | 15 | <th>售票员</th> |
| 16 | - <th>车辆内部编号</th> | ||
| 17 | - <th>操作</th> | 16 | + <th width="14%">操作</th> |
| 18 | </tr> | 17 | </tr> |
| 18 | + <tr role="row" class="filter"> | ||
| 19 | + <td></td> | ||
| 20 | + <td></td> | ||
| 21 | + <td></td> | ||
| 22 | + <td></td> | ||
| 23 | + <td></td> | ||
| 24 | + <td></td> | ||
| 25 | + <td></td> | ||
| 26 | + <td></td> | ||
| 27 | + <td> | ||
| 28 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" | ||
| 29 | + ng-click="ctrl.pageChanaged()"> | ||
| 30 | + <i class="fa fa-search"></i> 搜索</button> | ||
| 31 | + | ||
| 32 | + <button class="btn btn-sm red btn-outline filter-cancel" | ||
| 33 | + ng-click="ctrl.resetSearchCondition()"> | ||
| 34 | + <i class="fa fa-times"></i> 重置</button> | ||
| 35 | + </td> | ||
| 36 | + | ||
| 37 | + </tr> | ||
| 38 | + | ||
| 19 | </thead> | 39 | </thead> |
| 20 | <tbody> | 40 | <tbody> |
| 21 | - <tr ng-repeat="info in ctrl.infos" class="odd gradeX"> | 41 | + <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> |
| 22 | <td> | 42 | <td> |
| 23 | <input type="checkbox"/> | 43 | <input type="checkbox"/> |
| 24 | </td> | 44 | </td> |
| 25 | <td> | 45 | <td> |
| 26 | - <span>TODO</span> | 46 | + <span ng-bind="$index + 1"></span> |
| 27 | </td> | 47 | </td> |
| 28 | <td> | 48 | <td> |
| 29 | <span ng-bind="info.xl.name"></span> | 49 | <span ng-bind="info.xl.name"></span> |
| @@ -44,21 +64,26 @@ | @@ -44,21 +64,26 @@ | ||
| 44 | <span ng-bind="info.spy.personnelName"></span> | 64 | <span ng-bind="info.spy.personnelName"></span> |
| 45 | </td> | 65 | </td> |
| 46 | <td> | 66 | <td> |
| 47 | - <span ng-bind="info.cl.insideCode"></span> | ||
| 48 | - </td> | ||
| 49 | - <td> | ||
| 50 | - <span>TODO</span> | 67 | + <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> |
| 68 | + <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> | ||
| 69 | + <a ui-sref="employeeConfig_detail({id: info.id})" class="btn default blue-stripe btn-sm"> 详细 </a> | ||
| 70 | + <a ui-sref="employeeConfig_edit({id: info.id})" class="btn default blue-stripe btn-sm"> 修改 </a> | ||
| 51 | </td> | 71 | </td> |
| 52 | </tr> | 72 | </tr> |
| 53 | </tbody> | 73 | </tbody> |
| 54 | </table> | 74 | </table> |
| 55 | 75 | ||
| 56 | <div style="text-align: right;"> | 76 | <div style="text-align: right;"> |
| 57 | - <uib-pagination total-items="ctrl.totalItems" | ||
| 58 | - ng-model="ctrl.currentPage" | ||
| 59 | - ng-change="ctrl.pageChanged()" | 77 | + <uib-pagination total-items="ctrl.pageInfo.totalItems" |
| 78 | + ng-model="ctrl.pageInfo.currentPage" | ||
| 79 | + ng-change="ctrl.pageChanaged()" | ||
| 80 | + rotate="false" | ||
| 81 | + max-size="10" | ||
| 82 | + boundary-links="true" | ||
| 83 | + first-text="首页" | ||
| 60 | previous-text="上一页" | 84 | previous-text="上一页" |
| 61 | - next-text="下一页"> | 85 | + next-text="下一页" |
| 86 | + last-text="尾页"> | ||
| 62 | </uib-pagination> | 87 | </uib-pagination> |
| 63 | </div> | 88 | </div> |
| 64 | </div> | 89 | </div> |
| 65 | \ No newline at end of file | 90 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/main.js
| @@ -364,21 +364,6 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | @@ -364,21 +364,6 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | ||
| 364 | } | 364 | } |
| 365 | }) | 365 | }) |
| 366 | 366 | ||
| 367 | - | ||
| 368 | - | ||
| 369 | - | ||
| 370 | - | ||
| 371 | - | ||
| 372 | - | ||
| 373 | - | ||
| 374 | - | ||
| 375 | - | ||
| 376 | - | ||
| 377 | - | ||
| 378 | - | ||
| 379 | - | ||
| 380 | - | ||
| 381 | - | ||
| 382 | // 人员配置模块 | 367 | // 人员配置模块 |
| 383 | .state("employeeConfig", { | 368 | .state("employeeConfig", { |
| 384 | url: '/employeeConfig', | 369 | url: '/employeeConfig', |
| @@ -386,7 +371,7 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | @@ -386,7 +371,7 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | ||
| 386 | "": { | 371 | "": { |
| 387 | templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html' | 372 | templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html' |
| 388 | }, | 373 | }, |
| 389 | - "list@employeeConfig": { | 374 | + "employeeConfig_list@employeeConfig": { |
| 390 | templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html' | 375 | templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html' |
| 391 | } | 376 | } |
| 392 | }, | 377 | }, |
| @@ -403,6 +388,71 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | @@ -403,6 +388,71 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | ||
| 403 | }] | 388 | }] |
| 404 | } | 389 | } |
| 405 | }) | 390 | }) |
| 391 | + .state("employeeConfig_form", { | ||
| 392 | + url: '/employeeConfig_form', | ||
| 393 | + views: { | ||
| 394 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'} | ||
| 395 | + }, | ||
| 396 | + resolve: { | ||
| 397 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 398 | + return $ocLazyLoad.load({ | ||
| 399 | + name: 'employeeConfig_form_module', | ||
| 400 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 401 | + files: [ | ||
| 402 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 403 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 404 | + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js" | ||
| 405 | + ] | ||
| 406 | + }); | ||
| 407 | + }] | ||
| 408 | + } | ||
| 409 | + }) | ||
| 410 | + .state("employeeConfig_edit", { | ||
| 411 | + url: '/employeeConfig_edit/:id', | ||
| 412 | + views: { | ||
| 413 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'} | ||
| 414 | + }, | ||
| 415 | + resolve: { | ||
| 416 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 417 | + return $ocLazyLoad.load({ | ||
| 418 | + name: 'employeeConfig_edit_module', | ||
| 419 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 420 | + files: [ | ||
| 421 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | ||
| 422 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | ||
| 423 | + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js" | ||
| 424 | + ] | ||
| 425 | + }); | ||
| 426 | + }] | ||
| 427 | + } | ||
| 428 | + }) | ||
| 429 | + .state("employeeConfig_detail", { | ||
| 430 | + url: '/employeeConfig_detail/:id', | ||
| 431 | + views: { | ||
| 432 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'} | ||
| 433 | + }, | ||
| 434 | + resolve: { | ||
| 435 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | ||
| 436 | + return $ocLazyLoad.load({ | ||
| 437 | + name: 'employeeConfig_detail_module', | ||
| 438 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | ||
| 439 | + files: [ | ||
| 440 | + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js" | ||
| 441 | + ] | ||
| 442 | + }); | ||
| 443 | + }] | ||
| 444 | + } | ||
| 445 | + }) | ||
| 446 | + | ||
| 447 | + | ||
| 448 | + | ||
| 449 | + | ||
| 450 | + | ||
| 451 | + | ||
| 452 | + | ||
| 453 | + | ||
| 454 | + | ||
| 455 | + | ||
| 406 | // 路牌管理模块 | 456 | // 路牌管理模块 |
| 407 | .state("guideboardManage", { | 457 | .state("guideboardManage", { |
| 408 | url: '/guideboardManage', | 458 | url: '/guideboardManage', |
| @@ -518,7 +568,27 @@ angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', functi | @@ -518,7 +568,27 @@ angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', functi | ||
| 518 | ); | 568 | ); |
| 519 | }]); | 569 | }]); |
| 520 | 570 | ||
| 521 | - | 571 | +// 人员配置service |
| 572 | +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) { | ||
| 573 | + return $resource( | ||
| 574 | + '/eci/:id', | ||
| 575 | + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询 | ||
| 576 | + { | ||
| 577 | + list: { | ||
| 578 | + method: 'GET', | ||
| 579 | + params: { | ||
| 580 | + page: 0 | ||
| 581 | + } | ||
| 582 | + }, | ||
| 583 | + get: { | ||
| 584 | + method: 'GET' | ||
| 585 | + }, | ||
| 586 | + save: { | ||
| 587 | + method: 'POST' | ||
| 588 | + } | ||
| 589 | + } | ||
| 590 | + ); | ||
| 591 | +}]); | ||
| 522 | 592 | ||
| 523 | 593 | ||
| 524 | 594 |