adminUserCtrl.js 24 KB

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