adminUserCtrl.js 24 KB

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