summaryCtrl.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. "use strict";
  2. /**
  3. * controller for User Profile Example
  4. */
  5. app.controller("summaryCtrl", [
  6. "$rootScope",
  7. "$scope",
  8. "$state",
  9. "$timeout",
  10. "$interval",
  11. "$modal",
  12. "SweetAlert",
  13. "i18nService",
  14. "uiGridConstants",
  15. "uiGridGroupingConstants",
  16. "Restangular",
  17. "api_bpm_schedule",
  18. "api_bpm_data",
  19. "api_wechatfile",
  20. "api_configure_data",
  21. "api_user_data",
  22. "moment",
  23. function (
  24. $rootScope,
  25. $scope,
  26. $state,
  27. $timeout,
  28. $interval,
  29. $modal,
  30. SweetAlert,
  31. i18nService,
  32. uiGridConstants,
  33. uiGridGroupingConstants,
  34. Restangular,
  35. api_bpm_schedule,
  36. api_bpm_data,
  37. api_wechatfile,
  38. api_configure_data,
  39. api_user_data,
  40. moment
  41. ) {
  42. $scope.langs = i18nService.getAllLangs();
  43. $scope.lang = "zh-cn";
  44. i18nService.setCurrentLang($scope.lang);
  45. var loginUser = $rootScope.user;
  46. $scope.chakan = false;
  47. $scope.shanchu = false;
  48. $scope.shenhe = false;
  49. for (var i = 0; i < loginUser.menu.length; i++) {
  50. if (loginUser.menu[i].link == "summary_chakan") {
  51. $scope.chakan = true;
  52. }
  53. if (loginUser.menu[i].link == "summary_shanchu") {
  54. $scope.shanchu = true;
  55. }
  56. if (loginUser.menu[i].link == "summary_shenhe") {
  57. $scope.shenhe = true;
  58. }
  59. }
  60. var defaultFilterData = {
  61. idx: 0,
  62. sum: 10,
  63. repairSummary:{}
  64. };
  65. var repairSummaryParameter = {
  66. idx: 0,
  67. sum: 10,
  68. operation: "",
  69. status: "",
  70. repairSummary: {},
  71. };
  72. //本地存储
  73. sessionStorage.repairSummaryParameter = JSON.stringify(repairSummaryParameter);
  74. $scope.memoryfilterData = {
  75. idx: 0,
  76. sum: 10,
  77. };
  78. // $scope.isMask = false;
  79. $scope.gridOptions = {};
  80. $scope.gridOptions.data = "myData";
  81. $scope.gridOptions.enableColumnResizing = true;
  82. $scope.gridOptions.enableFiltering = false;
  83. $scope.gridOptions.enableGridMenu = true;
  84. $scope.gridOptions.enableRowSelection = true;
  85. $scope.gridOptions.showGridFooter = true;
  86. $scope.gridOptions.showColumnFooter = false;
  87. $scope.gridOptions.useExternalFiltering = false;
  88. $scope.gridOptions.useExternalPagination = true;
  89. $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
  90. $scope.gridOptions.paginationPageSize = 10;
  91. $scope.gridOptions.multiSelect = true;
  92. $scope.gridOptions.enableSelectionBatchEvent = true; //使用批量使用事件
  93. //行鼠标悬浮变色功能
  94. // $scope.gridOptions.rowTemplate = '<div ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.uid" ng-mouseover="grid.appScope.hoveredIndex = rowRenderIndex" ng-mouseleave="grid.appScope.hoveredIndex = null" ui-grid-one-bind-id-grid="rowRenderIndex + \'-\' + col.uid + \'-cell\'" class="ui-grid-cell" ng-class="{\'ui-grid-row-header-cell\': col.isRowHeader, \'your-hover-class\': grid.appScope.hoveredIndex === rowRenderIndex}" role="{{col.isRowHeader ? \'rowheader\' : \'gridcell\'}}" ui-grid-cell></div>';
  95. $scope.gridOptions.rowTemplate =
  96. '<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>';
  97. $scope.gridOptions.rowIdentity = function (row) {
  98. return row.id;
  99. };
  100. $scope.gridOptions.getRowIdentity = function (row) {
  101. return row.id;
  102. };
  103. $scope.transfer = function (status) {
  104. if (status === "正常") {
  105. return "执行中";
  106. } else if (status === "停止") {
  107. return "暂停中";
  108. }
  109. };
  110. $scope.searchkeys = {};
  111. $scope.endOpen = function ($event) {
  112. $event.preventDefault();
  113. $event.stopPropagation();
  114. $scope.startOpened = false;
  115. $scope.endOpened = !$scope.endOpened;
  116. };
  117. $scope.startOpen = function ($event) {
  118. $event.preventDefault();
  119. $event.stopPropagation();
  120. $scope.endOpened = false;
  121. $scope.startOpened = !$scope.startOpened;
  122. };
  123. //受理人,处理人
  124. var getUser = function (fieldatas) {
  125. api_user_data.fetchDataList('user', fieldatas).then(function (data) {
  126. $scope.handlingPersonnelUser = data.list;
  127. });
  128. }
  129. //处理人过滤
  130. $scope.onChangehandling = function (key = "") {
  131. var filuser = {
  132. "idx": 0,
  133. "sum": 10,
  134. "user": {
  135. "name": key,
  136. 'selectType': "pinyin_qs",
  137. engineer: 1,
  138. }
  139. }
  140. getUser(filuser);
  141. }
  142. //状态
  143. $scope.state = [];
  144. $scope.getStatus = function(){
  145. $scope.state = [
  146. {id: 1, name: '暂存'},
  147. {id: 2, name: '未审核'},
  148. {id: 3, name: '审核通过'},
  149. ]
  150. }
  151. $scope.getStatus();
  152. $scope.gridOptions.columnDefs = [
  153. {
  154. name: "item",
  155. displayName: "序号",
  156. width: 50,
  157. enableFiltering: false,
  158. },
  159. {
  160. name: "incidentSign",
  161. displayName: "事件单号",
  162. width: "10%",
  163. enableFiltering: false,
  164. },
  165. {
  166. name: "description",
  167. displayName: "故障描述",
  168. width: "400",
  169. enableFiltering: false,
  170. // cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.planStartTime.length>16?grid.appScope.transferTime(row.entity.planStartTime):row.entity.planStartTime}}</div>'
  171. },
  172. {
  173. name: "maintainer",
  174. displayName: "维修人",
  175. width: "10%",
  176. enableFiltering: false,
  177. cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.maintainer ? row.entity.maintainer.name : ""}}</div>'
  178. },
  179. {
  180. name: "totalMaintenancePrice",
  181. displayName: "维修总价",
  182. width: "10%",
  183. enableFiltering: false,
  184. cellTemplate: '<div class="ui-grid-cell-contents">{{row.entity.totalMaintenancePrice || 0}}元</div>'
  185. },
  186. {
  187. name: "createTime",
  188. displayName: "生成时间",
  189. width: "11%",
  190. enableFiltering: false,
  191. cellTemplate: '<div class="ui-grid-cell-contents">{{ grid.appScope.transferTime(row.entity.createTime) }}</div>'
  192. },
  193. {
  194. name: "state",
  195. displayName: "状态",
  196. width: "6%",
  197. enableFiltering: false,
  198. cellTemplate:
  199. '<div class="ui-grid-cell-contents"><span ng-if="row.entity.state == 1">暂存</span><span ng-if="row.entity.state == 2">未审核</span><span ng-if="row.entity.state == 3">审核通过</span></div>',
  200. },
  201. {
  202. minWidth: "230",
  203. name: "操作",
  204. enableFiltering: false,
  205. cellTemplate:
  206. '<div class="cl-effect-1 ui-grid-cell-contents pull-left">' +
  207. '<a ng-click="grid.appScope.seeFunction(row.entity)" ng-if="grid.appScope.chakan" class="bianjifont">查看</a>' +
  208. '<a ng-click="grid.appScope.removeData(row.entity)" ng-if="grid.appScope.shanchu" class="bianjifont">删除</a>' +
  209. '<a ng-click="grid.appScope.runFunction(row.entity)" ng-if="grid.appScope.shenhe && row.entity.state == 2" class="bianjifont">审核通过</a>' +
  210. "</div>",
  211. },
  212. // { name: 'planTime2', displayName: '截止时间', width: 160, enableFiltering: false },
  213. ];
  214. $scope.transferTime = function (time) {
  215. if(time){
  216. return moment(time).format("YYYY-MM-DD HH:mm");
  217. }else{
  218. return '';
  219. }
  220. };
  221. $scope.inspectdata = {};
  222. //跳转到查看列表
  223. $scope.seeFunction = function (data) {
  224. console.log(data)
  225. $state.go("app.incident.summaryDetail", {
  226. incidentId: data.incidentId,
  227. id: data.id,
  228. });
  229. };
  230. //审核通过
  231. $scope.runFunction = function (data) {
  232. var modalInstance = $modal.open({
  233. // templateUrl: 'assets/views/inspect/changRun.html',
  234. templateUrl: "assets/views/delete.html",
  235. // size: "sm",
  236. controller: function ($scope, $modalInstance) {
  237. $scope.isRunFunction = true;
  238. var status = "";
  239. $scope.title = "审核通过";
  240. $scope.connect = "确定要审核通过?";
  241. $scope.ok = function () {
  242. $modalInstance.close(data);
  243. };
  244. $scope.cancel = function () {
  245. $modalInstance.dismiss("cancel");
  246. };
  247. },
  248. size: "sm",
  249. });
  250. modalInstance.result.then(function (result) {
  251. if (result) {
  252. var toData = {
  253. summaryId: result.id,
  254. };
  255. api_bpm_data.approved(toData).then(
  256. function (response) {
  257. var myData = Restangular.stripRestangular(response);
  258. if (myData.status == 200) {
  259. $scope.refreshData("expand-right", $scope.fileData);
  260. }
  261. },
  262. function () {
  263. // $scope.ldloading[style.replace('-', '_')] = false;
  264. }
  265. );
  266. }
  267. });
  268. };
  269. //行删除
  270. $scope.removeData = function (item) {
  271. console.log($scope.selected.items);
  272. var rmDatas = [item] || $scope.selected.items;
  273. var modalInstance = $modal.open({
  274. templateUrl: "assets/views/delete.html",
  275. controller: function ($scope, $modalInstance) {
  276. $scope.title = "删除";
  277. $scope.connect = "确定要删除?";
  278. $scope.ok = function () {
  279. $modalInstance.close("start");
  280. };
  281. $scope.cancel = function () {
  282. $modalInstance.dismiss("cancel");
  283. };
  284. },
  285. size: "sm",
  286. });
  287. modalInstance.result.then(
  288. function (result) {
  289. if (result) {
  290. if (rmDatas.length != 0) {
  291. $rootScope.isMask = true;
  292. }
  293. var rmvList = [];
  294. angular.forEach(rmDatas, function (item) {
  295. rmvList.push(item.id);
  296. });
  297. if (rmvList.length > 0) {
  298. api_bpm_data
  299. .rmvData("repairSummary", rmvList)
  300. .then(function (response) {
  301. if (response.status == 200) {
  302. $rootScope.isMask = false;
  303. SweetAlert.swal(
  304. {
  305. title: "删除成功!",
  306. type: "success",
  307. confirmButtonColor: "#007AFF",
  308. },
  309. function () {
  310. $scope.myData = _.reject($scope.myData, function (o) {
  311. return _.includes(rmvList, o.id);
  312. });
  313. $scope.selected = {
  314. items: [],
  315. };
  316. }
  317. );
  318. $scope.gridApi.selection.clearSelectedRows();
  319. $scope.refreshData("expand-right", $scope.fileData);
  320. //取消遮罩层
  321. // $scope.isMask = false;
  322. } else {
  323. $rootScope.isMask = false;
  324. SweetAlert.swal({
  325. title: "操作异常!",
  326. text: "系统异常,请稍后重试,或者联系管理员!",
  327. type: "error",
  328. });
  329. }
  330. });
  331. }
  332. }
  333. },
  334. function () {
  335. // $scope.ldloading[style.replace('-', '_')] = false;
  336. }
  337. );
  338. };
  339. $scope.selected = {
  340. items: [],
  341. };
  342. $scope.editted = {
  343. items: [],
  344. };
  345. $scope.testRow = [];
  346. $scope.gridOptions.onRegisterApi = function (gridApi) {
  347. //导入gridApi对象
  348. $scope.gridApi = gridApi;
  349. //分页选项
  350. gridApi.pagination.on.paginationChanged(
  351. $scope,
  352. function (newPage, pageSize) {
  353. var filterData = JSON.parse(sessionStorage.repairSummaryParameter);
  354. var filtersData = {};
  355. filtersData.idx = newPage - 1;
  356. filtersData.sum = pageSize;
  357. $scope.pageNum = $scope.gridApi.pagination.getPage() - 1;
  358. // console.log(pp);
  359. filterData.idx = $scope.pageNum;
  360. $scope.fileData.idx = newPage - 1;
  361. $scope.fileData.sum = pageSize;
  362. sessionStorage.repairSummaryParameter = JSON.stringify(filterData);
  363. $scope.refreshData("expand-right", $scope.fileData);
  364. }
  365. );
  366. //勾选行事件
  367. gridApi.selection.on.rowSelectionChanged($scope, function (data) {
  368. if (data.isSelected) {
  369. $scope.selected.items.push(data.entity);
  370. } else {
  371. //objs:需要遍历的集合 data:遍历时当前的数据 index:遍历时当前索引
  372. //array:需要遍历的集合,每次遍历时都会把objs原样的传一次。
  373. //angular.forEach(objs, function(data,index,array)
  374. angular.forEach(
  375. $scope.selected.items,
  376. function (ObjIndex, index, destObj) {
  377. // console.log(ObjIndex);
  378. // console.log(index);
  379. // console.log(destObj);
  380. if (ObjIndex.id == data.entity.id) {
  381. destObj.splice(index, 1);
  382. }
  383. }
  384. );
  385. }
  386. });
  387. //批量全选
  388. gridApi.selection.on.rowSelectionChangedBatch(
  389. $scope,
  390. function (rows, event) {
  391. // if ($scope.selected.items.length != 0) {
  392. // $scope.selected.items = [];
  393. angular.forEach(rows, function (ObjIndex, index, destObj) {
  394. if (ObjIndex.isSelected) {
  395. $scope.selected.items.push(ObjIndex.entity);
  396. } else {
  397. $scope.selected.items = [];
  398. // $scope.selected.items.splice(index, 1);
  399. }
  400. });
  401. // } else {
  402. // }
  403. // $scope.mySelectedRows = $scope.gridApi.selection.getSelectedRows();
  404. // if ($scope.selected.items.length == 0) {
  405. // $scope.selected.items = $scope.mySelectedRows;
  406. // } else if ($scope.mySelectedRows.length == 0) {
  407. // for (var i = 0; i < $scope.selected.items.length; i++) {
  408. // for (var j = 0; j < rows.length; j++) {
  409. // if ($scope.selected.items[i].id == rows[j].entity.id) {
  410. // $scope.selected.items.splice(i, 1);
  411. // }
  412. // }
  413. // }
  414. // } else {
  415. // angular.forEach($scope.mySelectedRows, function(item) {
  416. // $scope.selected.items.push(item);
  417. // });
  418. // }
  419. }
  420. );
  421. //列过滤事件
  422. gridApi.core.on.filterChanged($scope, function () {
  423. var grid = this.grid;
  424. var filterData = JSON.parse(sessionStorage.repairSummaryParameter);
  425. angular.forEach(grid.columns, function (item) {
  426. if (item.enableFiltering) {
  427. if (
  428. angular.isDefined(item.filters[0].term) &&
  429. item.filters[0].term != ""
  430. ) {
  431. if (angular.isUndefined(filterData["repairSummary"])) {
  432. filterData["repairSummary"] = {};
  433. }
  434. filterData["repairSummary"]["title"] = item.filters[0].term;
  435. }
  436. }
  437. });
  438. sessionStorage.repairSummaryParameter = JSON.stringify(filterData);
  439. $scope.refreshData("expand-right", filterData);
  440. });
  441. };
  442. // 重置
  443. $scope.clear = function () {
  444. $scope.searchkeys = {};
  445. $scope.refreshData('expand-right');
  446. }
  447. //数据刷新
  448. $scope.refreshData = function (style, filterData) {
  449. $scope.ldloading[style.replace("-", "_")] = true;
  450. if (angular.isUndefined(filterData)) {
  451. filterData = defaultFilterData;
  452. }
  453. $scope.myData = [];
  454. if($rootScope.user.duty){
  455. filterData.repairSummary.dutyId = $rootScope.user.duty.id;
  456. }else if($rootScope.user.branch){
  457. filterData.repairSummary.branch = $rootScope.user.branch.id;
  458. }
  459. console.log($scope.searchkeys)
  460. Object.assign(filterData.repairSummary, {
  461. incidentSign: $scope.searchkeys.incidentSign || undefined,
  462. startTime: $scope.searchkeys.startTime ? moment($scope.searchkeys.startTime).startOf('day').format('YYYY-MM-DD HH:mm:ss') : undefined,
  463. endTime: $scope.searchkeys.endTime ? moment($scope.searchkeys.endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss') : undefined,
  464. state: $scope.searchkeys.state ? $scope.searchkeys.state.id : undefined,
  465. maintainer: $scope.searchkeys.maintainer || undefined,
  466. })
  467. api_bpm_data.fetchDataList("repairSummary", filterData).then(
  468. function (data) {
  469. var myData = Restangular.stripRestangular(data);
  470. $scope.gridOptions.totalItems = myData.totalNum;
  471. if (angular.isArray(myData.list)) {
  472. $scope.myData = myData.list;
  473. for (var i = 0; i < $scope.myData.length; i++) {
  474. $scope.myData[i]["item"] =
  475. i + 1 + filterData.idx * filterData.sum;
  476. if ($scope.myData[i].doing + $scope.myData[i].completed != 0) {
  477. $scope.myData[i].percent = (
  478. ($scope.myData[i].completed * 100) /
  479. ($scope.myData[i].doing + $scope.myData[i].completed)
  480. ).toFixed(1);
  481. } else if ($scope.myData[i].completed == 0) {
  482. $scope.myData[i].percent = "0.0";
  483. } else {
  484. $scope.myData[i].percent = "0.0";
  485. }
  486. }
  487. console.log($scope.myData);
  488. for (var i = 0; i < $scope.myData.length; i++) {
  489. if ($scope.myData[i].status == "正常") {
  490. $scope.myData[i].style = "fa fa-play";
  491. } else if ($scope.myData[i].status == "停止") {
  492. $scope.myData[i].style = "fa fa-pause";
  493. }
  494. $scope.myData[i].runStatus = $scope.transfer(
  495. $scope.myData[i].status
  496. );
  497. }
  498. } else {
  499. SweetAlert.swal({
  500. title: "数据为空",
  501. text: myData.data,
  502. type: "warning",
  503. });
  504. }
  505. $scope.ldloading[style.replace("-", "_")] = false;
  506. },
  507. function () {
  508. $scope.ldloading[style.replace("-", "_")] = false;
  509. }
  510. );
  511. };
  512. $scope.refreshData2 = function (style, filterData) {
  513. $scope.ldloading[style.replace("-", "_")] = true;
  514. if (angular.isUndefined(filterData)) {
  515. filterData = defaultFilterData;
  516. }
  517. // $scope.myData = [];
  518. if($rootScope.user.duty){
  519. filterData.repairSummary.dutyId = $rootScope.user.duty.id;
  520. }else if($rootScope.user.branch){
  521. filterData.repairSummary.branch = $rootScope.user.branch.id;
  522. }
  523. Object.assign(filterData.repairSummary, {
  524. incidentSign: $scope.searchkeys.incidentSign || undefined,
  525. startTime: $scope.searchkeys.startTime ? moment($scope.searchkeys.startTime).startOf('day').format('YYYY-MM-DD HH:mm:ss') : undefined,
  526. endTime: $scope.searchkeys.endTime ? moment($scope.searchkeys.endTime).endOf('day').format('YYYY-MM-DD HH:mm:ss') : undefined,
  527. state: $scope.searchkeys.state ? $scope.searchkeys.state.id : undefined,
  528. maintainer: $scope.searchkeys.maintainer || undefined,
  529. })
  530. api_bpm_data.fetchDataList("repairSummary", filterData).then(
  531. function (data) {
  532. var myData = Restangular.stripRestangular(data);
  533. $scope.gridOptions.totalItems = myData.totalNum;
  534. if (angular.isArray(myData.list)) {
  535. $scope.myData = myData.list;
  536. for (var i = 0; i < $scope.myData.length; i++) {
  537. $scope.myData[i]["item"] =
  538. i + 1 + filterData.idx * filterData.sum;
  539. if ($scope.myData[i].doing + $scope.myData[i].completed != 0) {
  540. $scope.myData[i].percent = (
  541. ($scope.myData[i].completed * 100) /
  542. ($scope.myData[i].doing + $scope.myData[i].completed)
  543. ).toFixed(1);
  544. } else if ($scope.myData[i].completed == 0) {
  545. $scope.myData[i].percent = "0.0";
  546. } else {
  547. $scope.myData[i].percent = "0.0";
  548. }
  549. }
  550. console.log($scope.myData);
  551. for (var i = 0; i < $scope.myData.length; i++) {
  552. if ($scope.myData[i].status == "正常") {
  553. $scope.myData[i].style = "fa fa-play";
  554. } else if ($scope.myData[i].status == "停止") {
  555. $scope.myData[i].style = "fa fa-pause";
  556. }
  557. $scope.myData[i].runStatus = $scope.transfer(
  558. $scope.myData[i].status
  559. );
  560. }
  561. } else {
  562. SweetAlert.swal({
  563. title: "数据为空",
  564. text: myData.data,
  565. type: "warning",
  566. });
  567. }
  568. $scope.ldloading[style.replace("-", "_")] = false;
  569. },
  570. function () {
  571. $scope.ldloading[style.replace("-", "_")] = false;
  572. }
  573. );
  574. };
  575. $scope.ldloading = {};
  576. $scope.fileData = {
  577. idx: 0,
  578. sum: 10,
  579. repairSummary: {},
  580. };
  581. $scope.inspecttype = {};
  582. $scope.searchinspe = function (item) {
  583. $scope.refreshData("expand-right", $scope.fileData);
  584. };
  585. $scope.refresh = function () {
  586. var jry_filterData = JSON.parse(sessionStorage.repairSummaryParameter);
  587. var intervalData = {};
  588. intervalData.idx = jry_filterData.idx;
  589. intervalData.sum = jry_filterData.sum;
  590. intervalData.repairSummary = $scope.inspectdata;
  591. $scope.refreshData("expand-right", intervalData);
  592. };
  593. $scope.refreshData("expand-right", $scope.fileData);
  594. $scope.timer = $interval(function () {
  595. $scope.refreshData2("expand-right", $scope.fileData);
  596. }, $rootScope.refreshTime);
  597. $scope.$on("$destroy", function () {
  598. $interval.cancel($scope.timer);
  599. });
  600. },
  601. ]);