adminUserCtrl.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  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];
  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. }).then(function (data) {
  249. $scope.select_treedata = $scope.my_data = convertParentToChildList(data['list']);
  250. $scope.doing_async = false;
  251. // tree.expand_all();
  252. //console.log(treelist);
  253. });
  254. };
  255. $scope.select_treedata = [];
  256. $scope.propTypeOptions = [];
  257. $scope.try_async_load();
  258. //注册
  259. $scope.registerfunction = function (id) {
  260. var modalInstance = $modal.open({
  261. templateUrl: 'assets/views/system/tpl/register.html',
  262. controller: function ($scope, scope, $modalInstance) {
  263. $scope.ok = function (key) {
  264. var filedata = {
  265. 'id': id,
  266. 'email': key
  267. };
  268. $modalInstance.dismiss('cancel');
  269. api_user_data.register(filedata).then(function (response) {
  270. var myData = Restangular.stripRestangular(response);
  271. if (response.status == 200) {
  272. SweetAlert.swal({
  273. title: "注册成功!",
  274. type: "success",
  275. confirmButtonColor: "#007AFF"
  276. }, function () {
  277. scope.refreshData('expand-right', scope.fileData);
  278. });
  279. } else {
  280. SweetAlert.swal({
  281. title: "注册失败!",
  282. text: response.msg,
  283. type: "error"
  284. });
  285. }
  286. })
  287. };
  288. $scope.cancel = function () {
  289. $modalInstance.dismiss('cancel');
  290. };
  291. },
  292. resolve: {
  293. scope: function () {
  294. return $scope;
  295. }
  296. }
  297. })
  298. }
  299. $scope.resetpassword = function (id) {
  300. var modalInstance = $modal.open({
  301. templateUrl: 'assets/views/delete.html',
  302. controller: function ($scope, $modalInstance) {
  303. var data;
  304. $scope.title = '重置密码';
  305. $scope.connect = '确定要重置密码?';
  306. $scope.ok = function () {
  307. $modalInstance.dismiss('cancel');
  308. api_login.resetpwd(id).then(function (response) {
  309. var myData = Restangular.stripRestangular(response);
  310. // console.log("myData=" + JSON.stringify(myData));
  311. if (response.status == 200) {
  312. SweetAlert.swal({
  313. title: "重置成功!重置后密码 888888",
  314. type: "success",
  315. confirmButtonColor: "#007AFF"
  316. });
  317. } else {
  318. SweetAlert.swal({
  319. title: "操作异常!",
  320. text: "系统异常,请稍后重试,或者联系管理员!",
  321. type: "error"
  322. });
  323. }
  324. })
  325. };
  326. $scope.cancel = function () {
  327. $modalInstance.dismiss('cancel');
  328. };
  329. },
  330. size: 'sm'
  331. })
  332. }
  333. $scope.saveData = function (data) {
  334. var modelData = {
  335. model: {
  336. user: data
  337. }
  338. };
  339. if (modelData.model.user && modelData.model.user.item) {
  340. delete modelData.model.user.item;
  341. }
  342. modelData.model.user.deptPhone=data.dept?data.dept.phone:''
  343. $state.go('app.system.form', {
  344. formKey: 'system_edit',
  345. service: 'api_user_data',
  346. model: JSON.stringify(modelData)
  347. });
  348. };
  349. $scope.addData = function () {
  350. var modelData = {
  351. model: {
  352. user: {
  353. flag: "0"
  354. }
  355. }
  356. };
  357. $state.go('app.system.form', {
  358. formKey: 'system_edit',
  359. service: 'api_user_data',
  360. model: JSON.stringify(modelData)
  361. });
  362. }
  363. $scope.removeData = function () {
  364. var modalInstance = $modal.open({
  365. templateUrl: 'assets/views/delete.html',
  366. controller: function ($scope, scope, $modalInstance, api_bpm_data) {
  367. var rmvList = [];
  368. $scope.title = '人员删除';
  369. $scope.connect = '确定要删除此人员?';
  370. angular.forEach(scope.selected.items, function (item) {
  371. rmvList.push(item.id);
  372. });
  373. $scope.ok = function () {
  374. $modalInstance.close(rmvList);
  375. };
  376. $scope.cancel = function () {
  377. $modalInstance.dismiss('cancel');
  378. };
  379. },
  380. size: 'sm',
  381. resolve: {
  382. scope: function () {
  383. return $scope;
  384. }
  385. }
  386. });
  387. modalInstance.result.then(function (selectedItem) {
  388. if (selectedItem) {
  389. if (selectedItem.length > 0) {
  390. api_user_data.rmvData('user', selectedItem).then(function (response) {
  391. if (response.data) {
  392. SweetAlert.swal({
  393. title: "删除成功!",
  394. type: "success",
  395. confirmButtonColor: "#007AFF"
  396. }, function () {
  397. $scope.myData = _.reject($scope.myData, function (o) {
  398. return _.includes(selectedItem, o.id);
  399. });
  400. $scope.selected = {
  401. items: []
  402. };
  403. $scope.gridOptions.totalItems = $scope.gridOptions.totalItems - selectedItem.length;
  404. $scope.gridApi.grid.selection.selectedCount = 0;
  405. });
  406. } else {
  407. SweetAlert.swal({
  408. title: "操作异常!",
  409. text: "系统异常,请稍后重试,或者联系管理员!",
  410. type: "error"
  411. });
  412. }
  413. })
  414. }
  415. }
  416. })
  417. }
  418. $scope.selected = {
  419. items: []
  420. }
  421. $scope.editted = {
  422. items: []
  423. }
  424. $scope.gridOptions.onRegisterApi = function (gridApi) {
  425. $scope.gridApi = gridApi;
  426. // gridApi.edit.on.afterCellEdit($scope,function(rowEntity, colDef, newValue, oldValue){
  427. // // console.log(rowEntity);
  428. // });
  429. gridApi.pagination.on.paginationChanged($scope, function (newPage, pageSize) {
  430. var filtersData = $scope.memoryfilterData;
  431. filtersData.idx = newPage - 1;
  432. filtersData.sum = pageSize;
  433. $scope.fileData.idx = newPage - 1;
  434. $scope.fileData.sum = pageSize;
  435. defaultFilterData = filtersData;
  436. $scope.refreshData('expand-right', $scope.fileData);
  437. });
  438. gridApi.selection.on.rowSelectionChanged($scope, function (scope) {
  439. var j = 0;
  440. for (var i = 0; i <= scope.grid.appScope.selected.items.length; i++) {
  441. if (scope.grid.appScope.selected.items[i] == scope.entity) {
  442. j++;
  443. break;
  444. }
  445. }
  446. // console.log("j="+j)
  447. if (j == 1) {
  448. scope.grid.appScope.selected.items.splice(i, 1);
  449. } else {
  450. scope.grid.appScope.selected.items.push(scope.entity)
  451. }
  452. });
  453. // gridApi.core.on.filterChanged($scope, function() {
  454. // var grid = this.grid;
  455. // var filtersData = {
  456. // idx: 0,
  457. // sum: 10
  458. // };
  459. // angular.forEach(grid.columns, function(item) {
  460. // if (item.enableFiltering) {
  461. // if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  462. // if (angular.isUndefined(filtersData['requester'])) {
  463. // filtersData['requester'] = {};
  464. // }
  465. // filtersData['requester'][item.field] = item.filters[0].term;
  466. // }
  467. // }
  468. // });
  469. // $scope.memoryfilterData = filtersData;
  470. // $scope.refreshData('expand-right', filtersData);
  471. // });
  472. gridApi.core.on.filterChanged($scope, function () {
  473. var grid = this.grid;
  474. // var filtersData = {
  475. // idx: 0,
  476. // sum: 10
  477. // };
  478. var filtersData = $scope.memoryfilterData;
  479. angular.forEach(grid.columns, function (item) {
  480. if (item.enableFiltering) {
  481. if (angular.isDefined(item.filters[0].term) && item.filters[0].term != '') {
  482. if (angular.isUndefined(filtersData['user'])) {
  483. filtersData['user'] = {};
  484. filtersData['user']['flag'] = -1;
  485. filtersData['user'][item.field] = item.filters[0].term;
  486. } else {
  487. filtersData.user.flag = -1;
  488. filtersData.user[item.field] = item.filters[0].term;
  489. }
  490. // filtersData['user']['flag'] = -1;
  491. // filtersData['user'][item.field] = item.filters[0].term;
  492. }
  493. }
  494. });
  495. $scope.memoryfilterData = filtersData;
  496. $scope.refreshData('expand-right', $scope.fileData);
  497. });
  498. };
  499. var defaultFilterData = {
  500. "idx": 0,
  501. "sum": 10
  502. };
  503. $scope.memoryfilterData = {
  504. "idx": 0,
  505. "sum": 10
  506. }
  507. $scope.ldloading = {};
  508. $scope.fileData = {
  509. "idx": 0,
  510. "sum": 10,
  511. "user": {}
  512. }
  513. $scope.treeItem = "";
  514. $scope.onFilterCallback = function (item) {
  515. $scope.treeItem = item
  516. }
  517. // 搜索
  518. $scope.searchData = function () {
  519. if ($scope.treeItem) {
  520. $scope.fileData.user.groupdata = $scope.treeItem
  521. }
  522. if($scope.fileData.user.name){
  523. $scope.fileData.user.selectType= "pinyin_qs"
  524. }
  525. $scope.refreshData('expand-right', $scope.fileData);
  526. }
  527. // 清空
  528. $scope.clean = function () {
  529. delete $scope.fileData.user.account;
  530. delete $scope.fileData.user.name;
  531. delete $scope.fileData.user.groupdata;
  532. $scope.treeItem = "";
  533. $scope.try_async_load();
  534. $scope.refreshData('expand-right', $scope.fileData);
  535. }
  536. //刷新
  537. $scope.refresh = function (style, filterData) {
  538. $scope.selected = {
  539. items: []
  540. };
  541. if ($scope.gridApi) {
  542. // $scope.gridApi.grid.options.paginationCurrentPage = 0;
  543. $scope.gridApi.grid.selection.selectedCount = 0;
  544. }
  545. $scope.refreshData('expand-right', $scope.fileData);
  546. }
  547. //获取列表数据
  548. $scope.refreshData = function (style, filterData) {
  549. $scope.ldloading[style.replace('-', '_')] = true;
  550. if (angular.isUndefined(filterData)) {
  551. filterData = defaultFilterData;
  552. }
  553. if (angular.isDefined($scope.searchTypes)) {
  554. filterData['searchType'] = $scope.searchTypes;
  555. }
  556. $scope.myData = [];
  557. filterData['flag'] = -1;
  558. // if ($scope.gridApi) {
  559. // $scope.gridApi.grid.selection.selectedCount = 0;
  560. // $scope.selected = { items: [] };
  561. // }
  562. console.log("filterData=" + JSON.stringify(filterData))
  563. api_user_data.fetchDataList('user', filterData).then(function (data) {
  564. var myData = Restangular.stripRestangular(data);
  565. $scope.gridOptions.totalItems = myData.totalNum;
  566. $scope.myData = myData.list;
  567. for (var i = 0; i < $scope.myData.length; i++) {
  568. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  569. }
  570. $scope.ldloading[style.replace('-', '_')] = false;
  571. // console.log("$scope.myData="+JSON.stringify($scope.myData))
  572. }, function () {
  573. $scope.ldloading[style.replace('-', '_')] = false;
  574. });
  575. };
  576. $scope.refreshData2 = function (style, filterData) {
  577. $scope.ldloading[style.replace('-', '_')] = true;
  578. if (angular.isUndefined(filterData)) {
  579. filterData = defaultFilterData;
  580. }
  581. if (angular.isDefined($scope.searchTypes)) {
  582. filterData['searchType'] = $scope.searchTypes;
  583. }
  584. // $scope.myData = [];
  585. filterData['flag'] = -1;
  586. // if ($scope.gridApi) {
  587. // $scope.gridApi.grid.selection.selectedCount = 0;
  588. // $scope.selected = { items: [] };
  589. // }
  590. console.log("filterData=" + JSON.stringify(filterData))
  591. api_user_data.fetchDataList('user', filterData).then(function (data) {
  592. var myData = Restangular.stripRestangular(data);
  593. $scope.gridOptions.totalItems = myData.totalNum;
  594. $scope.myData = myData.list;
  595. for (var i = 0; i < $scope.myData.length; i++) {
  596. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  597. }
  598. $scope.ldloading[style.replace('-', '_')] = false;
  599. // console.log("$scope.myData="+JSON.stringify($scope.myData))
  600. }, function () {
  601. $scope.ldloading[style.replace('-', '_')] = false;
  602. });
  603. };
  604. $scope.refreshData('expand-right', $scope.fileData);
  605. $scope.timer = $interval(function () {
  606. $scope.refreshData2('expand-right', $scope.fileData);
  607. }, $rootScope.refreshTime);
  608. $scope.$on('$destroy', function () {
  609. $interval.cancel($scope.timer)
  610. });
  611. }]);