inspectListCtrl.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. "use strict";
  2. /**
  3. * controller for User Profile Example
  4. */
  5. app.controller("inspectListCtrl", [
  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_configure_data",
  20. function (
  21. $rootScope,
  22. $scope,
  23. $state,
  24. $timeout,
  25. $interval,
  26. $modal,
  27. SweetAlert,
  28. i18nService,
  29. uiGridConstants,
  30. uiGridGroupingConstants,
  31. Restangular,
  32. api_bpm_schedule,
  33. api_bpm_data,
  34. api_configure_data
  35. ) {
  36. $scope.langs = i18nService.getAllLangs();
  37. $scope.lang = "zh-cn";
  38. i18nService.setCurrentLang($scope.lang);
  39. var loginUser = $rootScope.user;
  40. $scope.chuli = false;
  41. for (var i = 0; i < loginUser.menu.length; i++) {
  42. if (loginUser.menu[i].link == "xunjianliebiao_chuli") {
  43. $scope.chuli = true;
  44. }
  45. }
  46. var defaultFilterData = {
  47. assignee: loginUser.id,
  48. // "assignee": "1",
  49. idx: 0,
  50. sum: 10,
  51. status: "",
  52. searchType: "todo",
  53. };
  54. var inspectListParameter = {
  55. assignee: loginUser.id,
  56. // "assignee": "1",
  57. idx: 0,
  58. sum: 10,
  59. status: "",
  60. };
  61. // $scope.memoryfilterData = {
  62. // "idx": 0,
  63. // "sum": 10
  64. // }
  65. //本地存储
  66. sessionStorage.inspectListParameter = JSON.stringify(inspectListParameter);
  67. //ui-grid设置
  68. $scope.gridOptions = {};
  69. $scope.gridOptions.data = "myData";
  70. $scope.gridOptions.enableColumnResizing = true;
  71. $scope.gridOptions.enableFiltering = true;
  72. $scope.gridOptions.enableGridMenu = true;
  73. $scope.gridOptions.enableSelectAll = true;
  74. $scope.gridOptions.enableRowSelection = true;
  75. $scope.gridOptions.showGridFooter = true;
  76. $scope.gridOptions.showColumnFooter = false;
  77. $scope.gridOptions.fastWatch = true;
  78. $scope.gridOptions.useExternalFiltering = true;
  79. $scope.gridOptions.useExternalPagination = true;
  80. $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
  81. $scope.gridOptions.paginationPageSize = 10;
  82. $scope.gridOptions.multiSelect = true;
  83. // $scope.gridOptions.rowTemplate = '<div style="background: red"><a>123</a></div';
  84. // $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>";
  85. $scope.gridOptions.rowIdentity = function (row) {
  86. return row.id;
  87. };
  88. $scope.gridOptions.getRowIdentity = function (row) {
  89. return row.id;
  90. };
  91. $scope.transferColor = function (item) {
  92. var color = "icon iconfont icon-zhengchang greenfont";
  93. if (item && item.colourInfo) {
  94. if (item.colourInfo.id == 1) {
  95. color = "icon iconfont icon-yiyuqi redfont";
  96. } else if (item.colourInfo.id == 2) {
  97. color = "iconfont icon-yuqixinxiu yellofont";
  98. }
  99. } else {
  100. // color = "white";
  101. }
  102. return color;
  103. };
  104. $scope.transfertip = function (item) {
  105. var tip = "正常";
  106. if (item && item.colourInfo) {
  107. if (item.colourInfo.id == 1) {
  108. tip = "逾期";
  109. } else if (item.colourInfo.id == 2) {
  110. tip = "即将逾期";
  111. }
  112. } else {
  113. // color = "white";
  114. }
  115. return tip;
  116. };
  117. $scope.gridOptions.columnDefs = [
  118. {
  119. name: "id",
  120. displayName: "",
  121. width: 40,
  122. enableFiltering: false,
  123. cellTemplate:
  124. "<div>" +
  125. '<div class="ui-grid-cell-contents" tooltip={{grid.appScope.transfertip(row.entity.ruleColour)}} tooltip-placement="right"><i style="font-size: 18px !important;" class="{{grid.appScope.transferColor(row.entity.ruleColour)}}"></i></div></div>',
  126. },
  127. {
  128. name: "sign",
  129. displayName: "单号",
  130. width: "12%",
  131. minWidth: 120,
  132. enableFiltering: false,
  133. },
  134. {
  135. name: "inspectionType.type",
  136. displayName: "巡检分类",
  137. width: "12%",
  138. minWidth: 120,
  139. enableFiltering: false,
  140. },
  141. {
  142. name: "inspection.title",
  143. displayName: "计划主题",
  144. width: "12%",
  145. minWidth: 120,
  146. enableFiltering: false,
  147. },
  148. {
  149. name: "inspection.createUser.name",
  150. displayName: "创建人",
  151. width: "8%",
  152. minWidth: 80,
  153. enableFiltering: false,
  154. },
  155. {
  156. name: "stateName",
  157. displayName: "状态",
  158. width: "8%",
  159. minWidth: 80,
  160. enableFiltering: false,
  161. },
  162. {
  163. name: "inspection.executeUser.name",
  164. displayName: "处理人",
  165. width: "8%",
  166. minWidth: 80,
  167. enableFiltering: false,
  168. },
  169. {
  170. name: "startDate",
  171. displayName: "开始时间",
  172. width: "15%",
  173. minWidth: 160,
  174. enableFiltering: false,
  175. cellTemplate:
  176. "<div>" +
  177. '<div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.startDate)}}</div>' +
  178. "</div>",
  179. },
  180. {
  181. name: "overdueTime",
  182. displayName: "逾期时间",
  183. width: "15%",
  184. width: 160,
  185. enableFiltering: false,
  186. cellTemplate:
  187. "<div>" +
  188. '<div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.overdueTime)}}</div>' +
  189. "</div>",
  190. },
  191. {
  192. name: "操作",
  193. minWidth: "150",
  194. enableFiltering: false,
  195. cellTemplate:
  196. '<div class="cl-effect-1 ui-grid-cell-contents pull-left">' +
  197. '<a ng-click="grid.appScope.lookFunction(row.entity)" tooltip="查看" tooltip-placement="right" class="bianjifont">查看</a>' +
  198. '<a ng-show="{{grid.appScope.showChuli(row.entity)&&grid.appScope.chuli}}" ng-click="grid.appScope.selectRowFunction(row.entity)" class="bianjifont">处理</a>' +
  199. // '<a ng-show="{{!row.entity.state==1}}" ng-click="grid.appScope.selectRowFunction(row.entity)" tooltip="编辑" tooltip-placement="left"><i class="fa fa-pencil-square-o"/></a>' +
  200. "</div>",
  201. },
  202. ];
  203. // $scope.addData = function() {
  204. // $state.go('app.inspection.inspectList.editor', {
  205. // formKey: 'inspectionform',
  206. // service: 'api_bpm_data'
  207. // });
  208. // }
  209. $scope.transferTime = function (time) {
  210. return moment(time).format("YYYY-MM-DD HH:mm");
  211. };
  212. $scope.showChuli = function (data) {
  213. if (data.processUser.id == loginUser.id && data.stateName == "执行中") {
  214. return true;
  215. } else {
  216. return false;
  217. }
  218. };
  219. $scope.selectRowFunction = function (data) {
  220. var filedata = {
  221. model: {
  222. inspectionProcessActual: data,
  223. },
  224. };
  225. $state.go("app.inspection.inspectListEditor", {
  226. taskId: data.taskId,
  227. dataId: data.id,
  228. processInstanceId: data.processInstanceId,
  229. pdKey: data.processKey,
  230. formUiEdit: data.inspectionType.formUiEdit,
  231. // "formUiName": data.inspection.inspectionTypeDTO.formUiName,
  232. model: JSON.stringify(filedata),
  233. });
  234. };
  235. $scope.lookFunction = function (data) {
  236. var filedata = {
  237. model: {
  238. inspectionProcessActual: data,
  239. },
  240. // model:data
  241. };
  242. $state.go("app.inspection.inspectListdetail", {
  243. formKey: data.inspectionType.formUiName,
  244. dataId: data.id,
  245. taskId: data.taskId,
  246. processInstanceId: data.processInstanceId,
  247. pdKey: data.processKey,
  248. // "formUiEdit": data.inspection.inspectionTypeDTO.formUiEdit,
  249. formUiName: data.inspectionType.formUiName,
  250. model: JSON.stringify(filedata),
  251. });
  252. };
  253. $scope.model = {
  254. assignee: JSON.parse(sessionStorage.inspectListParameter).assignee,
  255. idx: 0,
  256. sum: 10,
  257. searchType: "todo",
  258. inspectionProcessActual: {
  259. inspection: {},
  260. },
  261. };
  262. // $scope.removeData = function() {
  263. // // var rmvList = [$scope.selected.items.id]
  264. // var rmvList = [];
  265. // angular.forEach($scope.selected.items, function(item) {
  266. // rmvList.push(item.id);
  267. // });
  268. // if (rmvList.length > 0) {
  269. // api_bpm_data.rmvData('inspection', rmvList).then(function(response) {
  270. // if (response.status == 200) {
  271. // SweetAlert.swal({
  272. // title: "删除成功!",
  273. // type: "success",
  274. // confirmButtonColor: "#007AFF"
  275. // }, function() {
  276. // $scope.myData = _.reject($scope.myData, function(o) { return _.includes(rmvList, o.id); });
  277. // $scope.selected = {
  278. // items: []
  279. // };
  280. // });
  281. // } else {
  282. // SweetAlert.swal({
  283. // title: "操作异常!",
  284. // text: "系统异常,请稍后重试,或者联系管理员!",
  285. // type: "error"
  286. // });
  287. // }
  288. // })
  289. // }
  290. // }
  291. $scope.selected = {
  292. items: [],
  293. };
  294. $scope.editted = {
  295. items: [],
  296. };
  297. $scope.jry_idx = 0;
  298. $scope.jry_sum = 10;
  299. //分页控制
  300. $scope.gridOptions.onRegisterApi = function (gridApi) {
  301. gridApi.pagination.on.paginationChanged(
  302. $scope,
  303. function (newPage, pageSize) {
  304. console.log("ok");
  305. var filterData = JSON.parse(sessionStorage.inspectListParameter);
  306. filterData.idx = newPage - 1;
  307. filterData.sum = pageSize;
  308. $scope.jry_idx = newPage - 1;
  309. $scope.jry_sum = pageSize;
  310. $scope.model.idx = newPage - 1;
  311. $scope.model.sum = pageSize;
  312. $scope.refreshData("expand-right", $scope.model);
  313. }
  314. );
  315. // gridApi.selection.on.rowSelectionChanged($scope, function(data) {
  316. // data.grid.appScope.selected.items = data.entity
  317. // console.log(data);
  318. // });
  319. };
  320. // var data = JSON.parse(sessionStorage.inspectListParameter);
  321. // sessionStorage.inspectListParameter = JSON.stringify(data);
  322. $scope.ldloading = {};
  323. $scope.statusData = {};
  324. $scope.tData = { title: "", batchNo: "" };
  325. //搜索事件
  326. $scope.searchinspectlist = function (item) {
  327. var filterData = JSON.parse(sessionStorage.inspectListParameter);
  328. // console.log(filterData);
  329. // if (item.type) {
  330. // filterData.inspection = { 'inspectionTypeDTO': { 'id':item.type.id}};
  331. // }
  332. // if (item.title) {
  333. // filterData.inspection = { 'title': item.title};
  334. // }
  335. $scope.model.idx = $scope.jry_idx;
  336. $scope.model.sum = $scope.jry_sum;
  337. if ($scope.model.inspectionProcessActual.inspectionType) {
  338. $scope.model.inspectionProcessActual.inspectionTypeId =
  339. $scope.model.inspectionProcessActual.inspectionType.id;
  340. delete $scope.model.inspectionProcessActual.inspectionType;
  341. }
  342. if ($scope.statusData.state) {
  343. $scope.model.inspectionProcessActual.state =
  344. $scope.statusData.state.state;
  345. }
  346. if ($scope.tData.title) {
  347. if ($scope.model.inspectionProcessActual.inspection) {
  348. $scope.model.inspectionProcessActual.inspection.title =
  349. $scope.tData.title.title;
  350. } else {
  351. $scope.model.inspectionProcessActual.inspection = {
  352. title: $scope.tData.title.title,
  353. };
  354. }
  355. }
  356. if ($scope.tData.batchNo) {
  357. $scope.model.inspectionProcessActual.batchNo = $scope.tData.batchNo.batchNo;
  358. }
  359. // filterData.status = item;
  360. sessionStorage.inspectListParameter = JSON.stringify(filterData);
  361. $scope.refreshData("expand-right", $scope.model);
  362. };
  363. $scope.clean = function () {
  364. $scope.tData = { title: "", batchNo: "" };
  365. delete $scope.model.inspectionProcessActual.batchNo;
  366. delete $scope.model.inspectionProcessActual.inspection.title;
  367. delete $scope.model.inspectionProcessActual.inspectionType;
  368. delete $scope.model.inspectionProcessActual.inspectionTypeId;
  369. delete $scope.model.inspectionProcessActual.inspection.executeUser;
  370. delete $scope.model.inspectionProcessActual.inspection.createUser;
  371. delete $scope.model.inspectionProcessActual.state;
  372. $scope.statusData = {};
  373. $scope.try_async_load();
  374. $scope.refreshData("expand-right", $scope.model);
  375. };
  376. //树形控件点击事件
  377. $scope.my_tree_handler = function (branch) {
  378. var filterData = JSON.parse(sessionStorage.inspectListParameter);
  379. filterData.status = branch.id;
  380. // if (filterData.inspectionProcessActual) {
  381. // filterData.inspectionProcessActual.inspectionTypeId = branch.id;
  382. // } else {
  383. // filterData = angular.extend(filterData, {
  384. // "inspectionProcessActual": {
  385. // "inspectionTypeId": branch.id
  386. // }
  387. // })
  388. // }
  389. sessionStorage.inspectListParameter = JSON.stringify(filterData);
  390. $scope.refreshData("expand-right", filterData);
  391. };
  392. //搜索栏点击事件
  393. $scope.searchstate = "todo";
  394. $scope.onChange = function (searchType) {
  395. $scope.searchstate = searchType;
  396. var filterData = JSON.parse(sessionStorage.inspectListParameter);
  397. filterData.searchType = searchType;
  398. $scope.model.searchType = searchType;
  399. sessionStorage.inspectListParameter = JSON.stringify(filterData);
  400. $scope.refreshData("expand-right", $scope.model);
  401. };
  402. $scope.reload = function () {
  403. var filterData = JSON.parse(sessionStorage.inspectListParameter);
  404. $scope.refreshData("expand-right", filterData);
  405. };
  406. $scope.refreshData = function (style, filterData) {
  407. $scope.ldloading[style.replace("-", "_")] = true;
  408. if (angular.isUndefined(filterData)) {
  409. filterData = defaultFilterData;
  410. }
  411. $scope.myData = [];
  412. $scope.memoryfilterData = filterData;
  413. api_bpm_data.fetchInspectServiceTasks(filterData.status, filterData).then(
  414. function (data) {
  415. var myData = Restangular.stripRestangular(data);
  416. $scope.gridOptions.totalItems = myData.resultCount;
  417. if (angular.isArray(myData.data)) {
  418. $scope.myData = myData.data;
  419. for (var i = 0; i < $scope.myData.length; i++) {
  420. //添加序号
  421. $scope.myData[i]["itemId"] =
  422. i + 1 + filterData.idx * filterData.sum;
  423. }
  424. $scope.ldloading[style.replace("-", "_")] = false;
  425. } else {
  426. $scope.ldloading[style.replace("-", "_")] = false;
  427. SweetAlert.swal({
  428. title: "数据为空",
  429. text: myData.data,
  430. type: "warning",
  431. });
  432. }
  433. },
  434. function () {
  435. $scope.ldloading[style.replace("-", "_")] = false;
  436. }
  437. );
  438. };
  439. $scope.refreshData2 = function (style, filterData) {
  440. $scope.ldloading[style.replace("-", "_")] = true;
  441. if (angular.isUndefined(filterData)) {
  442. filterData = defaultFilterData;
  443. }
  444. // $scope.myData = [];
  445. $scope.memoryfilterData = filterData;
  446. api_bpm_data.fetchInspectServiceTasks(filterData.status, filterData).then(
  447. function (data) {
  448. var myData = Restangular.stripRestangular(data);
  449. $scope.gridOptions.totalItems = myData.resultCount;
  450. if (angular.isArray(myData.data)) {
  451. $scope.myData = myData.data;
  452. for (var i = 0; i < $scope.myData.length; i++) {
  453. //添加序号
  454. $scope.myData[i]["itemId"] =
  455. i + 1 + filterData.idx * filterData.sum;
  456. }
  457. $scope.ldloading[style.replace("-", "_")] = false;
  458. } else {
  459. $scope.ldloading[style.replace("-", "_")] = false;
  460. SweetAlert.swal({
  461. title: "数据为空",
  462. text: myData.data,
  463. type: "warning",
  464. });
  465. }
  466. },
  467. function () {
  468. $scope.ldloading[style.replace("-", "_")] = false;
  469. }
  470. );
  471. };
  472. $scope.inspecttype = {};
  473. // 获取处理人
  474. $scope.getExecuteUser = function () {
  475. api_configure_data
  476. .fetchDataList("user", {
  477. idx: 0,
  478. sum: 1000,
  479. user: {
  480. roledata: {
  481. rolecode: "inspectman",
  482. },
  483. simple: true,
  484. },
  485. })
  486. .then(function (res) {
  487. $scope.executeUserData = res.list;
  488. });
  489. };
  490. $scope.getExecuteUser();
  491. $scope.statusData = [
  492. {
  493. name: "执行中",
  494. state: 0,
  495. },
  496. {
  497. name: "已完成",
  498. state: 1,
  499. },
  500. ];
  501. $scope.titleData = []; //计划主题列表
  502. $scope.batchNoData = []; //批次号列表
  503. // 获取计划主题列表
  504. $scope.getTitleData = function () {
  505. var postData = {
  506. assignee: $rootScope.user.id,
  507. idx: 0,
  508. sum: 9999,
  509. searchType: "all",
  510. inspectionProcessActual: {},
  511. };
  512. api_bpm_data
  513. .fetchDataList("inspection", postData)
  514. .then(function (result) {
  515. if (result.status == 200) {
  516. $scope.titleData = result.list;
  517. }
  518. });
  519. };
  520. $scope.getTitleData();
  521. //修改计划主题
  522. $scope.changeTitle = function(){
  523. $scope.tData.batchNo = "";
  524. $scope.batchNoData = $scope.tData.title.batchNos.map(v=>({id:v,batchNo:v}));
  525. }
  526. // 获取创建人
  527. $scope.getCreateUser = function () {
  528. api_configure_data
  529. .fetchDataList("user", {
  530. idx: 0,
  531. sum: 1000,
  532. user: {
  533. simple: true,
  534. },
  535. })
  536. .then(function (res) {
  537. $scope.createUserData = res.list;
  538. });
  539. };
  540. $scope.getCreateUser();
  541. $scope.open = function ($event) {
  542. $event.preventDefault();
  543. $event.stopPropagation();
  544. $scope.opened = !$scope.opened;
  545. };
  546. $scope.endOpen = function ($event) {
  547. $event.preventDefault();
  548. $event.stopPropagation();
  549. $scope.startOpened = false;
  550. $scope.endOpened = !$scope.endOpened;
  551. };
  552. $scope.startOpen = function ($event) {
  553. $event.preventDefault();
  554. $event.stopPropagation();
  555. $scope.endOpened = false;
  556. $scope.startOpened = !$scope.startOpened;
  557. };
  558. //树形控件加载
  559. $scope.my_tree = {};
  560. $scope.try_async_load = function () {
  561. $scope.my_data = [];
  562. $scope.doing_async = true;
  563. api_bpm_data
  564. .fetchDataList("inspectionType", {
  565. idx: 0,
  566. sum: 1000,
  567. })
  568. .then(function (response) {
  569. if (response.status == 200) {
  570. var data = response.list;
  571. var objects = [];
  572. for (var i = 0; i < data.length; i++) {
  573. var object = {};
  574. object.id = data[i].id;
  575. if (data[i].parent && data[i].parent.id != 0) {
  576. object.parent = data[i].parent.id;
  577. }
  578. object.label = data[i].type;
  579. objects.push(object);
  580. }
  581. $scope.my_data = convertParentToChildList(objects);
  582. $scope.tree_data = angular.copy($scope.my_data);
  583. if ($scope.my_data.length > 0) {
  584. $scope.doing_async = false;
  585. }
  586. // return $scope.my_tree.expand_all()
  587. } else {
  588. SweetAlert.swal({
  589. title: "系统错误!",
  590. text: "请刷新重试!",
  591. type: "error",
  592. });
  593. }
  594. });
  595. };
  596. function convertListToTree(data, treeMap) {
  597. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  598. var root = null; //Initially set our loop to null
  599. var parentNode = null;
  600. //loop over data
  601. for (var i = 0; i < data.length; i++) {
  602. var datum = data[i];
  603. //each node will have children, so let's give it a "children" poperty
  604. datum.children = [];
  605. //add an entry for this node to the map so that any future children can
  606. //lookup the parent
  607. idToNodeMap[datum.id] = datum;
  608. //Does this node have a parent?
  609. if (typeof datum.parent === "undefined" || datum.parent == null) {
  610. //Doesn't look like it, so this node is the root of the tree
  611. root = datum;
  612. treeMap[datum.id] = root;
  613. } else {
  614. //This node has a parent, so let's look it up using the id
  615. parentNode = idToNodeMap[datum.parent];
  616. //We don't need this property, so let's delete it.
  617. delete datum.parent;
  618. //Let's add the current node as a child of the parent node.
  619. parentNode.children.push(datum);
  620. }
  621. }
  622. return root;
  623. }
  624. function convertParentToChildList(data) {
  625. var treeMap = {};
  626. var list = [];
  627. convertListToTree(data, treeMap);
  628. angular.forEach(treeMap, function (item) {
  629. list.push(item);
  630. });
  631. return list;
  632. }
  633. $scope.refreshData("expand-right", defaultFilterData);
  634. $scope.try_async_load();
  635. $scope.timer = $interval(function () {
  636. $scope.refreshData2("expand-right", $scope.model);
  637. }, $rootScope.refreshTime);
  638. $scope.$on("$destroy", function () {
  639. $interval.cancel($scope.timer);
  640. });
  641. },
  642. ]);