commonFaultSymptomsCtrl.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. "use strict";
  2. /**
  3. * controller for User Profile Example
  4. */
  5. app.controller("commonFaultSymptomslistCtrl", [
  6. "$rootScope",
  7. "$scope",
  8. "$state",
  9. "$timeout",
  10. "$interval",
  11. "$modal",
  12. "SweetAlert",
  13. "i18nService",
  14. "uiGridConstants",
  15. "uiGridGroupingConstants",
  16. "Restangular",
  17. "api_user_data",
  18. 'api_bpm_data',
  19. function (
  20. $rootScope,
  21. $scope,
  22. $state,
  23. $timeout,
  24. $interval,
  25. $modal,
  26. SweetAlert,
  27. i18nService,
  28. uiGridConstants,
  29. uiGridGroupingConstants,
  30. Restangular,
  31. api_user_data,
  32. api_bpm_data
  33. ) {
  34. $scope.langs = i18nService.getAllLangs();
  35. $scope.lang = "zh-cn";
  36. i18nService.setCurrentLang($scope.lang);
  37. var loginUser = $rootScope.user;
  38. $scope.xinzeng = false;
  39. $scope.shanchu = false;
  40. $scope.bianji = false;
  41. for (var i = 0; i < loginUser.menu.length; i++) {
  42. if (loginUser.menu[i].link == "responsibilityDept_add") {
  43. $scope.xinzeng = true;
  44. }
  45. if (loginUser.menu[i].link == "responsibilityDept_del") {
  46. $scope.shanchu = true;
  47. }
  48. if (loginUser.menu[i].link == "responsibilityDept_edit") {
  49. $scope.bianji = true;
  50. }
  51. }
  52. $scope.gridOptions = {};
  53. $scope.gridOptions.data = "myData";
  54. $scope.gridOptions.enableColumnResizing = true;
  55. $scope.gridOptions.enableFiltering = true;
  56. $scope.gridOptions.enableGridMenu = true;
  57. $scope.gridOptions.enableRowSelection = true;
  58. $scope.gridOptions.showGridFooter = true;
  59. $scope.gridOptions.showColumnFooter = false;
  60. $scope.gridOptions.fastWatch = true;
  61. $scope.gridOptions.useExternalFiltering = true;
  62. $scope.gridOptions.useExternalPagination = true;
  63. $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
  64. $scope.gridOptions.paginationPageSize = 10;
  65. $scope.gridOptions.multiSelect = false;
  66. $scope.gridOptions.rowTemplate =
  67. '<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>';
  68. $scope.gridOptions.rowIdentity = function (row) {
  69. return row.id;
  70. };
  71. $scope.gridOptions.getRowIdentity = function (row) {
  72. return row.id;
  73. };
  74. $scope.gridOptions.columnDefs = [
  75. {
  76. name: "item",
  77. displayName: "序号",
  78. width: 50,
  79. enableFiltering: false,
  80. },
  81. {
  82. name: "content",
  83. displayName: "别名",
  84. width: "30%",
  85. enableFiltering: false,
  86. },
  87. {
  88. name: "category.category",
  89. displayName: "故障现象",
  90. width: "30%",
  91. enableFiltering: false,
  92. },
  93. {
  94. name: "操作",
  95. cellTemplate:
  96. '<div><div class="cl-effect-1 ui-grid-cell-contents pull-left" >' +
  97. // '<a ng-click="grid.appScope.saveData(row.entity)" tooltip="编辑" tooltip-placement="right">' +
  98. // '<i class="fa fa-pencil-square-o"></i></a>'+
  99. '<a ng-click="grid.appScope.saveData(row.entity)" ng-show="grid.appScope.bianji" class="bianjifont">编辑</a>' +
  100. "</div></div>",
  101. enableFiltering: false,
  102. },
  103. ];
  104. $scope.transferDept = function (data) {
  105. if (data) {
  106. return data;
  107. } else {
  108. return "无";
  109. }
  110. };
  111. function selectItem(pmodel, childrens) {
  112. if (angular.isArray(pmodel)) {
  113. angular.forEach(pmodel, function (index) {
  114. if (index && index.id) {
  115. angular.forEach(childrens, function (item) {
  116. if (item.id == index.id) {
  117. item.selected = true;
  118. }
  119. if (item && item.children) {
  120. selectItem(pmodel, item.children);
  121. }
  122. });
  123. }
  124. });
  125. } else {
  126. if (pmodel && pmodel.id) {
  127. angular.forEach(childrens, function (item, index) {
  128. if (item.id == pmodel.id) {
  129. item.selected = true;
  130. }
  131. if (item && item.children) {
  132. selectItem(pmodel, item.children);
  133. }
  134. });
  135. }
  136. }
  137. }
  138. $scope.saveData = function (selectdata) {
  139. console.log(selectdata);
  140. var modalInstance = $modal.open({
  141. templateUrl: "assets/views/system/tpl/commonFaultSymptomschange.html",
  142. controller: function ($scope, scope, $modalInstance, api_user_data,api_bpm_data) {
  143. selectdata.category.selected = true;
  144. $scope.deptdata = {
  145. id: selectdata.id,
  146. content: selectdata.content,
  147. category: selectdata.category
  148. };
  149. $scope.categoryList = [];
  150. $scope.title = "常用故障现象修改";
  151. // --------------------
  152. $scope.select_treedata = [];
  153. $scope.try_async_load = function (s, fn) {
  154. if (s) {
  155. var filterKeyword = s.filterKeyword;
  156. }
  157. var postData = {
  158. idx: 0,
  159. sum: 1000,
  160. };
  161. if (filterKeyword) {
  162. postData.incidentcategory = {
  163. selectType: "pinyin_qs",
  164. category: filterKeyword,
  165. };
  166. }
  167. $scope.my_data = [];
  168. $scope.doing_async = true;
  169. api_bpm_data
  170. .fetchDataList("incidentcategory", postData)
  171. .then(function (response) {
  172. if (response.status == 200) {
  173. var data = response.list;
  174. if (filterKeyword) {
  175. data.forEach((e) => {
  176. e.isExpanded = true;
  177. });
  178. var li = transform(data).children;
  179. console.log(li);
  180. fn(li);
  181. return;
  182. } else {
  183. var objects = [];
  184. for (var i = 0; i < data.length; i++) {
  185. var object = {};
  186. object.id = data[i].id;
  187. object.parent = data[i].parent;
  188. object.category = data[i].category;
  189. object.isExpanded = true;
  190. objects.push(object);
  191. }
  192. $scope.my_data = convertParentToChildList(objects);
  193. $scope.select_treedata = angular.copy($scope.my_data);
  194. }
  195. if ($scope.my_data.length > 0) {
  196. $scope.doing_async = false;
  197. }
  198. selectItem(selectdata.category,$scope.select_treedata);
  199. $scope.deptdata.category = selectdata.category;
  200. } else {
  201. SweetAlert.swal({
  202. title: "系统错误!",
  203. text: "请刷新重试!",
  204. type: "error",
  205. });
  206. }
  207. });
  208. };
  209. $scope.try_async_load();
  210. // --------------------
  211. $scope.cancel = function () {
  212. $modalInstance.dismiss("cancel");
  213. };
  214. // 保存
  215. $scope.savercode = function (deptdata) {
  216. if (
  217. deptdata &&
  218. deptdata.content &&
  219. deptdata.category
  220. ) {
  221. var fildata = {
  222. incidentCategoryContent: {
  223. id: deptdata.id,
  224. deleteFlag: 0,
  225. content: deptdata.content,
  226. category: deptdata.category,
  227. },
  228. };
  229. api_user_data
  230. .updData("incidentCategoryContent", fildata)
  231. .then(function (response) {
  232. if (response) {
  233. if (response.status == 200) {
  234. SweetAlert.swal(
  235. {
  236. title: "修改成功!",
  237. type: "success",
  238. },
  239. function () {
  240. scope.refreshData("expand-right", scope.fileData);
  241. }
  242. );
  243. } else if (response.status == 500) {
  244. SweetAlert.swal(
  245. {
  246. title: "修改失败!",
  247. text: "该故障现象已存在",
  248. type: "error",
  249. },
  250. function () {
  251. scope.refreshData("expand-right", scope.fileData);
  252. }
  253. );
  254. } else {
  255. SweetAlert.swal(
  256. {
  257. title: "修改失败!",
  258. type: "error",
  259. },
  260. function () {
  261. scope.refreshData("expand-right", scope.fileData);
  262. }
  263. );
  264. }
  265. $modalInstance.close();
  266. } else {
  267. SweetAlert.swal(
  268. {
  269. title: "修改失败!",
  270. type: "error",
  271. },
  272. function () {
  273. scope.refreshData("expand-right", scope.fileData);
  274. }
  275. );
  276. }
  277. });
  278. } else {
  279. SweetAlert.swal(
  280. {
  281. title: "修改失败!",
  282. text: "请填写必填项!",
  283. type: "error",
  284. confirmButtonColor: "#DD6B55",
  285. },
  286. function () {}
  287. );
  288. }
  289. };
  290. },
  291. resolve: {
  292. scope: function () {
  293. return $scope;
  294. },
  295. },
  296. });
  297. };
  298. function convertListToTree(data, treeMap) {
  299. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  300. var root = null; //Initially set our loop to null
  301. var parentNode = null;
  302. //loop over data
  303. for (var i = 0; i < data.length; i++) {
  304. var datum = data[i];
  305. //each node will have children, so let's give it a "children" poperty
  306. datum.children = [];
  307. //add an entry for this node to the map so that any future children can
  308. //lookup the parent
  309. idToNodeMap[datum.id] = datum;
  310. //Does this node have a parent?
  311. if (typeof datum.parent === "undefined" || datum.parent == null) {
  312. //Doesn't look like it, so this node is the root of the tree
  313. root = datum;
  314. treeMap[datum.id] = root;
  315. } else {
  316. //This node has a parent, so let's look it up using the id
  317. parentNode = idToNodeMap[datum.parent.id];
  318. //We don't need this property, so let's delete it.
  319. delete datum.parent;
  320. //Let's add the current node as a child of the parent node.
  321. parentNode.children.push(datum);
  322. }
  323. }
  324. return root;
  325. }
  326. function convertParentToChildList(data) {
  327. var treeMap = {};
  328. var list = [];
  329. convertListToTree(data, treeMap);
  330. angular.forEach(treeMap, function (item) {
  331. list.push(item);
  332. });
  333. return list;
  334. }
  335. $scope.addData = function () {
  336. var modalInstance = $modal.open({
  337. templateUrl: "assets/views/system/tpl/commonFaultSymptomschange.html",
  338. controller: function ($scope, $modalInstance, api_user_data,api_bpm_data) {
  339. $scope.deptdata = {
  340. content: "",
  341. category: "",
  342. };
  343. $scope.title = "常用故障现象新增";
  344. // --------------------
  345. $scope.select_treedata = [];
  346. $scope.try_async_load = function (s, fn) {
  347. if (s) {
  348. var filterKeyword = s.filterKeyword;
  349. }
  350. var postData = {
  351. idx: 0,
  352. sum: 1000,
  353. };
  354. if (filterKeyword) {
  355. postData.incidentcategory = {
  356. selectType: "pinyin_qs",
  357. category: filterKeyword,
  358. };
  359. }
  360. $scope.my_data = [];
  361. $scope.doing_async = true;
  362. api_bpm_data
  363. .fetchDataList("incidentcategory", postData)
  364. .then(function (response) {
  365. if (response.status == 200) {
  366. var data = response.list;
  367. if (filterKeyword) {
  368. data.forEach((e) => {
  369. e.isExpanded = true;
  370. });
  371. var li = transform(data).children;
  372. console.log(li);
  373. fn(li);
  374. return;
  375. } else {
  376. var objects = [];
  377. for (var i = 0; i < data.length; i++) {
  378. var object = {};
  379. object.id = data[i].id;
  380. object.parent = data[i].parent;
  381. object.category = data[i].category;
  382. object.isExpanded = true;
  383. objects.push(object);
  384. }
  385. $scope.my_data = convertParentToChildList(objects);
  386. $scope.select_treedata = angular.copy($scope.my_data);
  387. }
  388. if ($scope.my_data.length > 0) {
  389. $scope.doing_async = false;
  390. }
  391. } else {
  392. SweetAlert.swal({
  393. title: "系统错误!",
  394. text: "请刷新重试!",
  395. type: "error",
  396. });
  397. }
  398. });
  399. };
  400. $scope.try_async_load();
  401. // --------------------
  402. $scope.cancel = function () {
  403. $modalInstance.dismiss("cancel");
  404. };
  405. // 保存
  406. $scope.savercode = function (deptdata) {
  407. if (
  408. deptdata &&
  409. deptdata.content &&
  410. deptdata.category
  411. ) {
  412. $modalInstance.close(deptdata);
  413. } else {
  414. SweetAlert.swal(
  415. {
  416. title: "新增失败!",
  417. text: "请填写必填项!",
  418. type: "error",
  419. confirmButtonColor: "#DD6B55",
  420. },
  421. function () {}
  422. );
  423. }
  424. };
  425. },
  426. });
  427. modalInstance.result.then(function (selectedItem) {
  428. if (selectedItem.content && selectedItem.category) {
  429. var fildata = {
  430. incidentCategoryContent: {
  431. content: selectedItem.content,
  432. category: selectedItem.category,
  433. },
  434. };
  435. api_user_data
  436. .addData("incidentCategoryContent", fildata)
  437. .then(function (response) {
  438. if (response) {
  439. if (response.status == 200) {
  440. SweetAlert.swal(
  441. {
  442. title: "新增成功!",
  443. type: "success",
  444. },
  445. function () {
  446. $scope.refreshData("expand-right", $scope.fileData);
  447. }
  448. );
  449. } else {
  450. SweetAlert.swal({
  451. title: "新增失败!",
  452. text: response.msg,
  453. type: "error",
  454. });
  455. }
  456. }
  457. });
  458. } else {
  459. SweetAlert.swal(
  460. {
  461. title: "新增失败!",
  462. text: "请填写必填项!",
  463. type: "error",
  464. confirmButtonColor: "#DD6B55",
  465. },
  466. function () {}
  467. );
  468. }
  469. });
  470. };
  471. $scope.removeData = function () {
  472. var modalInstance = $modal.open({
  473. // templateUrl: 'assets/views/delete.html',
  474. templateUrl: "assets/views/incident/tpl/acceptTask.tpl.html",
  475. controller: function ($scope, scope, $modalInstance, api_bpm_data) {
  476. var rmvList = [];
  477. $scope.title = "故障现象删除";
  478. $scope.connect = "确定要删除此故障现象?";
  479. rmvList.push(scope.selected.items);
  480. $scope.ok = function () {
  481. $modalInstance.close(rmvList);
  482. // }
  483. };
  484. $scope.cancel = function () {
  485. $modalInstance.dismiss("cancel");
  486. };
  487. },
  488. size: "sm",
  489. resolve: {
  490. scope: function () {
  491. return $scope;
  492. },
  493. },
  494. });
  495. modalInstance.result.then(function (selectedItem) {
  496. if (selectedItem) {
  497. if (selectedItem.length > 0) {
  498. console.log(selectedItem);
  499. if (
  500. selectedItem[0].children &&
  501. selectedItem[0].children.length > 0
  502. ) {
  503. SweetAlert.swal({
  504. title: "该部门存在子类部门",
  505. text: "请先删除该部门子类部门!",
  506. type: "error",
  507. });
  508. } else {
  509. api_user_data
  510. .rmvData("incidentCategoryContent", [selectedItem[0].id])
  511. .then(function (response) {
  512. if (response.status == 200) {
  513. SweetAlert.swal(
  514. {
  515. title: "删除成功!",
  516. type: "success",
  517. confirmButtonColor: "#007AFF",
  518. },
  519. function () {
  520. $scope.myData = _.reject($scope.myData, function (o) {
  521. return _.includes(selectedItem, o.id);
  522. });
  523. $scope.selected = {
  524. items: [],
  525. };
  526. $scope.gridOptions.totalItems =
  527. $scope.gridOptions.totalItems - selectedItem.length;
  528. $scope.gridApi.grid.selection.selectedCount = 0;
  529. $scope.refreshData("expand-right", $scope.fileData);
  530. }
  531. );
  532. } else {
  533. SweetAlert.swal({
  534. title: "操作异常!",
  535. text: "系统异常,请稍后重试,或者联系管理员!",
  536. type: "error",
  537. });
  538. }
  539. });
  540. }
  541. }
  542. }
  543. });
  544. };
  545. $scope.selected = {
  546. items: [],
  547. };
  548. $scope.editted = {
  549. items: [],
  550. };
  551. $scope.gridOptions.onRegisterApi = function (gridApi) {
  552. $scope.gridApi = gridApi;
  553. // gridApi.edit.on.afterCellEdit($scope,function(rowEntity, colDef, newValue, oldValue){
  554. // // console.log(rowEntity);
  555. // });
  556. gridApi.pagination.on.paginationChanged(
  557. $scope,
  558. function (newPage, pageSize) {
  559. var filtersData = $scope.memoryfilterData;
  560. filtersData.idx = newPage - 1;
  561. filtersData.sum = pageSize;
  562. $scope.fileData.idx = newPage - 1;
  563. $scope.fileData.sum = pageSize;
  564. defaultFilterData = filtersData;
  565. $scope.refreshData("expand-right", $scope.fileData);
  566. }
  567. );
  568. gridApi.selection.on.rowSelectionChanged($scope, function (scope) {
  569. scope.grid.appScope.selected.items = scope.entity;
  570. });
  571. };
  572. var defaultFilterData = {
  573. idx: 0,
  574. sum: 10,
  575. };
  576. $scope.memoryfilterData = {
  577. idx: 0,
  578. sum: 10,
  579. };
  580. $scope.fileData = {
  581. idx: 0,
  582. sum: 10,
  583. incidentCategoryContent: {},
  584. };
  585. $scope.ldloading = {};
  586. $scope.refreshData = function (style, filterData) {
  587. $scope.selected.items = {};
  588. $scope.ldloading[style.replace("-", "_")] = true;
  589. if (angular.isUndefined(filterData)) {
  590. filterData = defaultFilterData;
  591. }
  592. $scope.myData = [];
  593. $scope.selected = { items: [] };
  594. if ($scope.gridApi) {
  595. $scope.gridApi.grid.selection.selectedCount = 0;
  596. }
  597. filterData = angular.copy(filterData);
  598. api_user_data.fetchDataList("incidentCategoryContent", filterData).then(
  599. 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. },
  608. function () {
  609. $scope.ldloading[style.replace("-", "_")] = false;
  610. }
  611. );
  612. };
  613. $scope.refreshData2 = function (style, filterData) {
  614. $scope.selected.items = {};
  615. $scope.ldloading[style.replace("-", "_")] = true;
  616. if (angular.isUndefined(filterData)) {
  617. filterData = defaultFilterData;
  618. }
  619. $scope.myData = [];
  620. $scope.selected = { items: [] };
  621. if ($scope.gridApi) {
  622. $scope.gridApi.grid.selection.selectedCount = 0;
  623. }
  624. filterData = angular.copy(filterData);
  625. if (filterData.incidentCategoryContent.category) {
  626. filterData.incidentCategoryContent.category =
  627. filterData.incidentCategoryContent.category.id;
  628. }
  629. api_user_data.fetchDataList("incidentCategoryContent", filterData).then(
  630. function (data) {
  631. var myData = Restangular.stripRestangular(data);
  632. $scope.gridOptions.totalItems = myData.totalNum;
  633. $scope.myData = myData.list;
  634. for (var i = 0; i < $scope.myData.length; i++) {
  635. $scope.myData[i]["item"] = i + 1 + filterData.idx * filterData.sum;
  636. }
  637. $scope.ldloading[style.replace("-", "_")] = false;
  638. },
  639. function () {
  640. $scope.ldloading[style.replace("-", "_")] = false;
  641. }
  642. );
  643. };
  644. // 搜索
  645. $scope.searchData = function () {
  646. $scope.refreshData("expand-right", $scope.fileData);
  647. };
  648. // 清空
  649. $scope.clean = function () {
  650. delete $scope.fileData.incidentCategoryContent.content;
  651. delete $scope.fileData.incidentCategoryContent.category;
  652. $scope.getCategoryData();
  653. $scope.refreshData("expand-right", $scope.fileData);
  654. };
  655. // 获取院区下拉
  656. $scope.model = {};
  657. $scope.categoryData = [];
  658. $scope.getCategoryData = function (s, fn) {
  659. if (s) {
  660. var filterKeyword = s.filterKeyword;
  661. }
  662. var postData = {
  663. idx: 0,
  664. sum: 1000,
  665. };
  666. if (filterKeyword) {
  667. postData.incidentcategory = {
  668. selectType: "pinyin_qs",
  669. category: filterKeyword,
  670. };
  671. }
  672. $scope.my_data = [];
  673. $scope.doing_async = true;
  674. api_bpm_data
  675. .fetchDataList("incidentcategory", postData)
  676. .then(function (response) {
  677. if (response.status == 200) {
  678. var data = response.list;
  679. if (filterKeyword) {
  680. data.forEach((e) => {
  681. e.isExpanded = true;
  682. });
  683. var li = transform(data).children;
  684. console.log(li);
  685. fn(li);
  686. return;
  687. } else {
  688. var objects = [];
  689. for (var i = 0; i < data.length; i++) {
  690. var object = {};
  691. object.id = data[i].id;
  692. object.parent = data[i].parent;
  693. object.category = data[i].category;
  694. object.isExpanded = true;
  695. objects.push(object);
  696. }
  697. $scope.my_data = convertParentToChildList(objects);
  698. $scope.categoryData = angular.copy($scope.my_data);
  699. }
  700. if ($scope.my_data.length > 0) {
  701. $scope.doing_async = false;
  702. }
  703. } else {
  704. SweetAlert.swal({
  705. title: "系统错误!",
  706. text: "请刷新重试!",
  707. type: "error",
  708. });
  709. }
  710. });
  711. };
  712. $scope.getCategoryData();
  713. $scope.refreshData("expand-right", $scope.fileData);
  714. $scope.timer = $interval(function () {
  715. $scope.refreshData2("expand-right", $scope.fileData);
  716. }, $rootScope.refreshTime);
  717. $scope.$on("$destroy", function () {
  718. $interval.cancel($scope.timer);
  719. });
  720. },
  721. ]);