Commit c7f17b4f32db8100f66276c375ae9e3d0159edc0
1 parent
053547e4
Update
Showing
10 changed files
with
241 additions
and
181 deletions
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -486,12 +486,20 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso |
| 486 | 486 | return { |
| 487 | 487 | rest : $resource( |
| 488 | 488 | '/spic/:id', |
| 489 | - {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id_route'}, | |
| 489 | + {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id'}, | |
| 490 | 490 | { |
| 491 | 491 | list: { |
| 492 | 492 | method: 'GET', |
| 493 | 493 | params: { |
| 494 | 494 | page: 0 |
| 495 | + }, | |
| 496 | + transformResponse: function(rs) { | |
| 497 | + var dst = angular.fromJson(rs); | |
| 498 | + if (dst.status == 'SUCCESS') { | |
| 499 | + return dst.data; | |
| 500 | + } else { | |
| 501 | + return dst; // 业务错误留给控制器处理 | |
| 502 | + } | |
| 495 | 503 | } |
| 496 | 504 | }, |
| 497 | 505 | get: { | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| ... | ... | @@ -895,9 +895,25 @@ ScheduleApp.config([ |
| 895 | 895 | }] |
| 896 | 896 | } |
| 897 | 897 | }) |
| 898 | - | |
| 899 | - | |
| 900 | - ; | |
| 898 | + .state("schedulePlanInfoExtFormManage_edit", { // 修改套跑form | |
| 899 | + url: '/schedulePlanInfoExtFormManage_edit/:xlId/:xlName/:sd/:lpId/:lpName', | |
| 900 | + views: { | |
| 901 | + "": {templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html'} | |
| 902 | + }, | |
| 903 | + resolve: { | |
| 904 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 905 | + return $ocLazyLoad.load({ | |
| 906 | + name: 'rerunManage_edit_module', | |
| 907 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 908 | + files: [ | |
| 909 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 910 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 911 | + "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js" | |
| 912 | + ] | |
| 913 | + }); | |
| 914 | + }] | |
| 915 | + } | |
| 916 | + }); | |
| 901 | 917 | |
| 902 | 918 | } |
| 903 | 919 | ]); | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
| ... | ... | @@ -56,7 +56,7 @@ |
| 56 | 56 | </tr> |
| 57 | 57 | </thead> |
| 58 | 58 | <tbody> |
| 59 | - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> | |
| 59 | + <tr ng-repeat="info in ctrl.page()['content']" class="odd gradeX"> | |
| 60 | 60 | <td> |
| 61 | 61 | <span ng-bind="$index + 1"></span> |
| 62 | 62 | </td> |
| ... | ... | @@ -139,9 +139,9 @@ |
| 139 | 139 | </div> |
| 140 | 140 | |
| 141 | 141 | <div style="text-align: right;"> |
| 142 | - <uib-pagination total-items="ctrl.pageInfo.totalItems" | |
| 143 | - ng-model="ctrl.pageInfo.currentPage" | |
| 144 | - ng-change="ctrl.pageChanaged()" | |
| 142 | + <uib-pagination total-items="ctrl.page()['totalElements']" | |
| 143 | + ng-model="ctrl.page()['uiNumber']" | |
| 144 | + ng-change="ctrl.doPage()" | |
| 145 | 145 | rotate="false" |
| 146 | 146 | max-size="10" |
| 147 | 147 | boundary-links="true" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/module.js
| 1 | 1 | // 车辆配置管理 service controller 等写在一起 |
| 2 | -angular.module('ScheduleApp').factory('SchedulePlanInfoManageService', ['SchedulePlanInfoManageService_g', function(service) { | |
| 3 | - /** 当前的查询条件信息 */ | |
| 4 | - var currentSearchCondition = {}; | |
| 5 | - | |
| 6 | - /** 当前第几页 */ | |
| 7 | - var currentPageNo = 1; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - /** | |
| 27 | - * 设置当前页码。 | |
| 28 | - * @param cpn 从1开始,后台是从0开始的 | |
| 29 | - */ | |
| 30 | - setCurrentPageNo: function(cpn) { | |
| 31 | - currentPageNo = cpn; | |
| 32 | - }, | |
| 33 | - /** | |
| 34 | - * 组装查询参数,返回一个promise查询结果。 | |
| 35 | - * @param params 查询参数 | |
| 36 | - * @return 返回一个 promise | |
| 37 | - */ | |
| 38 | - getPage: function(spid) { | |
| 39 | - var params = currentSearchCondition; // 查询条件 | |
| 40 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | - params["schedulePlan.id_eq"] = spid; // 排班id | |
| 42 | - return service.rest.list(params).$promise; | |
| 43 | - } | |
| 2 | +angular.module('ScheduleApp').factory( | |
| 3 | + 'SchedulePlanInfoManageService', | |
| 4 | + [ | |
| 5 | + 'SchedulePlanInfoManageService_g', | |
| 6 | + function(service) { | |
| 7 | + /** 当前的查询条件信息 */ | |
| 8 | + var currentSearchCondition = {}; | |
| 9 | + | |
| 10 | + // 当前查询返回的信息 | |
| 11 | + var currentPage = { // 后台spring data返回的格式 | |
| 12 | + totalElements: 0, | |
| 13 | + number: 0, // 后台返回的页码,spring返回从0开始 | |
| 14 | + content: [], | |
| 15 | + | |
| 16 | + uiNumber: 1 // 页面绑定的页码 | |
| 17 | + }; | |
| 18 | + | |
| 19 | + // 查询对象 | |
| 20 | + var queryClass = service.rest; | |
| 21 | + | |
| 22 | + return { | |
| 23 | + getQueryClass: function() { | |
| 24 | + return queryClass; | |
| 25 | + }, | |
| 26 | + getSearchCondition: function() { | |
| 27 | + currentSearchCondition.page = currentPage.uiNumber - 1; | |
| 28 | + return currentSearchCondition; | |
| 29 | + }, | |
| 30 | + getPage: function(page) { | |
| 31 | + if (page) { | |
| 32 | + currentPage.totalElements = page.totalElements; | |
| 33 | + currentPage.number = page.number; | |
| 34 | + currentPage.content = page.content; | |
| 35 | + } | |
| 36 | + return currentPage; | |
| 37 | + } | |
| 38 | + }; | |
| 44 | 39 | |
| 45 | - }; | |
| 46 | - | |
| 47 | -}]); | |
| 48 | - | |
| 49 | -angular.module('ScheduleApp').controller('SchedulePlanInfoManageCtrl', ['SchedulePlanInfoManageService', '$state', '$stateParams', '$scope', function(schedulePlanInfoManageService, $state, $stateParams, $scope) { | |
| 50 | - var self = this; | |
| 51 | - var spid = $stateParams.spid; // 排班规则id | |
| 52 | - var xlname = $stateParams.xlname; // 线路名字 | |
| 53 | - var ttname = $stateParams.ttname; // 时刻表名字 | |
| 54 | - var stime = $stateParams.stime; // 开始时间 | |
| 55 | - var etime = $stateParams.etime; // 结束时间 | |
| 56 | - | |
| 57 | - $scope.spid = spid; | |
| 58 | - $scope.xlname = xlname; | |
| 59 | - $scope.ttname = ttname; | |
| 60 | - $scope.stime = stime; | |
| 61 | - $scope.etime = etime; | |
| 62 | - | |
| 63 | - // 切换到form状态 | |
| 64 | - self.goForm = function() { | |
| 65 | - alert("等待生成"); | |
| 66 | - | |
| 67 | - } | |
| 68 | -}]); | |
| 69 | - | |
| 70 | -angular.module('ScheduleApp').controller('SchedulePlanInfoManageListCtrl', ['SchedulePlanInfoManageService', '$scope', function(schedulePlanInfoManageService, $scope) { | |
| 71 | - var self = this; | |
| 72 | - self.pageInfo = { | |
| 73 | - totalItems : 0, | |
| 74 | - currentPage : 1, | |
| 75 | - infos: [] | |
| 76 | - }; | |
| 77 | - | |
| 78 | - // 日期 日期控件开关 | |
| 79 | - self.scheduleDate = false; | |
| 80 | - self.scheduleDate_open = function() { | |
| 81 | - self.scheduleDate = true; | |
| 82 | - }; | |
| 83 | - | |
| 84 | - var spid = $scope.spid; | |
| 85 | - | |
| 86 | - // 初始创建的时候,获取一次列表数据 | |
| 87 | - schedulePlanInfoManageService.getPage(spid).then( | |
| 88 | - function(result) { | |
| 89 | - self.pageInfo.totalItems = result.totalElements; | |
| 90 | - self.pageInfo.currentPage = result.number + 1; | |
| 91 | - self.pageInfo.infos = result.content; | |
| 92 | - schedulePlanInfoManageService.setCurrentPageNo(result.number + 1); | |
| 93 | - }, | |
| 94 | - function(result) { | |
| 95 | - alert("出错啦!"); | |
| 96 | 40 | } |
| 97 | - ); | |
| 98 | - | |
| 99 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 100 | - // alert("dfdfdf"); | |
| 101 | - //}); | |
| 102 | - | |
| 103 | - // 翻页的时候调用 | |
| 104 | - self.pageChanaged = function() { | |
| 105 | - schedulePlanInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 106 | - schedulePlanInfoManageService.getPage(spid).then( | |
| 107 | - function(result) { | |
| 108 | - self.pageInfo.totalItems = result.totalElements; | |
| 109 | - self.pageInfo.currentPage = result.number + 1; | |
| 110 | - self.pageInfo.infos = result.content; | |
| 111 | - schedulePlanInfoManageService.setCurrentPageNo(result.number + 1); | |
| 112 | - }, | |
| 113 | - function(result) { | |
| 114 | - alert("出错啦!"); | |
| 115 | - } | |
| 116 | - ); | |
| 117 | - }; | |
| 118 | - // 获取查询条件数据 | |
| 119 | - self.searchCondition = function() { | |
| 120 | - return schedulePlanInfoManageService.getSearchCondition(); | |
| 121 | - }; | |
| 122 | - // 重置查询条件 | |
| 123 | - self.resetSearchCondition = function() { | |
| 124 | - return schedulePlanInfoManageService.resetSearchCondition(); | |
| 125 | - }; | |
| 126 | - | |
| 127 | - $scope.$watch( | |
| 128 | - function() { | |
| 129 | - return self.searchCondition()['scheduleDate_eq']; | |
| 130 | - }, | |
| 131 | - function(newValue, oldValue) { | |
| 132 | - if (newValue == undefined && oldValue == undefined) { | |
| 133 | - | |
| 134 | - } else { | |
| 135 | - self.pageChanaged(); | |
| 41 | + ] | |
| 42 | +); | |
| 43 | + | |
| 44 | +// index.html页面 | |
| 45 | +angular.module('ScheduleApp').controller( | |
| 46 | + 'SchedulePlanInfoManageCtrl', | |
| 47 | + [ | |
| 48 | + '$state', | |
| 49 | + '$stateParams', | |
| 50 | + '$scope', | |
| 51 | + function($state, $stateParams, $scope) { | |
| 52 | + var self = this; | |
| 53 | + var spid = $stateParams.spid; // 排班规则id | |
| 54 | + var xlname = $stateParams.xlname; // 线路名字 | |
| 55 | + var ttname = $stateParams.ttname; // 时刻表名字 | |
| 56 | + var stime = $stateParams.stime; // 开始时间 | |
| 57 | + var etime = $stateParams.etime; // 结束时间 | |
| 58 | + | |
| 59 | + $scope.spid = spid; | |
| 60 | + $scope.xlname = xlname; | |
| 61 | + $scope.ttname = ttname; | |
| 62 | + $scope.stime = stime; | |
| 63 | + $scope.etime = etime; | |
| 64 | + | |
| 65 | + // 切换到form状态 | |
| 66 | + self.goForm = function() { | |
| 67 | + alert("等待生成"); | |
| 68 | + | |
| 136 | 69 | } |
| 137 | - }); | |
| 70 | + } | |
| 71 | + | |
| 72 | + ] | |
| 73 | +); | |
| 74 | + | |
| 75 | +// list.html页面 | |
| 76 | +angular.module('ScheduleApp').controller( | |
| 77 | + 'SchedulePlanInfoManageListCtrl', | |
| 78 | + [ | |
| 79 | + 'SchedulePlanInfoManageService', | |
| 80 | + '$scope', | |
| 81 | + function(service, $scope) { | |
| 82 | + var self = this; | |
| 83 | + | |
| 84 | + // 日期 日期控件开关 | |
| 85 | + self.scheduleDate = false; | |
| 86 | + self.scheduleDate_open = function() { | |
| 87 | + self.scheduleDate = true; | |
| 88 | + }; | |
| 89 | + | |
| 90 | + // query类 | |
| 91 | + var SPlanInfo = service.getQueryClass(); | |
| 92 | + | |
| 93 | + var spid = $scope.spid; | |
| 94 | + | |
| 95 | + self.page = function() { | |
| 96 | + return service.getPage(); | |
| 97 | + }; | |
| 98 | + self.searchCondition = function() { | |
| 99 | + return service.getSearchCondition(); | |
| 100 | + }; | |
| 101 | + | |
| 102 | + self.searchCondition()["schedulePlan.id_eq"] = spid; | |
| 103 | + | |
| 104 | + self.doPage = function() { | |
| 105 | + SPlanInfo.list(self.searchCondition(), | |
| 106 | + function(rst) { | |
| 107 | + service.getPage(rst); | |
| 108 | + }, | |
| 109 | + function(err) { | |
| 110 | + console.log(err); | |
| 111 | + } | |
| 112 | + ); | |
| 113 | + }; | |
| 114 | + | |
| 115 | + self.doPage(); | |
| 116 | + | |
| 117 | + $scope.$watch( | |
| 118 | + function() { | |
| 119 | + return self.searchCondition()['scheduleDate_eq']; | |
| 120 | + }, | |
| 121 | + function(newValue, oldValue) { | |
| 122 | + if (newValue == undefined && oldValue == undefined) { | |
| 123 | + | |
| 124 | + } else { | |
| 125 | + self.doPage(); | |
| 126 | + } | |
| 127 | + } | |
| 128 | + ); | |
| 138 | 129 | |
| 139 | -}]); | |
| 130 | + } | |
| 131 | + ] | |
| 132 | +); | |
| 140 | 133 | |
| 141 | 134 | |
| 142 | 135 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
0 → 100644
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | <span ng-bind="$index + 1"></span> |
| 72 | 72 | </td> |
| 73 | 73 | <td> |
| 74 | - <a ui-sref="" class="btn btn-info btn-sm" > 修改 </a> | |
| 74 | + <a ui-sref="schedulePlanInfoExtFormManage_edit({xlId: info.xlId, xlName: info.xlName, sd: info.scheduleDate, lpId: info.lpId, lpName: info.lpName})" class="btn btn-info btn-sm" > 修改 </a> | |
| 75 | 75 | </td> |
| 76 | 76 | <td> |
| 77 | 77 | <span ng-bind="info.xlName"></span> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js
| 1 | 1 | // 调度值勤日报管理 service controller 等写在一起 |
| 2 | 2 | // TODO:使用的global服务需要修正 |
| 3 | -angular.module('ScheduleApp').factory('SchedulePlanReportExtManageService', [ | |
| 4 | - 'SchedulePlanInfoManageService_g', 'SchedulePlanManageService_g', '$q', | |
| 5 | - function(service, service2, $q) { | |
| 6 | - /** 当前的查询条件信息 */ | |
| 7 | - var currentSearchCondition = {}; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - /** | |
| 27 | - * 组装查询参数,返回一个promise查询结果。 | |
| 28 | - * @param params 查询参数 | |
| 29 | - * @return 返回一个 promise | |
| 30 | - */ | |
| 31 | - getPage: function() { | |
| 32 | - var params = currentSearchCondition; // 查询条件 | |
| 33 | - return service.groupInfo_ext.list(params).$promise; | |
| 3 | +angular.module('ScheduleApp').factory( | |
| 4 | + 'SchedulePlanReportExtManageService', | |
| 5 | + [ | |
| 6 | + 'SchedulePlanInfoManageService_g', | |
| 7 | + 'SchedulePlanManageService_g', | |
| 8 | + '$q', | |
| 9 | + function(service, service2, $q) { | |
| 10 | + /** 当前的查询条件信息 */ | |
| 11 | + var currentSearchCondition = {}; | |
| 12 | + | |
| 13 | + // 查询对象 | |
| 14 | + var queryClass = service.rest; | |
| 15 | + | |
| 16 | + return { | |
| 17 | + getQueryClass: function() { | |
| 18 | + return queryClass; | |
| 19 | + }, | |
| 34 | 20 | |
| 35 | - } | |
| 21 | + /** | |
| 22 | + * 获取查询条件信息, | |
| 23 | + * 用于给controller用来和页面数据绑定。 | |
| 24 | + */ | |
| 25 | + getSearchCondition: function() { | |
| 26 | + return currentSearchCondition; | |
| 27 | + }, | |
| 28 | + /** | |
| 29 | + * 重置查询条件信息。 | |
| 30 | + */ | |
| 31 | + resetSearchCondition: function() { | |
| 32 | + var key; | |
| 33 | + for (key in currentSearchCondition) { | |
| 34 | + currentSearchCondition[key] = undefined; | |
| 35 | + } | |
| 36 | + }, | |
| 37 | + /** | |
| 38 | + * 组装查询参数,返回一个promise查询结果。 | |
| 39 | + * @param params 查询参数 | |
| 40 | + * @return 返回一个 promise | |
| 41 | + */ | |
| 42 | + getPage: function() { | |
| 43 | + var params = currentSearchCondition; // 查询条件 | |
| 44 | + return service.groupInfo_ext.list(params).$promise; | |
| 36 | 45 | |
| 37 | - }; | |
| 46 | + } | |
| 47 | + | |
| 48 | + }; | |
| 38 | 49 | |
| 39 | - }]); | |
| 50 | + } | |
| 51 | + ] | |
| 52 | +); | |
| 40 | 53 | |
| 54 | +// index.html页面 | |
| 41 | 55 | angular.module('ScheduleApp').controller( |
| 42 | 56 | 'SchedulePlanReportExtManageCtrl', |
| 43 | 57 | [ |
| ... | ... | @@ -54,6 +68,7 @@ angular.module('ScheduleApp').controller( |
| 54 | 68 | |
| 55 | 69 | ); |
| 56 | 70 | |
| 71 | +// list.html控制器 | |
| 57 | 72 | angular.module('ScheduleApp').controller( |
| 58 | 73 | 'SchedulePlanReportExtManageListCtrl', |
| 59 | 74 | [ | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/route.js
| ... | ... | @@ -34,9 +34,25 @@ ScheduleApp.config([ |
| 34 | 34 | }] |
| 35 | 35 | } |
| 36 | 36 | }) |
| 37 | - | |
| 38 | - | |
| 39 | - ; | |
| 37 | + .state("schedulePlanInfoExtFormManage_edit", { // 修改套跑form | |
| 38 | + url: '/schedulePlanInfoExtFormManage_edit/:xlId/:xlName/:sd/:lpId/:lpName', | |
| 39 | + views: { | |
| 40 | + "": {templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html'} | |
| 41 | + }, | |
| 42 | + resolve: { | |
| 43 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | + return $ocLazyLoad.load({ | |
| 45 | + name: 'rerunManage_edit_module', | |
| 46 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | + files: [ | |
| 48 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | + "pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js" | |
| 51 | + ] | |
| 52 | + }); | |
| 53 | + }] | |
| 54 | + } | |
| 55 | + }); | |
| 40 | 56 | |
| 41 | 57 | } |
| 42 | 58 | ]); |
| 43 | 59 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
| ... | ... | @@ -64,12 +64,20 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso |
| 64 | 64 | return { |
| 65 | 65 | rest : $resource( |
| 66 | 66 | '/spic/:id', |
| 67 | - {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id_route'}, | |
| 67 | + {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id'}, | |
| 68 | 68 | { |
| 69 | 69 | list: { |
| 70 | 70 | method: 'GET', |
| 71 | 71 | params: { |
| 72 | 72 | page: 0 |
| 73 | + }, | |
| 74 | + transformResponse: function(rs) { | |
| 75 | + var dst = angular.fromJson(rs); | |
| 76 | + if (dst.status == 'SUCCESS') { | |
| 77 | + return dst.data; | |
| 78 | + } else { | |
| 79 | + return dst; // 业务错误留给控制器处理 | |
| 80 | + } | |
| 73 | 81 | } |
| 74 | 82 | }, |
| 75 | 83 | get: { | ... | ... |