adminUserCtrl.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. 'use strict';
  2. /**
  3. * controller for User Profile Example
  4. */
  5. app.controller('adminUserListCtrl', ["$rootScope", "$scope", "$state", "$timeout", "$interval", "$modal", "SweetAlert", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_user_data", "api_login", function ($rootScope, $scope, $state, $timeout, $interval, $modal, SweetAlert, i18nService, uiGridConstants, uiGridGroupingConstants, Restangular, api_user_data, api_login) {
  6. $scope.langs = i18nService.getAllLangs();
  7. $scope.lang = 'zh-cn';
  8. i18nService.setCurrentLang($scope.lang);
  9. var loginUser = $rootScope.user;
  10. $scope.xinzeng = false;
  11. $scope.shanchu = false;
  12. $scope.bianji = false;
  13. $scope.chongzhimima = false;
  14. for (var i = 0; i < loginUser.menu.length; i++) {
  15. if (loginUser.menu[i].link == "renyuanguanli_xinzeng") {
  16. $scope.xinzeng = true
  17. }
  18. if (loginUser.menu[i].link == "renyuanguanli_shanchu") {
  19. $scope.shanchu = true
  20. }
  21. if (loginUser.menu[i].link == "renyuanguanli_bianji") {
  22. $scope.bianji = true
  23. }
  24. if (loginUser.menu[i].link == "renyuanguanli_chongzhimima") {
  25. $scope.chongzhimima = true
  26. }
  27. }
  28. //$scope.allright=false;
  29. //$scope.allrightnot=true;
  30. $scope.gridOptions = {};
  31. $scope.gridOptions.data = 'myData';
  32. $scope.gridOptions.enableColumnResizing = true;
  33. $scope.gridOptions.enableFiltering = true;
  34. $scope.gridOptions.enableGridMenu = true;
  35. $scope.gridOptions.enableRowSelection = true;
  36. $scope.gridOptions.showGridFooter = true;
  37. $scope.gridOptions.showColumnFooter = false;
  38. $scope.gridOptions.fastWatch = true;
  39. $scope.gridOptions.useExternalFiltering = true;
  40. $scope.gridOptions.useExternalPagination = true;
  41. $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
  42. $scope.gridOptions.paginationPageSize = 10;
  43. $scope.gridOptions.multiSelect = true;
  44. $scope.gridOptions.enableSelectionBatchEvent = true; //使用批量使用事件
  45. //$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>";
  46. $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>";
  47. $scope.gridOptions.rowIdentity = function (row) {
  48. return row.id;
  49. };
  50. $scope.gridOptions.getRowIdentity = function (row) {
  51. return row.id;
  52. };
  53. $scope.transferRole = function (roles) {
  54. var tempValue = "";
  55. angular.forEach(roles, function (item) {
  56. if (tempValue != "") {
  57. tempValue = tempValue + "/";
  58. }
  59. tempValue = tempValue + item.role;
  60. })
  61. return tempValue;
  62. }
  63. $scope.transferStatus = function (flag) {
  64. return (flag == 0) ? "有效" : "无效";
  65. }
  66. $scope.transfergroup = function (group) {
  67. var groupData = '';
  68. angular.forEach(group, function (item) {
  69. if (groupData == '') {
  70. groupData = item.groupName;
  71. } else {
  72. groupData = groupData + "/" + item.groupName;
  73. }
  74. })
  75. return groupData;
  76. }
  77. //remote data
  78. $scope.gridOptions.columnDefs = [{
  79. name: 'item',
  80. displayName: '序号',
  81. width: 50,
  82. enableFiltering: false,
  83. cellTemplate: '<div>' +
  84. '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
  85. '</div>'
  86. },
  87. {
  88. name: 'account',
  89. displayName: '账号',
  90. width: '8%',
  91. minWidth: '105',
  92. enableFiltering: false
  93. },
  94. {
  95. name: 'name',
  96. displayName: '姓名',
  97. width: '6%',
  98. minWidth: '100',
  99. enableFiltering: false
  100. },
  101. {
  102. name: 'weixin',
  103. displayName: '微信',
  104. width: '6%',
  105. minWidth: '120',
  106. enableFiltering: false
  107. },
  108. {
  109. name: 'userType',
  110. displayName: '人员类别',
  111. width: '6%',
  112. minWidth: '120',
  113. enableFiltering: false,
  114. cellTemplate: '<div>' +
  115. '<div class="ui-grid-cell-contents">{{row.entity.userType.value == 2 ?row.entity.company.name:row.entity.userType.name}}</div>' +
  116. '</div>'
  117. },
  118. // {
  119. // name: 'gender.name',
  120. // displayName: '性别',
  121. // width: '5%',
  122. // enableFiltering: false
  123. // },
  124. {
  125. name: 'phone',
  126. displayName: '联系电话',
  127. width: '8%',
  128. minWidth: '115',
  129. enableFiltering: false
  130. },
  131. {
  132. name: 'email',
  133. displayName: '邮箱',
  134. width: '14%',
  135. minWidth: '150',
  136. enableFiltering: false
  137. },
  138. {
  139. name: 'dept.dept',
  140. displayName: '科室',
  141. width: '12%',
  142. enableFiltering: false
  143. },
  144. {
  145. name: 'dept.phone',
  146. displayName: '科室电话',
  147. width: '11%',
  148. enableFiltering: false
  149. },
  150. {
  151. name: 'extensionNo',
  152. displayName: '分机号码',
  153. width: '11%',
  154. enableFiltering: false
  155. },
  156. {
  157. name: 'group',
  158. displayName: '所属工作组',
  159. width: '15%',
  160. minWidth: '150',
  161. cellTemplate: '<div class="ui-grid-cell-contents">{{grid.appScope.transfergroup(row.entity.group)}}</div>',
  162. enableFiltering: false
  163. },
  164. {
  165. name: 'flag',
  166. displayName: '状态',
  167. cellTemplate: '<div class="ui-grid-cell-contents">{{grid.appScope.transferStatus(row.entity.flag)}}</div>',
  168. width: '5%',
  169. enableFiltering: false
  170. },
  171. {
  172. name: '操作',
  173. minWidth: '150',
  174. cellTemplate: '<div><div class="cl-effect-1 ui-grid-cell-contents pull-left">' +
  175. // '<a ng-click="grid.appScope.saveData(row.entity)" tooltip="编辑" tooltip-placement="right">' +
  176. // '<i class="fa fa-pencil-square-o"/></a>' +
  177. '<a ng-click="grid.appScope.saveData(row.entity)" ng-show="grid.appScope.bianji" class="bianjifont">编辑</a>' +
  178. // '<a ng-click="grid.appScope.resetpassword(row.entity.id)" tooltip="重置密码" tooltip-placement="right">' +
  179. // '<i class="ti-back-right"/></a>' +
  180. '<a ng-click="grid.appScope.resetpassword(row.entity.id)" ng-show="grid.appScope.chongzhimima" class="bianjifont" >重置密码</a>' +
  181. // '<a ng-show="row.entity.isRegis&&row.entity.isRegis==1" ng-click="grid.appScope.registerfunction(row.entity.id)" tooltip="消息中心注册" tooltip-placement="right">' +
  182. // '<i class="ti-write"/></a>' +
  183. // '<a ng-show="row.entity.isRegis&&row.entity.isRegis==1" ng-click="grid.appScope.registerfunction(row.entity.id)" class="handlefont" tooltip="消息中心注册" tooltip-placement="left">注册</a>' +
  184. '</div></div>',
  185. enableFiltering: false
  186. }
  187. ];
  188. $scope.groupdata = {};
  189. var apple_selected, tree, treedata_avm, treedata_geography;
  190. // $scope.onFilterCallback = function(branch) {
  191. // var filedata = $scope.memoryfilterData;
  192. // if (filedata.user) {
  193. // filedata.user.groupdata = { id: branch.id };
  194. // } else {
  195. // filedata.user = { groupdata: { id: branch.id } };
  196. // }
  197. // // filedata.user.group = branch.groupName;
  198. // $scope.refreshData('expand-right', $scope.fileData);
  199. // };
  200. $scope.my_data = [];
  201. $scope.deselectItem = function (item) {
  202. console.log(item)
  203. console.log($scope)
  204. }
  205. function convertListToTree(data, treeMap) {
  206. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  207. var root = null; //Initially set our loop to null
  208. var parentNode = null;
  209. //loop over data
  210. for (var i = 0; i < data.length; i++) {
  211. var datum = data[i];
  212. //each node will have children, so let's give it a "children" poperty
  213. datum.children = [];
  214. //add an entry for this node to the map so that any future children can
  215. //lookup the parent
  216. idToNodeMap[datum.id] = datum;
  217. //Does this node have a parent?
  218. if (typeof datum.parent === "undefined" || datum.parent == null) {
  219. //Doesn't look like it, so this node is the root of the tree
  220. root = datum;
  221. treeMap[datum.id] = root;
  222. } else {
  223. //This node has a parent, so let's look it up using the id
  224. parentNode = idToNodeMap[datum.parent.id];
  225. //We don't need this property, so let's delete it.
  226. delete datum.parent;
  227. //Let's add the current node as a child of the parent node.
  228. parentNode.children.push(datum);
  229. }
  230. }
  231. return root;
  232. }
  233. function convertParentToChildList(data) {
  234. var treeMap = {};
  235. var list = [];
  236. convertListToTree(data, treeMap);
  237. angular.forEach(treeMap, function (item) {
  238. list.push(item);
  239. });
  240. return list;
  241. }
  242. $scope.my_tree = tree = {};
  243. $scope.try_async_load = function () {
  244. $scope.my_data = [];
  245. $scope.select_treedata = [];
  246. $scope.doing_async = true;
  247. api_user_data.fetchDataList('group', {
  248. "idx": 0,
  249. "sum": 1000,
  250. group:{
  251. 'selectType':'nouser'
  252. }
  253. }).then(function (data) {
  254. $scope.select_treedata = $scope.my_data = convertParentToChildList(data['list']);
  255. $scope.doing_async = false;
  256. // tree.expand_all();
  257. //console.log(treelist);
  258. });
  259. };
  260. $scope.select_treedata = [];
  261. $scope.propTypeOptions = [];
  262. $scope.try_async_load();
  263. //注册
  264. $scope.registerfunction = function (id) {
  265. var modalInstance = $modal.open({
  266. templateUrl: 'assets/views/system/tpl/register.html',
  267. controller: function ($scope, scope, $modalInstance) {
  268. $scope.ok = function (key) {
  269. var filedata = {
  270. 'id': id,
  271. 'email': key
  272. };
  273. $modalInstance.dismiss('cancel');
  274. api_user_data.register(filedata).then(function (response) {
  275. var myData = Restangular.stripRestangular(response);
  276. if (response.status == 200) {
  277. SweetAlert.swal({
  278. title: "注册成功!",
  279. type: "success",
  280. confirmButtonColor: "#007AFF"
  281. }, function () {
  282. scope.refreshData('expand-right', scope.fileData);
  283. });
  284. } else {
  285. SweetAlert.swal({
  286. title: "注册失败!",
  287. text: response.msg,
  288. type: "error"
  289. });
  290. }
  291. })
  292. };
  293. $scope.cancel = function () {
  294. $modalInstance.dismiss('cancel');
  295. };
  296. },
  297. resolve: {
  298. scope: function () {
  299. return $scope;
  300. }
  301. }
  302. })
  303. }
  304. $scope.resetpassword = function (id) {
  305. var modalInstance = $modal.open({
  306. templateUrl: 'assets/views/delete.html',
  307. controller: function ($scope, $modalInstance) {
  308. var data;
  309. $scope.title = '重置密码';
  310. $scope.connect = '确定要重置密码?';
  311. $scope.ok = function () {
  312. $modalInstance.dismiss('cancel');
  313. api_login.resetpwd(id).then(function (response) {
  314. var myData = Restangular.stripRestangular(response);
  315. // console.log("myData=" + JSON.stringify(myData));
  316. if (response.status == 200) {
  317. SweetAlert.swal({
  318. title: "重置成功!重置后密码 888888",
  319. type: "success",
  320. confirmButtonColor: "#007AFF"
  321. });
  322. } else {
  323. SweetAlert.swal({
  324. title: "操作异常!",
  325. text: "系统异常,请稍后重试,或者联系管理员!",
  326. type: "error"
  327. });
  328. }
  329. })
  330. };
  331. $scope.cancel = function () {
  332. $modalInstance.dismiss('cancel');
  333. };
  334. },
  335. size: 'sm'
  336. })
  337. }
  338. $scope.saveData = function (data) {
  339. var modelData = {
  340. model: {
  341. user: data
  342. }
  343. };
  344. if (modelData.model.user && modelData.model.user.item) {
  345. delete modelData.model.user.item;
  346. }
  347. modelData.model.user.deptPhone=data.dept?data.dept.phone:''
  348. $state.go('app.system.form', {
  349. formKey: 'system_edit',
  350. service: 'api_user_data',
  351. model: JSON.stringify(modelData)
  352. });
  353. };
  354. $scope.addData = function () {
  355. var modelData = {
  356. model: {
  357. user: {
  358. flag: "0"
  359. }
  360. }
  361. };
  362. $state.go('app.system.form', {
  363. formKey: 'system_edit',
  364. service: 'api_user_data',
  365. model: JSON.stringify(modelData)
  366. });
  367. }
  368. $scope.removeData = function () {
  369. var modalInstance = $modal.open({
  370. templateUrl: 'assets/views/delete.html',
  371. controller: function ($scope, scope, $modalInstance, api_bpm_data) {
  372. var rmvList = [];
  373. $scope.title = '人员删除';
  374. $scope.connect = '确定要删除此人员?';
  375. angular.forEach(scope.selected.items, function (item) {
  376. rmvList.push(item.id);
  377. });
  378. $scope.ok = function () {
  379. $modalInstance.close(rmvList);
  380. };
  381. $scope.cancel = function () {
  382. $modalInstance.dismiss('cancel');
  383. };
  384. },
  385. size: 'sm',
  386. resolve: {
  387. scope: function () {
  388. return $scope;
  389. }
  390. }
  391. });
  392. modalInstance.result.then(function (selectedItem) {
  393. if (selectedItem) {
  394. if (selectedItem.length > 0) {
  395. api_user_data.rmvData('user', selectedItem).then(function (response) {
  396. if (response.data) {
  397. SweetAlert.swal({
  398. title: "删除成功!",
  399. type: "success",
  400. confirmButtonColor: "#007AFF"
  401. }, function () {
  402. $scope.myData = _.reject($scope.myData, function (o) {
  403. return _.includes(selectedItem, o.id);
  404. });
  405. $scope.selected = {
  406. items: []
  407. };
  408. $scope.gridOptions.totalItems = $scope.gridOptions.totalItems - selectedItem.length;
  409. $scope.gridApi.grid.selection.selectedCount = 0;
  410. });
  411. } else {
  412. SweetAlert.swal({
  413. title: "操作异常!",
  414. text: "系统异常,请稍后重试,或者联系管理员!",
  415. type: "error"
  416. });
  417. }
  418. })
  419. }
  420. }
  421. })
  422. }
  423. $scope.selected = {
  424. items: []
  425. }
  426. $scope.editted = {
  427. items: []
  428. }
  429. $scope.gridOptions.onRegisterApi = function (gridApi) {
  430. $scope.gridApi = gridApi;
  431. // gridApi.edit.on.afterCellEdit($scope,function(rowEntity, colDef, newValue, oldValue){
  432. // // console.log(rowEntity);
  433. // });
  434. gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) {
  435. var filtersData = $scope.memoryfilterData;
  436. filtersData.idx = newPage - 1;
  437. filtersData.sum = pageSize;
  438. $scope.fileData.idx = newPage - 1;
  439. $scope.fileData.sum = pageSize;
  440. defaultFilterData = filtersData;
  441. $scope.refreshData('expand-right', $scope.fileData);
  442. });
  443. gridApi.selection.on.rowSelectionChanged($scope, function (scope) {
  444. var j = 0;
  445. for (var i = 0; i <= scope.grid.appScope.selected.items.length; i++) {
  446. if (scope.grid.appScope.selected.items[i] == scope.entity) {
  447. j++;
  448. break;
  449. }
  450. }
  451. // console.log("j="+j)
  452. if (j == 1) {
  453. scope.grid.appScope.selected.items.splice(i, 1);
  454. } else {
  455. scope.grid.appScope.selected.items.push(scope.entity)
  456. }
  457. });
  458. // gridApi.core.on.filterChanged($scope, function() {
  459. // var grid = this.grid;
  460. // var filtersData = {
  461. // idx: 0,
  462. // sum: 10
  463. // };
  464. // angular.forEach(grid.columns, function(item) {
  465. // if (item.enableFiltering) {
  466. // if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  467. // if (angular.isUndefined(filtersData['requester'])) {
  468. // filtersData['requester'] = {};
  469. // }
  470. // filtersData['requester'][item.field] = item.filters[0].term;
  471. // }
  472. // }
  473. // });
  474. // $scope.memoryfilterData = filtersData;
  475. // $scope.refreshData('expand-right', filtersData);
  476. // });
  477. gridApi.core.on.filterChanged($scope, function () {
  478. var grid = this.grid;
  479. // var filtersData = {
  480. // idx: 0,
  481. // sum: 10
  482. // };
  483. var filtersData = $scope.memoryfilterData;
  484. angular.forEach(grid.columns, function (item) {
  485. if (item.enableFiltering) {
  486. if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  487. if (angular.isUndefined(filtersData['user'])) {
  488. filtersData['user'] = {};
  489. filtersData['user']['flag'] = -1;
  490. filtersData['user'][item.field] = item.filters[0].term;
  491. } else {
  492. filtersData.user.flag = -1;
  493. filtersData.user[item.field] = item.filters[0].term;
  494. }
  495. // filtersData['user']['flag'] = -1;
  496. // filtersData['user'][item.field] = item.filters[0].term;
  497. }
  498. }
  499. });
  500. $scope.memoryfilterData = filtersData;
  501. $scope.refreshData('expand-right', $scope.fileData);
  502. });
  503. };
  504. var defaultFilterData = {
  505. "idx": 0,
  506. "sum": 10
  507. };
  508. $scope.memoryfilterData = {
  509. "idx": 0,
  510. "sum": 10
  511. }
  512. $scope.ldloading = {};
  513. $scope.fileData = {
  514. "idx": 0,
  515. "sum": 10,
  516. "user": {}
  517. }
  518. $scope.treeItem = "";
  519. $scope.onFilterCallback = function (item) {
  520. $scope.treeItem = item
  521. }
  522. // 搜索
  523. $scope.searchData = function () {
  524. if ($scope.treeItem) {
  525. $scope.fileData.user.groupdata = $scope.treeItem
  526. }
  527. if($scope.fileData.user.name){
  528. $scope.fileData.user.selectType= "pinyin_qs"
  529. }
  530. $scope.refreshData('expand-right', $scope.fileData);
  531. }
  532. // 清空
  533. $scope.clean = function () {
  534. delete $scope.fileData.user.account;
  535. delete $scope.fileData.user.name;
  536. delete $scope.fileData.user.groupdata;
  537. $scope.treeItem = "";
  538. $scope.try_async_load();
  539. $scope.refreshData('expand-right', $scope.fileData);
  540. }
  541. //刷新
  542. $scope.refresh = function (style, filterData) {
  543. $scope.selected = {
  544. items: []
  545. };
  546. if ($scope.gridApi) {
  547. // $scope.gridApi.grid.options.paginationCurrentPage = 0;
  548. $scope.gridApi.grid.selection.selectedCount = 0;
  549. }
  550. $scope.refreshData('expand-right', $scope.fileData);
  551. }
  552. //获取列表数据
  553. $scope.refreshData = function (style, filterData) {
  554. $scope.ldloading[style.replace('-', '_')] = true;
  555. if (angular.isUndefined(filterData)) {
  556. filterData = defaultFilterData;
  557. }
  558. if (angular.isDefined($scope.searchTypes)) {
  559. filterData['searchType'] = $scope.searchTypes;
  560. }
  561. $scope.myData = [];
  562. filterData['flag'] = -1;
  563. // if ($scope.gridApi) {
  564. // $scope.gridApi.grid.selection.selectedCount = 0;
  565. // $scope.selected = { items: [] };
  566. // }
  567. console.log("filterData=" + JSON.stringify(filterData))
  568. api_user_data.fetchDataList('user', filterData).then(function (data) {
  569. var myData = Restangular.stripRestangular(data);
  570. $scope.gridOptions.totalItems = myData.totalNum;
  571. $scope.myData = myData.list;
  572. for (var i = 0; i < $scope.myData.length; i++) {
  573. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  574. }
  575. $scope.ldloading[style.replace('-', '_')] = false;
  576. // console.log("$scope.myData="+JSON.stringify($scope.myData))
  577. }, function () {
  578. $scope.ldloading[style.replace('-', '_')] = false;
  579. });
  580. };
  581. $scope.refreshData2 = function (style, filterData) {
  582. $scope.ldloading[style.replace('-', '_')] = true;
  583. if (angular.isUndefined(filterData)) {
  584. filterData = defaultFilterData;
  585. }
  586. if (angular.isDefined($scope.searchTypes)) {
  587. filterData['searchType'] = $scope.searchTypes;
  588. }
  589. // $scope.myData = [];
  590. filterData['flag'] = -1;
  591. // if ($scope.gridApi) {
  592. // $scope.gridApi.grid.selection.selectedCount = 0;
  593. // $scope.selected = { items: [] };
  594. // }
  595. console.log("filterData=" + JSON.stringify(filterData))
  596. api_user_data.fetchDataList('user', filterData).then(function (data) {
  597. var myData = Restangular.stripRestangular(data);
  598. $scope.gridOptions.totalItems = myData.totalNum;
  599. $scope.myData = myData.list;
  600. for (var i = 0; i < $scope.myData.length; i++) {
  601. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  602. }
  603. $scope.ldloading[style.replace('-', '_')] = false;
  604. // console.log("$scope.myData="+JSON.stringify($scope.myData))
  605. }, function () {
  606. $scope.ldloading[style.replace('-', '_')] = false;
  607. });
  608. };
  609. $scope.refreshData('expand-right', $scope.fileData);
  610. $scope.timer = $interval(function () {
  611. $scope.refreshData2('expand-right', $scope.fileData);
  612. }, $rootScope.refreshTime);
  613. $scope.$on('$destroy', function () {
  614. $interval.cancel($scope.timer)
  615. });
  616. }]);