adminrequesterCtrl.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. // 'use strict';
  2. /**
  3. * controller for User Profile Example
  4. */
  5. app.controller('adminUserListCtrl_requ', ["$rootScope", "$scope", "$http", "$state", "FileUploader", "$timeout", "$interval", "$modal", "SweetAlert", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_user_data", function ($rootScope, $scope, $http, $state, FileUploader, $timeout, $interval, $modal, SweetAlert, i18nService, uiGridConstants, uiGridGroupingConstants, Restangular, api_user_data) {
  6. $scope.langs = i18nService.getAllLangs();
  7. $scope.lang = 'zh-cn';
  8. i18nService.setCurrentLang($scope.lang);
  9. var loginUser = $rootScope.user;
  10. //$scope.allright=false;
  11. //$scope.allrightnot=true;
  12. $scope.gridOptions = {};
  13. $scope.gridOptions.data = 'myData';
  14. $scope.gridOptions.enableColumnResizing = true;
  15. $scope.gridOptions.enableFiltering = true;
  16. $scope.gridOptions.enableGridMenu = true;
  17. $scope.gridOptions.enableRowSelection = true;
  18. $scope.gridOptions.showGridFooter = false;
  19. $scope.gridOptions.showColumnFooter = false;
  20. $scope.gridOptions.fastWatch = true;
  21. $scope.gridOptions.useExternalFiltering = true;
  22. $scope.gridOptions.useExternalPagination = true;
  23. $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
  24. $scope.gridOptions.paginationPageSize = 10;
  25. $scope.gridOptions.multiSelect = false;
  26. //$scope.gridOptions.rowTemplate= "<div ng-dblclick=\"grid.appScope.onDblClick(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>";
  27. $scope.gridOptions.rowIdentity = function (row) {
  28. return row.id;
  29. };
  30. $scope.gridOptions.getRowIdentity = function (row) {
  31. return row.id;
  32. };
  33. $scope.transferRole = function (roles) {
  34. var tempValue = "";
  35. angular.forEach(roles, function (item) {
  36. if (tempValue != "") {
  37. tempValue = tempValue + "/";
  38. }
  39. tempValue = tempValue + item.role;
  40. })
  41. return tempValue;
  42. }
  43. //remote data
  44. $scope.gridOptions.columnDefs = [{
  45. name: 'item',
  46. displayName: '序号',
  47. width: 50,
  48. enableFiltering: false,
  49. cellTemplate: '<div>' +
  50. '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
  51. '</div>'
  52. },
  53. {
  54. name: 'name',
  55. displayName: '姓名',
  56. width: '10%',
  57. enableFiltering: false
  58. },
  59. // { name: 'studentNo', displayName: '学工号', width: 120 },
  60. {
  61. name: 'account',
  62. displayName: '工号',
  63. width: '10%',
  64. enableFiltering: false
  65. },
  66. {
  67. name: 'weixin',
  68. displayName: '微信',
  69. width: '10%',
  70. minWidth: '120',
  71. enableFiltering: false
  72. },
  73. {
  74. name: 'dept.dept',
  75. displayName: '科室',
  76. width: '12%',
  77. enableFiltering: false
  78. },
  79. {
  80. name: 'requesterType.name',
  81. displayName: '职务',
  82. width: '10%',
  83. enableFiltering: false
  84. },
  85. {
  86. name: 'mphone',
  87. displayName: '电话',
  88. width: '12%',
  89. minWidth: '125',
  90. enableFiltering: false
  91. },
  92. {
  93. name: 'place.area.area',
  94. displayName: '区域',
  95. width: '10%',
  96. enableFiltering: false
  97. },
  98. {
  99. name: 'place.place',
  100. displayName: '地点',
  101. width: '12%',
  102. enableFiltering: false
  103. },
  104. {
  105. name: '操作',
  106. cellTemplate: '<div><div class="cl-effect-1 ui-grid-cell-contents pull-left">' +
  107. // '<a ng-click="grid.appScope.saveData(row.entity)" tooltip="编辑" tooltip-placement="right">' +
  108. // '<i class="fa fa-pencil-square-o"></i></a>'+
  109. '<a ng-click="grid.appScope.saveData(row.entity)" class="bianjifont">编辑</a>' +
  110. '</div></div>',
  111. enableFiltering: false
  112. }
  113. ];
  114. //导入
  115. $scope.importopen = function () { //导入触发事件
  116. var modalInstance = $modal.open({
  117. templateUrl: 'assets/views/import.html',
  118. controller: function ($scope, $modalInstance, FileUploader) {
  119. var importUploader = $scope.importUploader = new FileUploader({
  120. url: api_user_data.jry_importData().getRequestedUrl(),
  121. });
  122. // importUploader.filters.push({
  123. // name: 'customFilter',
  124. // fn: function(item /*{File|FileLikeObject}*/ , options) {
  125. // var type = item.name.slice(item.name.lastIndexOf('.') + 1);
  126. // //var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|';
  127. // return (type == 'xlsx');
  128. // }
  129. // });
  130. importUploader.filters.push({
  131. name: 'customFilter',
  132. fn: function (item /*{File|FileLikeObject}*/ , options) {
  133. this.queue = [];
  134. return this.queue.length < 2;
  135. }
  136. });
  137. importUploader.onWhenAddingFileFailed = function (item /*{File|FileLikeObject}*/ , filter, options) {
  138. console.info('onWhenAddingFileFailed', item, filter, options);
  139. };
  140. importUploader.onAfterAddingFile = function (fileItem) {
  141. console.info('onAfterAddingFile', fileItem);
  142. };
  143. importUploader.onAfterAddingAll = function (addedFileItems) {
  144. console.info('onAfterAddingAll', addedFileItems);
  145. };
  146. importUploader.onProgressItem = function (fileItem, progress) {
  147. console.info('onProgressItem', fileItem, progress);
  148. };
  149. importUploader.onProgressAll = function (progress) {
  150. console.info('onProgressAll', progress);
  151. };
  152. importUploader.onSuccessItem = function (fileItem, response, status, headers) {
  153. if (response.status == 200) {
  154. SweetAlert.swal({
  155. title: "导入成功!",
  156. confirmButtonColor: "#007AFF",
  157. type: "success"
  158. }, function () {
  159. // $scope.ldloading.contract_overlay = false;
  160. $rootScope.isMask = false;
  161. $scope.refreshData('expand-right', $scope.fileData);
  162. });
  163. } else {
  164. // $scope.ldloading.contract_overlay = false;
  165. $rootScope.isMask = false;
  166. SweetAlert.swal({
  167. title: "导入失败!",
  168. text: response.error,
  169. type: "error"
  170. })
  171. }
  172. console.info('onSuccessItem', fileItem, response, status, headers);
  173. };
  174. importUploader.onErrorItem = function (fileItem, response, status, headers) {
  175. console.info('onErrorItem', fileItem, response, status, headers);
  176. SweetAlert.swal({
  177. title: "系统错误!",
  178. text: "系统错误,请稍候重试!",
  179. type: "error"
  180. });
  181. };
  182. importUploader.onCancelItem = function (fileItem, response, status, headers) {
  183. console.info('onCancelItem', fileItem, response, status, headers);
  184. };
  185. importUploader.onCompleteItem = function (fileItem, response, status, headers) {
  186. console.info('onCompleteItem', fileItem, response, status, headers);
  187. };
  188. importUploader.onCompleteAll = function () {
  189. console.info('onCompleteAll');
  190. };
  191. $scope.ldloading = {};
  192. $rootScope.isMask = false;
  193. $scope.import = function (style) {
  194. // $scope.ldloading[style.replace('-', '_')] = true;
  195. $modalInstance.dismiss('cancel');
  196. $rootScope.isMask = true;
  197. importUploader.onBeforeUploadItem = function (item) {
  198. angular.extend(item.headers, $rootScope.getSession());
  199. // item.formData[0]['filename'] = item.file.name;
  200. // item.formData[0]['type'] = "requester";
  201. item.formData.push({
  202. 'fileName': item.file.name
  203. });
  204. item.formData.push({
  205. 'type': "requester"
  206. });
  207. console.info('onBeforeUploadItem', item);
  208. };
  209. importUploader.uploadAll();
  210. }
  211. $scope.cancel = function () {
  212. $modalInstance.dismiss('cancel');
  213. };
  214. },
  215. size: 'sm',
  216. resolve: {
  217. importUploader: function () {
  218. return $scope.importUploader;
  219. }
  220. }
  221. });
  222. modalInstance.result.then(function (selectedItem) {
  223. if (selectedItem) {}
  224. })
  225. }
  226. //导出
  227. $scope.openmodel = function () {
  228. var modalInstance = $modal.open({
  229. templateUrl: 'assets/views/system/tpl/getdown.html',
  230. controller: function ($scope, $modalInstance) {
  231. $scope.key = {};
  232. $scope.title = '报修人导入模版下载';
  233. $scope.lable = '下载模版版本';
  234. $scope.onChange = function (key) {
  235. $scope.key = key;
  236. }
  237. $scope.downmodel = [{
  238. id: 1,
  239. name: "EXCEL2003版(xls)"
  240. }, {
  241. id: 2,
  242. name: "EXCEL2007及以上版(xlsx)"
  243. }]
  244. $scope.ok = function () {
  245. $modalInstance.close($scope.key);
  246. };
  247. $scope.cancel = function () {
  248. $modalInstance.dismiss('cancel');
  249. };
  250. },
  251. size: 'sm',
  252. });
  253. modalInstance.result.then(function (selectedItem) {
  254. if (selectedItem) {
  255. var selectedItemId = "";
  256. if (selectedItem.id == 2) {
  257. selectedItemId = ".xlsx";
  258. }
  259. var type = "requester";
  260. var month = 0;
  261. $http({
  262. url: api_user_data.downDataModel(type, month).getRequestedUrl(),
  263. method: 'GET',
  264. headers: {
  265. 'Accept': '*/*'
  266. },
  267. responseType: 'arraybuffer'
  268. }).success(function (data, status, headers, config) {
  269. var file = new Blob([data], {
  270. // type : 'application/octet-stream'
  271. type: 'application/vnd.ms-excel'
  272. });
  273. //trick to download store a file having its URL
  274. var fileURL = URL.createObjectURL(file);
  275. var a = document.createElement('a');
  276. a.href = fileURL;
  277. a.target = '_blank';
  278. a.download = "报修人" + selectedItemId;
  279. document.body.appendChild(a);
  280. a.click();
  281. }).error(function (data, status, headers, config) {
  282. console.log(data);
  283. });
  284. }
  285. });
  286. }
  287. //修改
  288. $scope.saveData = function (data) {
  289. if (data.place) {
  290. var modelData = {
  291. model: {
  292. requester: {
  293. "id": data.id,
  294. "account": data.account,
  295. "name": data.name,
  296. "gender": data.gender,
  297. "email": data.email,
  298. "mphone": data.mphone,
  299. "deptName": data.deptName,
  300. "telephone": data.telephone,
  301. "dept": data.dept,
  302. "area": data.place.area,
  303. "place": data.place,
  304. "studentNo": data.studentNo,
  305. "houseNumber": data.houseNumber,
  306. "requesterType": data.requesterType,
  307. "weixin": data.weixin
  308. }
  309. }
  310. };
  311. } else {
  312. var modelData = {
  313. model: {
  314. requester: {
  315. "id": data.id,
  316. "account": data.account,
  317. "name": data.name,
  318. "gender": data.gender,
  319. "email": data.email,
  320. "mphone": data.mphone,
  321. "deptName": data.deptName,
  322. "telephone": data.telephone,
  323. "dept": data.dept,
  324. // "area": data.place.area,
  325. "place": data.place,
  326. "studentNo": data.studentNo,
  327. "houseNumber": data.houseNumber,
  328. "requesterTypeDTO": data.requesterTypeDTO,
  329. "weixin": data.weixin
  330. }
  331. }
  332. };
  333. }
  334. $state.go('app.system.user.requester', {
  335. formKey: 'system_edit_requester',
  336. service: 'api_user_data',
  337. model: JSON.stringify(modelData)
  338. });
  339. };
  340. // 下拉树
  341. function convertListToTree(data, treeMap) {
  342. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  343. var root = null; //Initially set our loop to null
  344. //loop over data
  345. for (var i = 0; i < data.length; i++) {
  346. var datum = data[i];
  347. //each node will have children, so let's give it a "children" poperty
  348. datum.children = [];
  349. //add an entry for this node to the map so that any future children can
  350. //lookup the parent
  351. idToNodeMap[datum.id] = datum;
  352. //Does this node have a parent?
  353. // console.log("datum="+JSON.stringify(datum))
  354. if (typeof datum.parent === "undefined" || datum.parent === null) {
  355. //Doesn't look like it, so this node is the root of the tree
  356. root = datum;
  357. treeMap[datum.id] = root;
  358. } else {
  359. //This node has a parent, so let's look it up using the id
  360. parentNode = idToNodeMap[datum.parent.id];
  361. //We don't need this property, so let's delete it.
  362. // delete datum.parent;
  363. //Let's add the current node as a child of the parent node.
  364. parentNode.children.push(datum);
  365. }
  366. }
  367. return root;
  368. }
  369. function convertParentToChildList(data) {
  370. var treeMap = {};
  371. var list = [];
  372. convertListToTree(data, treeMap);
  373. angular.forEach(treeMap, function (item) {
  374. list.push(item);
  375. });
  376. return list;
  377. }
  378. $scope.parentdata = {};
  379. $scope.try_async_load = function () {
  380. $scope.my_data = [];
  381. $scope.doing_async = true;
  382. var data = {
  383. "idx": 0,
  384. "sum": 1000
  385. };
  386. api_user_data.fetchDataList('department', data).then(function (response) {
  387. var data = response.list;
  388. var objects = [];
  389. $scope.parentdata = data;
  390. for (var i = 0; i < data.length; i++) {
  391. var object = {};
  392. object.id = data[i].id;
  393. if (angular.isDefined(data[i].parent)) {
  394. object.parent = data[i].parent;
  395. }
  396. if (angular.isDefined(data[i].hasArea)) {
  397. object.hasArea = data[i].hasArea;
  398. }
  399. if (angular.isDefined(data[i].hasSimple)) {
  400. object.hasSimple = data[i].hasSimple;
  401. }
  402. if (angular.isDefined(data[i].group)) {
  403. object.group = data[i].group;
  404. }
  405. if (angular.isDefined(data[i].priority)) {
  406. object.priority = data[i].priority;
  407. }
  408. object.label = data[i].dept;
  409. // object.actions = data[i][3]; //权限部分
  410. // object.group = "1";
  411. // object.user = "2";
  412. object.state = {
  413. "opened": true
  414. };
  415. object.typeName = "type";
  416. // if()
  417. // if (object.actions.indexOf("2") >= 0) { //知识库类型 具有增加权限--系统管理员
  418. $scope.showAddSolutionType = true;
  419. // }
  420. // if (object.actions.indexOf("5") >= 0) { //知识库类型 具有授权权限--系统管理员
  421. $scope.showReviewKnowledgeType = true;
  422. // }
  423. objects.push(object);
  424. }
  425. $scope.my_data = convertParentToChildList(objects);
  426. $scope.tree_data = angular.copy($scope.my_data);
  427. // if ($scope.my_data.length > 0) {
  428. $scope.doing_async = false;
  429. // }
  430. });
  431. };
  432. $scope.try_async_load();
  433. //新增
  434. $scope.addData = function () {
  435. $state.go('app.system.user.requester', {
  436. formKey: 'system_edit_requester',
  437. service: 'api_user_data'
  438. })
  439. }
  440. $scope.removeData = function () {
  441. var modalInstance = $modal.open({
  442. templateUrl: 'assets/views/delete.html',
  443. controller: function ($scope, scope, $modalInstance, api_bpm_data) {
  444. var rmvList = [];
  445. $scope.title = '报修人删除';
  446. $scope.connect = '确定要删除此报修人?';
  447. rmvList.push(scope.selected.items[0].id);
  448. $scope.ok = function () {
  449. $modalInstance.close(rmvList);
  450. };
  451. $scope.cancel = function () {
  452. $modalInstance.dismiss('cancel');
  453. };
  454. },
  455. size: 'sm',
  456. resolve: {
  457. scope: function () {
  458. return $scope;
  459. }
  460. }
  461. });
  462. modalInstance.result.then(function (selectedItem) {
  463. if (selectedItem) {
  464. if (selectedItem.length > 0) {
  465. api_user_data.rmvData('requester', selectedItem).then(function (response) {
  466. if (response.data) {
  467. SweetAlert.swal({
  468. title: "删除成功!",
  469. type: "success",
  470. confirmButtonColor: "#007AFF"
  471. }, function () {
  472. $scope.myData = _.reject($scope.myData, function (o) {
  473. return _.includes(selectedItem, o.id)
  474. });
  475. $scope.selected = {
  476. items: []
  477. };
  478. $scope.gridOptions.totalItems = $scope.gridOptions.totalItems - selectedItem.length
  479. $scope.gridApi.grid.selection.selectedCount = 0;
  480. });
  481. } else {
  482. SweetAlert.swal({
  483. title: "操作异常!",
  484. text: "系统异常,请稍后重试,或者联系管理员!",
  485. type: "error"
  486. });
  487. }
  488. })
  489. }
  490. }
  491. })
  492. }
  493. $scope.selected = {
  494. items: []
  495. }
  496. $scope.editted = {
  497. items: []
  498. }
  499. $scope.gridOptions.onRegisterApi = function (gridApi) {
  500. $scope.gridApi = gridApi;
  501. // gridApi.edit.on.afterCellEdit($scope,function(rowEntity, colDef, newValue, oldValue){
  502. // console.log(rowEntity);
  503. // });
  504. gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) {
  505. var filtersData = $scope.memoryfilterData;
  506. filtersData.idx = newPage - 1;
  507. filtersData.sum = pageSize;
  508. defaultFilterData = filtersData;
  509. $scope.fileData.idx = newPage - 1;
  510. $scope.fileData.sum = pageSize;
  511. $scope.refreshData('expand-right', $scope.fileData);
  512. });
  513. // gridApi.selection.on.rowSelectionChanged($scope, function(data) {
  514. // data.grid.appScope.selected.items = data.entity
  515. // });
  516. gridApi.selection.on.rowSelectionChanged($scope, function (data) {
  517. if (data.isSelected) {
  518. data.grid.appScope.selected.items[0] = data.entity;
  519. } else {
  520. if (data.grid.appScope.selected.items[0].id == data.entity.id) {
  521. data.grid.appScope.selected.items = [];
  522. }
  523. }
  524. });
  525. gridApi.core.on.filterChanged($scope, function () {
  526. var grid = this.grid;
  527. var filtersData = {
  528. idx: 0,
  529. sum: 10
  530. };
  531. angular.forEach(grid.columns, function (item) {
  532. if (item.enableFiltering) {
  533. if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  534. if (angular.isUndefined(filtersData['requester'])) {
  535. filtersData['requester'] = {};
  536. }
  537. filtersData['requester'][item.field] = item.filters[0].term;
  538. }
  539. }
  540. });
  541. $scope.memoryfilterData = filtersData;
  542. $scope.refreshData('expand-right', $scope.fileData);
  543. });
  544. };
  545. var defaultFilterData = {
  546. "idx": 0,
  547. "sum": 10
  548. };
  549. $scope.memoryfilterData = {
  550. "idx": 0,
  551. "sum": 10
  552. }
  553. $scope.ldloading = {};
  554. $scope.refresh = function (style, filterData) {
  555. $scope.selected = {
  556. items: []
  557. };
  558. if ($scope.gridApi) {
  559. // $scope.gridApi.grid.options.paginationCurrentPage = 0;
  560. $scope.gridApi.grid.selection.selectedCount = 0;
  561. }
  562. $scope.refreshData('expand-right', $scope.fileData);
  563. }
  564. $scope.fileData = {
  565. "idx": 0,
  566. "sum": 10,
  567. "requester": {
  568. }
  569. };
  570. // 搜索
  571. $scope.searchData = function () {
  572. $scope.refreshData('expand-right', $scope.fileData);
  573. }
  574. // 清空
  575. $scope.clean = function () {
  576. delete $scope.fileData.requester.name;
  577. delete $scope.fileData.requester.account;
  578. delete $scope.fileData.requester.dept;
  579. $scope.try_async_load();
  580. $scope.refreshData('expand-right', $scope.fileData);
  581. }
  582. $scope.onFilterCallback = function (data) {
  583. // console.log(data);
  584. $scope.fileData.requester.dept = data;
  585. }
  586. $scope.refreshData = function (style, filterData) {
  587. $scope.ldloading[style.replace('-', '_')] = true;
  588. if (angular.isUndefined(filterData)) {
  589. filterData = defaultFilterData;
  590. }
  591. if (angular.isDefined($scope.searchTypes)) {
  592. filterData['searchType'] = $scope.searchTypes;
  593. }
  594. $scope.myData = [];
  595. // if ($scope.gridApi) {
  596. // $scope.gridApi.grid.options.paginationCurrentPage = 0;
  597. // $scope.gridApi.grid.selection.selectedCount = 0;
  598. // }
  599. api_user_data.fetchDataList('requester', filterData).then(function (data) {
  600. var myData = Restangular.stripRestangular(data);
  601. $scope.gridOptions.totalItems = myData.totalNum;
  602. $scope.myData = myData.list;
  603. for (var i = 0; i < $scope.myData.length; i++) {
  604. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  605. }
  606. $scope.ldloading[style.replace('-', '_')] = false;
  607. }, function () {
  608. $scope.ldloading[style.replace('-', '_')] = false;
  609. });
  610. };
  611. $scope.refreshData2 = function (style, filterData) {
  612. $scope.ldloading[style.replace('-', '_')] = true;
  613. if (angular.isUndefined(filterData)) {
  614. filterData = defaultFilterData;
  615. }
  616. if (angular.isDefined($scope.searchTypes)) {
  617. filterData['searchType'] = $scope.searchTypes;
  618. }
  619. // $scope.myData = [];
  620. // if ($scope.gridApi) {
  621. // $scope.gridApi.grid.options.paginationCurrentPage = 0;
  622. // $scope.gridApi.grid.selection.selectedCount = 0;
  623. // }
  624. api_user_data.fetchDataList('requester', filterData).then(function (data) {
  625. var myData = Restangular.stripRestangular(data);
  626. $scope.gridOptions.totalItems = myData.totalNum;
  627. $scope.myData = myData.list;
  628. for (var i = 0; i < $scope.myData.length; i++) {
  629. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  630. }
  631. $scope.ldloading[style.replace('-', '_')] = false;
  632. }, function () {
  633. $scope.ldloading[style.replace('-', '_')] = false;
  634. });
  635. };
  636. $scope.refreshData('expand-right', $scope.fileData);
  637. $scope.timer = $interval(function () {
  638. $scope.refreshData2('expand-right', $scope.fileData);
  639. }, $rootScope.refreshTime);
  640. $scope.$on('$destroy', function () {
  641. $interval.cancel($scope.timer)
  642. });
  643. }]);