Commit d1af83ffd12edf9a311c6f7e38228658b5f8f753
1 parent
1c34f2f7
update
Showing
6 changed files
with
82 additions
and
31 deletions
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js
| ... | ... | @@ -183,7 +183,15 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun |
| 183 | 183 | { |
| 184 | 184 | list: { |
| 185 | 185 | method: 'GET', |
| 186 | - isArray: true | |
| 186 | + isArray: true, | |
| 187 | + transformResponse: function(rs) { | |
| 188 | + var dst = angular.fromJson(rs); | |
| 189 | + if (dst.status == 'SUCCESS') { | |
| 190 | + return dst.data; | |
| 191 | + } else { | |
| 192 | + return dst; // 业务错误留给控制器处理 | |
| 193 | + } | |
| 194 | + } | |
| 187 | 195 | } |
| 188 | 196 | } |
| 189 | 197 | ), |
| ... | ... | @@ -253,7 +261,15 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun |
| 253 | 261 | { |
| 254 | 262 | list: { |
| 255 | 263 | method: 'GET', |
| 256 | - isArray: true | |
| 264 | + isArray: true, | |
| 265 | + transformResponse: function(rs) { | |
| 266 | + var dst = angular.fromJson(rs); | |
| 267 | + if (dst.status == 'SUCCESS') { | |
| 268 | + return dst.data; | |
| 269 | + } else { | |
| 270 | + return dst; // 业务错误留给控制器处理 | |
| 271 | + } | |
| 272 | + } | |
| 257 | 273 | } |
| 258 | 274 | } |
| 259 | 275 | ), | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -334,17 +334,33 @@ angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', |
| 334 | 334 | angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) { |
| 335 | 335 | return { |
| 336 | 336 | rest: $resource( |
| 337 | - 'rms/:id', | |
| 338 | - {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id_route'}, | |
| 337 | + '/rms/:id', | |
| 338 | + {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id'}, | |
| 339 | 339 | { |
| 340 | 340 | list: { |
| 341 | 341 | method: 'GET', |
| 342 | 342 | params: { |
| 343 | 343 | page: 0 |
| 344 | + }, | |
| 345 | + transformResponse: function(rs) { | |
| 346 | + var dst = angular.fromJson(rs); | |
| 347 | + if (dst.status == 'SUCCESS') { | |
| 348 | + return dst.data; | |
| 349 | + } else { | |
| 350 | + return dst; // 业务错误留给控制器处理 | |
| 351 | + } | |
| 344 | 352 | } |
| 345 | 353 | }, |
| 346 | 354 | get: { |
| 347 | - method: 'GET' | |
| 355 | + method: 'GET', | |
| 356 | + transformResponse: function(rs) { | |
| 357 | + var dst = angular.fromJson(rs); | |
| 358 | + if (dst.status == 'SUCCESS') { | |
| 359 | + return dst.data; | |
| 360 | + } else { | |
| 361 | + return dst; | |
| 362 | + } | |
| 363 | + } | |
| 348 | 364 | }, |
| 349 | 365 | save: { |
| 350 | 366 | method: 'POST' |
| ... | ... | @@ -737,7 +753,15 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun |
| 737 | 753 | { |
| 738 | 754 | list: { |
| 739 | 755 | method: 'GET', |
| 740 | - isArray: true | |
| 756 | + isArray: true, | |
| 757 | + transformResponse: function(rs) { | |
| 758 | + var dst = angular.fromJson(rs); | |
| 759 | + if (dst.status == 'SUCCESS') { | |
| 760 | + return dst.data; | |
| 761 | + } else { | |
| 762 | + return dst; // 业务错误留给控制器处理 | |
| 763 | + } | |
| 764 | + } | |
| 741 | 765 | } |
| 742 | 766 | } |
| 743 | 767 | ), |
| ... | ... | @@ -807,7 +831,15 @@ angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', fun |
| 807 | 831 | { |
| 808 | 832 | list: { |
| 809 | 833 | method: 'GET', |
| 810 | - isArray: true | |
| 834 | + isArray: true, | |
| 835 | + transformResponse: function(rs) { | |
| 836 | + var dst = angular.fromJson(rs); | |
| 837 | + if (dst.status == 'SUCCESS') { | |
| 838 | + return dst.data; | |
| 839 | + } else { | |
| 840 | + return dst; // 业务错误留给控制器处理 | |
| 841 | + } | |
| 842 | + } | |
| 811 | 843 | } |
| 812 | 844 | } |
| 813 | 845 | ), | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/form.html
| ... | ... | @@ -159,7 +159,7 @@ |
| 159 | 159 | cmaps="{'useLp.id' : 'id'}" |
| 160 | 160 | dcname="useLp.id" |
| 161 | 161 | icname="id" |
| 162 | - dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.useXl.id}, atype:'lpInfo2' } | json }}" | |
| 162 | + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': ctrl.rerunManageForSave.useXl.id, 'isCancel_eq': false}, atype:'lpInfo2' } | json }}" | |
| 163 | 163 | dsparamsextra="{'type':'all'}" |
| 164 | 164 | iterobjname="item" |
| 165 | 165 | iterobjexp="'路牌' + item.lpName" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/list.html
| ... | ... | @@ -17,15 +17,18 @@ |
| 17 | 17 | <tr role="row" class="filter"> |
| 18 | 18 | <td></td> |
| 19 | 19 | <td> |
| 20 | - <sa-Select3 model="ctrl.searchCondition()" | |
| 21 | - name="xl" | |
| 22 | - placeholder="请输拼音..." | |
| 23 | - dcvalue="{{ctrl.searchCondition()['rerunXl.id_eq']}}" | |
| 24 | - dcname="rerunXl.id_eq" | |
| 25 | - icname="id" | |
| 26 | - icnames="name" | |
| 27 | - datatype="xl"> | |
| 28 | - </sa-Select3> | |
| 20 | + <sa-Select5 name="xl" | |
| 21 | + model="ctrl.searchCondition()" | |
| 22 | + cmaps="{'rerunXl.lineCode_eq' : 'lineCode'}" | |
| 23 | + dcname="rerunXl.lineCode_eq" | |
| 24 | + icname="lineCode" | |
| 25 | + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}" | |
| 26 | + iterobjname="item" | |
| 27 | + iterobjexp="item.name" | |
| 28 | + searchph="请输拼音..." | |
| 29 | + searchexp="this.name" | |
| 30 | + required > | |
| 31 | + </sa-Select5> | |
| 29 | 32 | </td> |
| 30 | 33 | <td></td> |
| 31 | 34 | <td></td> |
| ... | ... | @@ -35,23 +38,23 @@ |
| 35 | 38 | <td></td> |
| 36 | 39 | <td> |
| 37 | 40 | <label class="checkbox-inline"> |
| 38 | - <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>作废 | |
| 41 | + <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>已作废 | |
| 39 | 42 | </label> |
| 40 | 43 | </td> |
| 41 | 44 | <td> |
| 42 | 45 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" |
| 43 | - ng-click="ctrl.pageChanaged()"> | |
| 46 | + ng-click="ctrl.doPage()"> | |
| 44 | 47 | <i class="fa fa-search"></i> 搜索</button> |
| 45 | 48 | |
| 46 | 49 | <button class="btn btn-sm red btn-outline filter-cancel" |
| 47 | - ng-click="ctrl.resetSearchCondition()"> | |
| 50 | + ng-click="ctrl.reset()"> | |
| 48 | 51 | <i class="fa fa-times"></i> 重置</button> |
| 49 | 52 | </td> |
| 50 | 53 | |
| 51 | 54 | </tr> |
| 52 | 55 | </thead> |
| 53 | 56 | <tbody> |
| 54 | - <tr ng-repeat="info in ctrl.pageInfo.infos" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> | |
| 57 | + <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}"> | |
| 55 | 58 | <td> |
| 56 | 59 | <span ng-bind="$index + 1"></span> |
| 57 | 60 | </td> |
| ... | ... | @@ -96,9 +99,9 @@ |
| 96 | 99 | |
| 97 | 100 | |
| 98 | 101 | <div style="text-align: right;"> |
| 99 | - <uib-pagination total-items="ctrl.pageInfo.totalItems" | |
| 100 | - ng-model="ctrl.pageInfo.currentPage" | |
| 101 | - ng-change="ctrl.pageChanaged()" | |
| 102 | + <uib-pagination total-items="ctrl.page()['totalElements']" | |
| 103 | + ng-model="ctrl.page()['uiNumber']" | |
| 104 | + ng-change="ctrl.doPage()" | |
| 102 | 105 | rotate="false" |
| 103 | 106 | max-size="10" |
| 104 | 107 | boundary-links="true" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/module.js
| ... | ... | @@ -76,7 +76,7 @@ angular.module('ScheduleApp').controller( |
| 76 | 76 | 'RerunManageService', |
| 77 | 77 | function(service) { |
| 78 | 78 | var self = this; |
| 79 | - var Rerun = servier.getQueryClass(); | |
| 79 | + var RM = service.getQueryClass(); | |
| 80 | 80 | |
| 81 | 81 | self.page = function() { |
| 82 | 82 | return service.getPage(); |
| ... | ... | @@ -87,18 +87,18 @@ angular.module('ScheduleApp').controller( |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | 89 | self.doPage = function() { |
| 90 | - var page = Rerun.list(self.searchCondition(), function() { | |
| 90 | + var page = RM.list(self.searchCondition(), function() { | |
| 91 | 91 | service.getPage(page); |
| 92 | 92 | }); |
| 93 | 93 | }; |
| 94 | 94 | self.reset = function() { |
| 95 | 95 | service.resetStatus(); |
| 96 | - var page = Rerun.list(self.searchCondition(), function() { | |
| 96 | + var page = RM.list(self.searchCondition(), function() { | |
| 97 | 97 | service.getPage(page); |
| 98 | 98 | }); |
| 99 | 99 | }; |
| 100 | - self.toggleBusConfig = function(id) { | |
| 101 | - Rerun.delete({id: id}, function(result) { | |
| 100 | + self.toggleRerun = function(id) { | |
| 101 | + RM.delete({id: id}, function(result) { | |
| 102 | 102 | if (result.msg) { // 暂时这样做,之后全局拦截 |
| 103 | 103 | alert("失败:" + result.msg); |
| 104 | 104 | } else { | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/service.js
| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) { |
| 3 | 3 | return { |
| 4 | 4 | rest: $resource( |
| 5 | - 'rms/:id', | |
| 6 | - {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@'}, | |
| 5 | + '/rms/:id', | |
| 6 | + {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id'}, | |
| 7 | 7 | { |
| 8 | 8 | list: { |
| 9 | 9 | method: 'GET', | ... | ... |