|
@@ -64,7 +64,7 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
|
64
|
64
|
|
65
|
65
|
var mun = $scope.gridOptions.paginationPageSize;
|
66
|
66
|
|
67
|
|
- // $scope.gridOptions.rowTemplate = "<div ng-click=\"lookFunction(row)\" ng-repeat=\"(colRenderIndex, col) in colContainer.renderedColumns track by col.uid\" ui-grid-one-bind-id-grid=\"rowRenderIndex + '-' + col.uid + '-cell'\" class=\"ui-grid-cell\" ng-class=\"{ 'ui-grid-row-header-cell': col.isRowHeader }\" role=\"{{col.isRowHeader ? 'rowheader' : 'gridcell'}}\" ui-grid-cell></div>";
|
|
67
|
+ $scope.gridOptions.rowTemplate = "<div ng-click=\"lookFunction(row)\" ng-repeat=\"(colRenderIndex, col) in colContainer.renderedColumns track by col.uid\" ui-grid-one-bind-id-grid=\"rowRenderIndex + '-' + col.uid + '-cell'\" class=\"ui-grid-cell\" ng-class=\"{ 'ui-grid-row-header-cell': col.isRowHeader }\" role=\"{{col.isRowHeader ? 'rowheader' : 'gridcell'}}\" ui-grid-cell></div>";
|
68
|
68
|
|
69
|
69
|
|
70
|
70
|
|
|
@@ -268,6 +268,72 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
|
268
|
268
|
|
269
|
269
|
];
|
270
|
270
|
|
|
271
|
+
|
|
272
|
+ //批量恢复
|
|
273
|
+ $scope.oneClickRecovery = function () {
|
|
274
|
+ console.log($scope.selected.items);
|
|
275
|
+ var modalInstance = $modal.open({
|
|
276
|
+ templateUrl: 'assets/views/delete.html',
|
|
277
|
+ controller: function ($scope, $modalInstance) {
|
|
278
|
+ $scope.title = '批量恢复';
|
|
279
|
+ $scope.connect = '确定要批量恢复?';
|
|
280
|
+ $scope.ok = function () {
|
|
281
|
+ $modalInstance.close("start");
|
|
282
|
+ };
|
|
283
|
+
|
|
284
|
+ $scope.cancel = function () {
|
|
285
|
+ $modalInstance.dismiss('cancel');
|
|
286
|
+ };
|
|
287
|
+ },
|
|
288
|
+ size: 'sm'
|
|
289
|
+ })
|
|
290
|
+
|
|
291
|
+ modalInstance.result.then(function (result) {
|
|
292
|
+ if (result) {
|
|
293
|
+ if ($scope.selected.items.length != 0) {
|
|
294
|
+ $rootScope.isMask = true;
|
|
295
|
+ }
|
|
296
|
+ var rmvList = [];
|
|
297
|
+ angular.forEach($scope.selected.items, function (item) {
|
|
298
|
+ rmvList.push(item.id);
|
|
299
|
+ });
|
|
300
|
+
|
|
301
|
+ if (rmvList.length > 0) {
|
|
302
|
+ api_bpm_data.oneClickRecovery({ids: String(rmvList)}).then(function (response) {
|
|
303
|
+ if (response.status == 200) {
|
|
304
|
+ $rootScope.isMask = false;
|
|
305
|
+ SweetAlert.swal({
|
|
306
|
+ title: "操作成功!",
|
|
307
|
+ type: "success",
|
|
308
|
+ confirmButtonColor: "#007AFF"
|
|
309
|
+ }, function () {
|
|
310
|
+ $scope.myData = _.reject($scope.myData, function (o) {
|
|
311
|
+ return _.includes(rmvList, o.id);
|
|
312
|
+ });
|
|
313
|
+ $scope.selected = {
|
|
314
|
+ items: []
|
|
315
|
+ };
|
|
316
|
+ });
|
|
317
|
+ $scope.gridApi.selection.clearSelectedRows();
|
|
318
|
+ $scope.refreshData('expand-right', $scope.fileData);
|
|
319
|
+ } else {
|
|
320
|
+ $rootScope.isMask = false;
|
|
321
|
+ SweetAlert.swal({
|
|
322
|
+ title: "操作异常!",
|
|
323
|
+ text: "系统异常,请稍后重试,或者联系管理员!",
|
|
324
|
+ type: "error"
|
|
325
|
+ });
|
|
326
|
+ }
|
|
327
|
+ })
|
|
328
|
+ }
|
|
329
|
+
|
|
330
|
+ }
|
|
331
|
+
|
|
332
|
+ }, function () {
|
|
333
|
+ // $scope.ldloading[style.replace('-', '_')] = false;
|
|
334
|
+ });
|
|
335
|
+ }
|
|
336
|
+
|
271
|
337
|
// console.log(row);
|
272
|
338
|
|
273
|
339
|
$scope.wtwt = function(row) {
|
|
@@ -376,6 +442,36 @@ app.controller('jry_emergencyCtrl', ["$scope", "i18nService", "$rootScope", "$st
|
376
|
442
|
|
377
|
443
|
});
|
378
|
444
|
|
|
445
|
+ //勾选行事件
|
|
446
|
+ gridApi.selection.on.rowSelectionChanged($scope, function (data) {
|
|
447
|
+ if (data.isSelected) {
|
|
448
|
+ $scope.selected.items.push(data.entity);
|
|
449
|
+ } else {
|
|
450
|
+ //objs:需要遍历的集合 data:遍历时当前的数据 index:遍历时当前索引
|
|
451
|
+ //array:需要遍历的集合,每次遍历时都会把objs原样的传一次。
|
|
452
|
+ //angular.forEach(objs, function(data,index,array)
|
|
453
|
+ angular.forEach($scope.selected.items, function (ObjIndex, index, destObj) {
|
|
454
|
+ // console.log(ObjIndex);
|
|
455
|
+ // console.log(index);
|
|
456
|
+ // console.log(destObj);
|
|
457
|
+ if (ObjIndex.id == data.entity.id) {
|
|
458
|
+ destObj.splice(index, 1)
|
|
459
|
+ }
|
|
460
|
+ })
|
|
461
|
+ }
|
|
462
|
+ });
|
|
463
|
+
|
|
464
|
+ //批量全选
|
|
465
|
+ gridApi.selection.on.rowSelectionChangedBatch($scope, function (rows, event) {
|
|
466
|
+ angular.forEach(rows, function (ObjIndex, index, destObj) {
|
|
467
|
+ if (ObjIndex.isSelected) {
|
|
468
|
+ $scope.selected.items.push(ObjIndex.entity);
|
|
469
|
+ } else {
|
|
470
|
+ $scope.selected.items = [];
|
|
471
|
+ }
|
|
472
|
+ });
|
|
473
|
+ });
|
|
474
|
+
|
379
|
475
|
|
380
|
476
|
|
381
|
477
|
$scope.selected = {
|