fixedCtrl.js 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169
  1. 'use strict';
  2. /**
  3. * controller for User Profile Example
  4. */
  5. // "$aside", "toaster", "api_bpm_domain", "api_configure_data", "api_cmdb", "api_configure_form",
  6. app.controller('fixedCtrl', ["$rootScope", "$scope", "$http", "$state", "$timeout", "$injector", '$parse', "$interval", "$modal", "$stateParams", "$aside", "SweetAlert", "toaster", "FileUploader", "i18nService", "uiGridConstants", "uiGridGroupingConstants", "Restangular", "api_bpm_domain", "api_configure_data", "api_cmdb", "api_configure_form","api_wechatfile","api_cmdb_print", function($rootScope, $scope, $http, $state, $timeout, $parse, $injector, $interval, $modal, $stateParams, $aside, SweetAlert, toaster, FileUploader, i18nService, uiGridConstants, uiGridGroupingConstants, Restangular, api_bpm_domain, api_configure_data, api_cmdb, api_configure_form,api_wechatfile,api_cmdb_print) {
  7. $scope.langs = i18nService.getAllLangs();
  8. $scope.lang = 'zh-cn';
  9. i18nService.setCurrentLang($scope.lang);
  10. var loginUser = $rootScope.user;
  11. $scope.showdown = false;
  12. $scope.clickshow = function() {
  13. $scope.showdown = !$scope.showdown;
  14. }
  15. $scope.gridOptions = {};
  16. $scope.gridOptions.data = 'myData';
  17. $scope.gridOptions.enableColumnResizing = true;
  18. $scope.gridOptions.enableFiltering = false;
  19. $scope.gridOptions.enableGridMenu = true;
  20. $scope.gridOptions.enableSelectAll = true;
  21. $scope.gridOptions.enableRowSelection = true;
  22. $scope.gridOptions.showGridFooter = true;
  23. $scope.gridOptions.showColumnFooter = false;
  24. $scope.gridOptions.fastWatch = true;
  25. $scope.gridOptions.enableSorting = true;
  26. $scope.gridOptions.useExternalSorting = true;
  27. $scope.gridOptions.useExternalFiltering = false;
  28. $scope.gridOptions.useExternalPagination = true;
  29. $scope.gridOptions.paginationPageSizes = [10, 20, 50, 100];
  30. $scope.gridOptions.paginationPageSize = 10;
  31. $scope.gridOptions.multiSelect = true;
  32. // $scope.gridOptions.enableRowHeaderSelection = true;
  33. // $scope.gridOptions.enableRowSelection = true;
  34. // $scope.gridOptions.enableFullRowSelection = true;
  35. // $scope.gridOptions.enableSelectionBatchEvent = true;
  36. var mun = $scope.gridOptions.paginationPageSize;
  37. $scope.gridOptions.rowTemplate = "<div ng-click=\"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>";
  38. $scope.gridOptions.rowIdentity = function(row) {
  39. return row.id;
  40. };
  41. $scope.gridOptions.getRowIdentity = function(row) {
  42. return row.id;
  43. };
  44. $scope.gridOptions.columnDefs = [{
  45. name: 'item',
  46. enableSorting: false,
  47. displayName: '序号',
  48. width: 49,
  49. enableFiltering: false,
  50. cellTemplate: '<div>' +
  51. '<div class="ui-grid-cell-contents">{{row.entity.item}}</div>' +
  52. '</div>'
  53. },
  54. {
  55. name: '关系图',
  56. enableSorting: false,
  57. displayName: '关系图',
  58. width: 60,
  59. enableFiltering: false,
  60. cellTemplate: '<div class="ui-grid-cell-contents"><a ng-click="grid.appScope.lookmap(row.entity)" tooltip="查看关系图" tooltip-placement="right"><i class="icon iconfontsmall icon-guanxitu1 pointfont"></i></a></div>'
  61. },
  62. {
  63. name: 'uuid',
  64. enableSorting: false,
  65. displayName: '资产编码',
  66. width: '15%',
  67. minWidth: 164,
  68. enableFiltering: false,
  69. cellTemplate: '<div>' +
  70. '<div class="ui-grid-cell-contents">{{row.entity.uuid}}</div>' +
  71. '</div>'
  72. },
  73. {
  74. name: 'props.hw_mingcheng',
  75. enableSorting: false,
  76. displayName: '资产名称',
  77. width: 160,
  78. enableFiltering: false,
  79. cellTemplate: '<div>' +
  80. '<div class="ui-grid-cell-contents">{{row.entity.props.hw_mingcheng}}</div>' +
  81. '</div>'
  82. },
  83. {
  84. name: 'props.hw_state',
  85. enableSorting: false,
  86. displayName: '状态',
  87. width: '5%',
  88. minWidth: 80,
  89. enableFiltering: false,
  90. cellTemplate: '<div>' +
  91. '<div class="ui-grid-cell-contents">{{row.entity.props.hw_state}}</div>' +
  92. '</div>'
  93. },
  94. // {
  95. // name: 'status',
  96. // enableSorting: false,
  97. // displayName: '资产型号',
  98. // width: 217,
  99. // enableFiltering: false ,
  100. // // cellTemplate: '<div>' +
  101. // // '<div class="ui-grid-cell-contents">{{row.entity.managementUnit.name}}</div>' +
  102. // // '</div>'
  103. // },
  104. // {
  105. // name: 'placeBasehw',
  106. // enableSorting: false,
  107. // displayName: '资产地点',
  108. // width: 88,
  109. // enableFiltering: false ,
  110. // // cellTemplate: '<div>' +
  111. // // '<div class="ui-grid-cell-contents">{{row.entity.managementUnit.name}}</div>' +
  112. // // '</div>'
  113. // },
  114. {
  115. name: 'createtime',
  116. enableSorting: false,
  117. displayName: '入库时间',
  118. width: '14%',
  119. minWidth: 140,
  120. enableFiltering: false,
  121. cellTemplate: '<div>' +
  122. '<div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.createtime)}}</div>' +
  123. '</div>'
  124. },
  125. {
  126. name: 'lastupdatetime',
  127. enableSorting: false,
  128. displayName: '最后更新时间',
  129. width: '14%',
  130. minWidth: 140,
  131. enableFiltering: false,
  132. cellTemplate: '<div>' +
  133. '<div class="ui-grid-cell-contents">{{grid.appScope.transferTime(row.entity.lastupdatetime)}}</div>' +
  134. '</div>'
  135. },
  136. // {
  137. // name: 'props.meansmanager',
  138. // enableSorting: false,
  139. // displayName: '资产所有人',
  140. // width: 98,
  141. // enableFiltering: false ,
  142. // // cellTemplate: '<div>' +
  143. // // '<div class="ui-grid-cell-contents">{{row.entity.managementUnit.name}}</div>' +
  144. // // '</div>'
  145. // },
  146. {
  147. name: 'props.hw_zherenren',
  148. enableSorting: false,
  149. displayName: '责任人',
  150. width: '10%',
  151. minWidth: '80',
  152. enableFiltering: false,
  153. cellTemplate: '<div>' +
  154. '<div class="ui-grid-cell-contents">{{row.entity.props.hw_zherenren}}</div>' +
  155. '</div>'
  156. },
  157. {
  158. name: 'props.hwnw_xiangmu',
  159. enableSorting: false,
  160. displayName: '所属项目',
  161. width: 148,
  162. enableFiltering: false,
  163. cellTemplate: '<div>' +
  164. '<div class="ui-grid-cell-contents">{{row.entity.props.hwnw_xiangmu}}</div>' +
  165. '</div>'
  166. },
  167. {
  168. name: 'props.erweima',
  169. enableSorting: false,
  170. displayName: '是否贴过二维码',
  171. width: 132,
  172. enableFiltering: false,
  173. cellTemplate: '<div>' +
  174. '<div class="ui-grid-cell-contents">{{row.entity.qrcodeState == 1?"是":"否"}}</div>' +
  175. '</div>'
  176. },
  177. {
  178. name: '操作',
  179. enableSorting: false,
  180. width:'9%',
  181. minWidth: 130,
  182. cellTemplate: '<wttt class="bianjifont" style="background-color:{{row.entity.colourInfo.rgb}}" item="row.entity" colobject="col">',
  183. enableFiltering: false
  184. },
  185. ];
  186. $scope.transferTime = function(time) {
  187. return moment(time).format('YYYY-MM-DD HH:mm');
  188. }
  189. $scope.gridOptions.rowTemplate = "<div ng-click=\"onview(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>";
  190. //修改
  191. $scope.onClick = function(row) {
  192. // $scope.classify="basehwntwsv";
  193. var data = { "model": row };
  194. $state.go('app.means.bill', { formKey: 'means_edit', service: 'api_cmdb', 'model': JSON.stringify(data) })
  195. };
  196. //双击查看详情
  197. $scope.onDblClick = function(row) {
  198. localStorage.ciclassify = JSON.stringify($scope.my_tree);
  199. $state.go('app.means.fixed_see', { gdzc_label: row.entity.label, gdzc_item: JSON.stringify(row.entity), idd: row.entity.id })
  200. };
  201. //打印二维码
  202. $scope.printIt = function(){
  203. var uuidArr = [];
  204. var uuidStr = '';
  205. angular.forEach($scope.selected.items,function(v){
  206. uuidArr.push(v.uuid);
  207. })
  208. uuidStr = uuidArr.join(',');
  209. api_cmdb_print.getCmdbPrit(uuidStr).then(function(res){})
  210. }
  211. //查看
  212. $scope.onview = function(row) {
  213. console.log(row);
  214. var data = { "model": row };
  215. $state.go('app.means.view', { formKey: 'means_edit', service: 'api_cmdb', 'model': JSON.stringify(data) })
  216. };
  217. $scope.fileData={
  218. "idx":0,
  219. "sum":10
  220. }
  221. //查看关系图
  222. $scope.lookmap = function(row) {
  223. var data = { "model": row };
  224. // $state.go('cmdbmap', { 'model': JSON.stringify(data) });
  225. // var data = { "model": row };
  226. // var url = serverurl + '/cmdbmap/' + JSON.stringify(data)
  227. // window.open(url, '_blank');
  228. localStorage.cmdbmap = JSON.stringify(data);
  229. localStorage.ciclassify = JSON.stringify($scope.my_tree);
  230. var url = $state.href('cmdbmap', { basicType: 8 });
  231. window.open(url, '_blank');
  232. }
  233. $scope.gridOptions.onRegisterApi = function(gridApi) {
  234. $scope.gridApi = gridApi;
  235. gridApi.pagination.on.paginationChanged($scope, function(newPage, pageSize) {
  236. var filtersData = $scope.memoryfilterData;
  237. $scope.fenye = newPage - 1;
  238. filtersData.idx = newPage - 1;
  239. filtersData.sum = pageSize;
  240. $scope.fileData.idx=newPage - 1;
  241. $scope.fileData.sum=pageSize;
  242. $scope.refreshData('expand-right', $scope.fileData);
  243. // $scope.refreshData('expand-right', {"assignee":$rootScope.user.id, "candidateGroups":$rootScope.user.group[0].id, "idx":newPage-1,"sum":pageSize});
  244. });
  245. // $scope.sels=[];
  246. gridApi.selection.on.rowSelectionChanged($scope, function(scope, ect) {
  247. if (scope.isSelected) {
  248. scope.grid.appScope.selected.items.push(scope.entity)
  249. } else {
  250. for (var i = 0; i <= scope.grid.appScope.selected.items.length; i++) {
  251. if (scope.grid.appScope.selected.items[i].id == scope.entity.id) {
  252. scope.grid.appScope.selected.items.splice(i, 1);
  253. break;
  254. }
  255. }
  256. }
  257. // var j = 0;
  258. // for (var i = 0; i <= scope.grid.appScope.selected.items.length; i++) {
  259. // if (scope.grid.appScope.selected.items[i] == scope.entity) {
  260. // j++;
  261. // break;
  262. // }
  263. // }
  264. // if (j == 1) {
  265. // scope.grid.appScope.selected.items.splice(i, 1);
  266. // } else {
  267. // scope.grid.appScope.selected.items.push(scope.entity);
  268. // }
  269. $scope.mySelectedRows = $scope.gridApi.selection.getSelectedRows();
  270. });
  271. gridApi.selection.on.rowSelectionChangedBatch($scope, function(rows) {
  272. var selectitem = [];
  273. selectitem = angular.copy($scope.selected.items);
  274. for (var j = 0; j < rows.length; j++) {
  275. if (rows[j].isSelected == true) {
  276. selectitem.push(rows[j].entity);
  277. } else {
  278. delete selectitem[j];
  279. // rows.splice(j, 1);
  280. }
  281. }
  282. $scope.selected.items = [];
  283. for (var i = 0; i < selectitem.length; i++) {
  284. if (selectitem[i]) {
  285. $scope.selected.items.push(selectitem[i]);
  286. }
  287. }
  288. });
  289. };
  290. // 条件搜索下拉框
  291. $scope.lb_tiaojian = {};
  292. $scope.tiaojian = [
  293. { "name": "资产编码", "value": "uuid" },
  294. { "name": "资产名称", "value": "hw_mingcheng" },
  295. { "name": "型号", "value": "hw_modelnumber" },
  296. { "name": "序列号", "value": "hw_assetsxlh" },
  297. { "name": "用途", "value": "hw_assetsyongtu" },
  298. { "name": "IP", "value": "hw_assetsip" },
  299. { "name": "位置", "value": "hw_assetsweizhi" }
  300. ]
  301. // 点击搜索
  302. $scope.searchSolution = function(type, key) {
  303. $scope.gridApi.grid.options.paginationCurrentPage = 1;
  304. var memoryfilterData = {
  305. "idx": 0,
  306. "sum": $scope.gridOptions.paginationPageSize
  307. };
  308. angular.extend($scope.memoryfilterData, memoryfilterData);
  309. $scope.memoryfilterData['searchCriteria'] = type;
  310. $scope.memoryfilterData['keys'] = key;
  311. $scope.fileData['searchCriteria']=type;
  312. $scope.fileData['keys']=key;
  313. // $scope.memoryfilterData=defaultFilterData;
  314. // api_cmdb.searchkey(defaultFilterData.type,defaultFilterData.key,defaultFilterData.idx,defaultFilterData.sum).then(function(data){
  315. // var myData = Restangular.stripRestangular(data);
  316. // if(myData.data&&myData.status==200){
  317. // $scope.gridOptions.totalItems = myData.total;
  318. // $scope.myData = myData.data;
  319. // }
  320. // });
  321. $scope.refreshData('expand-right', $scope.fileData);
  322. }
  323. // 资产状态
  324. $scope.lb_state_data = {};
  325. $scope.getStateSelect=function(){
  326. var data={
  327. "key":"cmdb_status",
  328. "type":"list"
  329. }
  330. api_wechatfile.getDictionary(data).then(function(res){
  331. $scope.state_data=res
  332. })
  333. }
  334. $scope.getStateSelect();
  335. // $scope.state_data = [
  336. // { "name": "全部状态", "value": "" },
  337. // { "name": "在库", "value": "1" },
  338. // { "name": "在线", "value": "2" },
  339. // { "name": "借出", "value": "3" },
  340. // { "name": "报修", "value": "4" },
  341. // { "name": "报废", "value": "5" },
  342. // // {"name":"备用","value":"6"},
  343. // ]
  344. $scope.onChangestatus = function(searchType) {
  345. console.log(searchType.value);
  346. if (searchType.value == "") {
  347. var all = {
  348. "idx": 0,
  349. "sum": $scope.gridOptions.paginationPageSize
  350. };
  351. $scope.refreshData('expand-right', $scope.fileData);
  352. } else {
  353. // defaultFilterData['status'] = searchType;
  354. $scope.gridApi.grid.options.paginationCurrentPage = 1;
  355. var memoryfilterData = {
  356. "idx": 0,
  357. "sum": $scope.gridOptions.paginationPageSize
  358. };
  359. angular.extend($scope.memoryfilterData, memoryfilterData);
  360. // $scope.memoryfilterData['state'] = searchType.value;
  361. $scope.memoryfilterData['hw_state'] = searchType.name;
  362. $scope.fileData['hw_state']=searchType.name;
  363. $scope.refreshData('expand-right', $scope.fileData);
  364. }
  365. }
  366. this.selectRowFunction = function(data) {
  367. $scope.ciId = data.id;
  368. // localStorage.ciclassify = JSON.stringify($scope.my_tree);
  369. // console.log(data);
  370. };
  371. //树形图
  372. var apple_selected, tree, treedata_avm, treedata_geography;
  373. $scope.my_tree_handler = function(branch) {
  374. //var _ref;
  375. var classify = $scope.classify = branch.prefix.toLowerCase() + branch.sign;
  376. api_cmdb.query({ 'sign': classify }).then(function(data) {
  377. var myData = Restangular.stripRestangular(data);
  378. // console.log(myData.data.node);
  379. if (myData.data && myData.status == 200) {
  380. var ret = myData.data;
  381. redrawSvg(myData);
  382. }
  383. });
  384. };
  385. $scope.my_data = [];
  386. function convertListToTree(data, treeMap) {
  387. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  388. var root = null; //Initially set our loop to null
  389. var parentNode = null;
  390. //loop over data
  391. for (var i = 0; i < data.length; i++) {
  392. var datum = data[i];
  393. //each node will have children, so let's give it a "children" poperty
  394. datum.children = [];
  395. //add an entry for this node to the map so that any future children can
  396. //lookup the parent
  397. idToNodeMap[datum.id] = datum;
  398. //Does this node have a parent?
  399. if (typeof datum.parent === "undefined" || datum.parent == null) {
  400. //Doesn't look like it, so this node is the root of the tree
  401. root = datum;
  402. treeMap[datum.id] = root;
  403. } else {
  404. //This node has a parent, so let's look it up using the id
  405. parentNode = idToNodeMap[datum.parent.id];
  406. //We don't need this property, so let's delete it.
  407. delete datum.parent;
  408. //Let's add the current node as a child of the parent node.
  409. parentNode.children.push(datum);
  410. }
  411. }
  412. return root;
  413. }
  414. function convertParentToChildList(data) {
  415. var treeMap = {};
  416. var list = [];
  417. convertListToTree(data, treeMap);
  418. angular.forEach(treeMap, function(item) {
  419. list.push(item);
  420. });
  421. return list;
  422. }
  423. $scope.my_tree = tree = {};
  424. $scope.try_async_load = function() {
  425. $scope.my_data = [];
  426. $scope.select_treedata = [];
  427. $scope.doing_async = true;
  428. api_configure_data.fetchDataList('ciclassify', { 'idx': 0, 'sum': 100 }).then(function(result) {
  429. $scope.my_tree = result['list'];
  430. $scope.select_treedata = $scope.my_data = convertParentToChildList(result['list']);
  431. $scope.doing_async = false;
  432. // tree.expand_all();
  433. //console.log(treelist);
  434. });
  435. };
  436. $scope.select_treedata = [];
  437. $scope.propTypeOptions = [];
  438. $scope.try_async_load();
  439. $scope.onFilterremove = function(item) {
  440. console.log(item)
  441. }
  442. // 资产分类
  443. $scope.onFilterCallback = function(item) {
  444. //console.log(item);
  445. if (angular.isDefined(item.children) && item.children.length >= 1) {
  446. //not valid
  447. } else {
  448. var tempclassify = (item.item?item.item.prefix.toLowerCase():item.prefix.toLowerCase()) + (item.item?item.item.sign:item.sign);
  449. $scope.gridApi.grid.options.paginationCurrentPage = 1;
  450. $scope.cifilter_classic = tempclassify;
  451. var memoryfilterData = {
  452. "sign": tempclassify,
  453. "idx": 0,
  454. "sum": $scope.gridOptions.paginationPageSize
  455. }
  456. angular.extend($scope.memoryfilterData, memoryfilterData);
  457. $scope.fileData["sign"]=tempclassify;
  458. // $scope.memoryfilterData=memoryfilterData;
  459. $scope.refreshData('expand-right', $scope.fileData);
  460. // 专有属性
  461. api_configure_form.renderTabForm(tempclassify).then(function(data) {
  462. var myData = Restangular.stripRestangular(data);
  463. angular.forEach(myData, function(item, index) {
  464. if (index == 0) {
  465. $scope.propTypeOptions = myData[0].form.fields;
  466. } else {
  467. angular.forEach(item.form.fields, function(itemdata) {
  468. $scope.propTypeOptions.push(itemdata)
  469. })
  470. }
  471. })
  472. // $scope.propTypeOptions = myData[2].form.fields;
  473. console.log($scope.propTypeOptions)
  474. });
  475. }
  476. }
  477. //关系下载模版
  478. api_configure_data.fetchDataList('ciedgetype', { 'idx': 0, 'sum': 100 }).then(function(response) {
  479. if (response) {
  480. $scope.linktypeOptions = response.list;
  481. // angular.forEach($scope.linktypeOptions,function(item){
  482. // if(item.type==$scope.modelData.name){
  483. // $scope.modelData.linkName=item;
  484. // }
  485. // })
  486. }
  487. })
  488. $scope.rela = {};
  489. $scope.onChange = function(rela) {
  490. $scope.rela = rela;
  491. }
  492. //下载关系属性模版
  493. $scope.openmodel = function() {
  494. var modalInstance = $modal.open({
  495. templateUrl: 'assets/views/means/tpl/relationdown.html',
  496. controller: function($scope, scope, $modalInstance) {
  497. $scope.key = {};
  498. $scope.linktypeOptions = scope.linktypeOptions;
  499. $scope.ok = function(key) {
  500. $modalInstance.close(key);
  501. };
  502. $scope.cancel = function() {
  503. $modalInstance.dismiss('cancel');
  504. };
  505. },
  506. size: 'sm',
  507. resolve: {
  508. scope: function() {
  509. return $scope;
  510. }
  511. }
  512. });
  513. modalInstance.result.then(function(selectedItem) {
  514. if (selectedItem && angular.isDefined(selectedItem.type)) {
  515. var type = 2;
  516. $http({
  517. url: api_configure_data.downModels(type, selectedItem.id, selectedItem.label).getRequestedUrl(),
  518. method: 'GET',
  519. headers: {
  520. // 'Content-type' : 'application/xls',
  521. 'Accept': '*/*'
  522. },
  523. responseType: 'arraybuffer'
  524. }).success(function(data, status, headers, config) {
  525. var file = new Blob([data], {
  526. type: 'application/octet-stream'
  527. // type : 'application/vnd.ms-excel'
  528. });
  529. //trick to download store a file having its URL
  530. var fileURL = URL.createObjectURL(file);
  531. var a = document.createElement('a');
  532. a.href = fileURL;
  533. a.target = '_blank';
  534. a.download = "关系属性.xlsx";
  535. document.body.appendChild(a);
  536. a.click();
  537. }).error(function(data, status, headers, config) {
  538. console.log(data);
  539. });
  540. } else {
  541. SweetAlert.swal({
  542. title: "未选择资产关系!",
  543. text: "请选择资产关系",
  544. type: "error"
  545. })
  546. }
  547. });
  548. }
  549. $scope.importopen = function() { //导入触发事件
  550. var modalInstance = $modal.open({
  551. templateUrl: 'assets/views/import.html',
  552. controller: function($scope, $modalInstance, FileUploader) {
  553. var importUploader = $scope.importUploader = new FileUploader({
  554. url: api_cmdb.importData().getRequestedUrl(),
  555. alias: "file",
  556. removeAfterUpload: true
  557. });
  558. importUploader.onWhenAddingFileFailed = function(item /*{File|FileLikeObject}*/ , filter, options) {
  559. console.info('onWhenAddingFileFailed', item, filter, options);
  560. };
  561. importUploader.onAfterAddingFile = function(fileItem) {
  562. console.info('onAfterAddingFile', fileItem);
  563. if ($scope.importUploader.queue.length > 1) {
  564. $scope.importUploader.queue.splice(0, 1);
  565. }
  566. };
  567. importUploader.onAfterAddingAll = function(addedFileItems) {
  568. console.info('onAfterAddingAll', addedFileItems);
  569. };
  570. importUploader.onProgressItem = function(fileItem, progress) {
  571. console.info('onProgressItem', fileItem, progress);
  572. };
  573. importUploader.onProgressAll = function(progress) {
  574. console.info('onProgressAll', progress);
  575. };
  576. importUploader.onSuccessItem = function(fileItem, response, status, headers) {
  577. if (response.status == 200) {
  578. SweetAlert.swal({
  579. title: "导入成功!",
  580. confirmButtonColor: "#007AFF",
  581. type: "success"
  582. }, function() {
  583. $rootScope.isMask = false;
  584. // $scope.ldloading.expand_right = false;
  585. });
  586. console.info('onSuccessItem', fileItem, response, status, headers);
  587. } else {
  588. SweetAlert.swal({
  589. title: "导入失败!",
  590. text: response.error,
  591. type: "error"
  592. }, function() {
  593. $rootScope.isMask = false;
  594. // $scope.ldloading.expand_right = false;
  595. });
  596. }
  597. };
  598. importUploader.onErrorItem = function(fileItem, response, status, headers) {
  599. console.info('onErrorItem', fileItem, response, status, headers);
  600. SweetAlert.swal({
  601. title: "系统错误!",
  602. text: "系统错误,请稍候重试!",
  603. type: "error"
  604. }, function() {
  605. // $scope.ldloading.expand_right = false;
  606. $rootScope.isMask = false;
  607. });
  608. };
  609. importUploader.onCancelItem = function(fileItem, response, status, headers) {
  610. console.info('onCancelItem', fileItem, response, status, headers);
  611. };
  612. importUploader.onCompleteItem = function(fileItem, response, status, headers) {
  613. console.info('onCompleteItem', fileItem, response, status, headers);
  614. };
  615. importUploader.onCompleteAll = function() {
  616. console.info('onCompleteAll');
  617. };
  618. $scope.import = function(style) {
  619. // $scope.ldloading[style.replace('-', '_')] = true;
  620. $rootScope.isMask = true;
  621. importUploader.onBeforeUploadItem = function(item) {
  622. angular.extend(item.headers, $rootScope.getSession());
  623. item.formData.push({ 'filename': item.file.name });
  624. console.info('onBeforeUploadItem', item);
  625. };
  626. importUploader.uploadAll();
  627. }
  628. $scope.cancel = function() {
  629. $modalInstance.dismiss('cancel');
  630. };
  631. },
  632. size: 'sm',
  633. resolve: {
  634. importUploader: function() {
  635. return $scope.importUploader;
  636. }
  637. }
  638. });
  639. modalInstance.result.then(function(selectedItem) {
  640. if (selectedItem) {}
  641. })
  642. }
  643. //添加
  644. $scope.addData = function(size) {
  645. $state.go('app.means.editor', { formKey: 'means_editor', service: 'api_bpm_data' });
  646. }
  647. //下载资产模版
  648. $scope.openmeans = function() {
  649. var modalInstance = $modal.open({
  650. templateUrl: 'assets/views/means/tpl/meansdown.html',
  651. controller: function($scope, scope, $modalInstance) {
  652. $scope.item = {};
  653. $scope.headname = "资产模版下载";
  654. $scope.select_treedata = scope.select_treedata;
  655. $scope.ok = function(item) {
  656. $modalInstance.close(item);
  657. };
  658. $scope.cancel = function() {
  659. $modalInstance.dismiss('cancel');
  660. };
  661. },
  662. size: 'sm',
  663. resolve: {
  664. scope: function() {
  665. return $scope;
  666. }
  667. }
  668. });
  669. modalInstance.result.then(function(selectedItem) {
  670. $rootScope.isMask = true;
  671. if (selectedItem) {
  672. // if (angular.isDefined(classfy)) {
  673. var type = 1;
  674. // api_configure_data.fetchDataList('ciclassify', { 'idx': 0, 'sum': 100 }).then(function(data) {
  675. // if (data.status == 200) {
  676. // var myData = Restangular.stripRestangular(data).list;
  677. // for (var i = 0; i < $scope.select_treedata.length; i++) {
  678. // if ((myData[i].prefix.toLowerCase() + myData[i].sign) == classfy) {
  679. $http({
  680. url: api_configure_data.downModels(type, selectedItem.id, selectedItem.label).getRequestedUrl(),
  681. method: 'GET',
  682. headers: {
  683. // 'Content-type' : 'application/xls',
  684. 'Accept': '*/*'
  685. },
  686. responseType: 'arraybuffer'
  687. }).success(function(data, status, headers, config) {
  688. $rootScope.isMask = false;
  689. var file = new Blob([data], {
  690. type: 'application/octet-stream'
  691. // type : 'application/vnd.ms-excel'
  692. });
  693. //trick to download store a file having its URL
  694. var fileURL = URL.createObjectURL(file);
  695. var a = document.createElement('a');
  696. a.href = fileURL;
  697. a.target = '_blank';
  698. a.download = "资产属性.xlsx";
  699. document.body.appendChild(a);
  700. a.click();
  701. }).error(function(data, status, headers, config) {
  702. console.log(data);
  703. $rootScope.isMask = false;
  704. });
  705. // break;
  706. // }
  707. // }
  708. // }
  709. // })
  710. } else {
  711. SweetAlert.swal({
  712. title: "未选择资产分类!",
  713. text: "请选择资产分类",
  714. type: "error"
  715. }, function() {
  716. $rootScope.isMask = false;
  717. });
  718. }
  719. // }
  720. });
  721. }
  722. // 重置按钮
  723. $scope.reset = function() {
  724. $scope.propTypeOptions = [];
  725. $scope.lb_state_data = {};
  726. $scope.lb_tiaojian = {};
  727. $scope.searchSolutionInput = "";
  728. if ($scope.fenye == undefined) {
  729. $scope.fenye = 0
  730. };
  731. $scope.try_async_load();
  732. $scope.memoryfilterData = {
  733. idx: 0,
  734. sum: mun
  735. };
  736. $scope.fileData={
  737. "idx":$scope.fileData.idx,
  738. "sum":$scope.fileData.sum
  739. }
  740. $scope.refreshData('expand-right', $scope.fileData);
  741. // $scope.memoryfilterData={
  742. // "idx": 0,
  743. // "sum": $scope.gridOptions.paginationPageSize,
  744. // }
  745. }
  746. // 新增下拉框
  747. $scope.new_one = [
  748. { "keys": { templateOptions: { label: "选择搜索字段" } }, "vals": "" },
  749. { "keys": { templateOptions: { label: "选择搜索字段" } }, "vals": "" },
  750. { "keys": { templateOptions: { label: "选择搜索字段" } }, "vals": "" }
  751. ];
  752. // var k=1;
  753. // 新增按钮
  754. $scope.new_select = function() {
  755. // k++;
  756. if ($scope.new_one.length >= $scope.propTypeOptions.length) {
  757. SweetAlert.swal({
  758. title: "新增失败",
  759. text: "新增项已达到上限!",
  760. type: "error"
  761. });
  762. return false
  763. } else {
  764. $scope.new_one.push({ "keys": { templateOptions: { label: "选择搜索字段" } }, "vals": "" })
  765. }
  766. }
  767. // 删除搜索框出现的字段
  768. $scope.delet = function(val) {
  769. // console.log($scope.propTypeOptions);
  770. // console.log(val);
  771. $scope.propTypeOptions.splice($scope.propTypeOptions.indexOf(val), 1)
  772. }
  773. $scope.gdzc_edit = "new_top";
  774. // 高级搜索搜索
  775. $scope.gaoji_search = function() {
  776. $scope.key1 = {};
  777. // var sear_data={
  778. // "idx": 0,
  779. // "sum": $scope.gridOptions.paginationPageSize,
  780. // }
  781. // console.log($scope.new_one);
  782. for (var j = 0; j < $scope.new_one.length; j++) {
  783. $scope.fileData[$scope.new_one[j].keys.key] = $scope.new_one[j].vals;
  784. }
  785. // angular.extend($scope.memoryfilterData, sear_data)
  786. delete($scope.fileData[undefined]);
  787. $scope.refreshData('expand-right', $scope.fileData);
  788. $scope.senior_show = false;
  789. $scope.gdzc_edit = "new_top";
  790. }
  791. $scope.senior_show = false;
  792. // 高级搜索按钮
  793. $scope.senior_cli = function() {
  794. if ($scope.propTypeOptions.length == 0) {
  795. SweetAlert.swal({
  796. title: "点开失败",
  797. text: "请先选择资产分类!",
  798. type: "error"
  799. });
  800. } else {
  801. $scope.senior_show = true;
  802. $scope.gdzc_edit = "new_after";
  803. $scope.new_one = [
  804. { "keys": { templateOptions: { label: "选择搜索字段" } }, "vals": "" },
  805. { "keys": { templateOptions: { label: "选择搜索字段" } }, "vals": "" },
  806. { "keys": { templateOptions: { label: "选择搜索字段" } }, "vals": "" },
  807. ];
  808. }
  809. }
  810. // 高级搜索关闭按钮
  811. $scope.close = function() {
  812. $scope.senior_show = false;
  813. $scope.gdzc_edit = "new_top";
  814. }
  815. // 刷新
  816. $scope.new_data = function() {
  817. console.log($scope.memoryfilterData);
  818. $scope.myData = [];
  819. if ($scope.fenye == undefined) {
  820. $scope.fenye = 0
  821. };
  822. $scope.refreshData('expand-right', $scope.fileData);
  823. }
  824. //导出
  825. $scope.exportopen = function() {
  826. var modalInstance = $modal.open({
  827. templateUrl: 'assets/views/means/tpl/gdzc_meansdown.html',
  828. controller: function($scope, scope, $modalInstance) {
  829. $scope.item = {};
  830. $scope.headname = "资产导出";
  831. $scope.select_treedata = scope.select_treedata;
  832. $scope.ok = function(item) {
  833. $modalInstance.close(item);
  834. };
  835. $scope.cancel = function() {
  836. $modalInstance.dismiss('cancel');
  837. };
  838. },
  839. size: 'sm',
  840. resolve: {
  841. scope: function() {
  842. return $scope;
  843. }
  844. }
  845. });
  846. modalInstance.result.then(function(selectedItem) {
  847. $rootScope.isMask = true;
  848. if (selectedItem) {
  849. // if (angular.isDefined(classfy)) {
  850. var type = 1;
  851. // api_configure_data.fetchDataList('ciclassify', { 'idx': 0, 'sum': 100 }).then(function(data) {
  852. // if (data.status == 200) {
  853. // var myData = Restangular.stripRestangular(data).list;
  854. // for (var i = 0; i < $scope.select_treedata.length; i++) {
  855. // if ((myData[i].prefix.toLowerCase() + myData[i].sign) == classfy) {
  856. $http({
  857. url: api_cmdb.exportData(selectedItem.label, selectedItem.id).getRequestedUrl(),
  858. method: 'GET',
  859. headers: {
  860. // 'Content-type' : 'application/xls',
  861. 'Accept': '*/*'
  862. },
  863. responseType: 'arraybuffer'
  864. }).success(function(data, status, headers, config) {
  865. $rootScope.isMask = false;
  866. var file = new Blob([data], {
  867. type: 'application/octet-stream'
  868. // type : 'application/vnd.ms-excel'
  869. });
  870. //trick to download store a file having its URL
  871. var fileURL = URL.createObjectURL(file);
  872. var a = document.createElement('a');
  873. a.href = fileURL;
  874. a.target = '_blank';
  875. a.download = selectedItem.label + '.xlsx';
  876. document.body.appendChild(a);
  877. a.click();
  878. }).error(function(data, status, headers, config) {
  879. $rootScope.isMask = false;
  880. console.log(data);
  881. });
  882. // break;
  883. // }
  884. // }
  885. // }
  886. // })
  887. } else {
  888. SweetAlert.swal({
  889. title: "未选择资产分类!",
  890. text: "请选择资产分类",
  891. type: "error"
  892. }, function() {
  893. $rootScope.isMask = false;
  894. });
  895. }
  896. // }
  897. });
  898. }
  899. //导入
  900. var importUploader = $scope.importUploader = new FileUploader({
  901. url: api_cmdb.importData().getRequestedUrl()
  902. });
  903. importUploader.onWhenAddingFileFailed = function(item /*{File|FileLikeObject}*/ , filter, options) {
  904. console.info('onWhenAddingFileFailed', item, filter, options);
  905. };
  906. importUploader.onAfterAddingFile = function(fileItem) {
  907. console.info('onAfterAddingFile', fileItem);
  908. };
  909. importUploader.onAfterAddingAll = function(addedFileItems) {
  910. console.info('onAfterAddingAll', addedFileItems);
  911. };
  912. importUploader.onProgressItem = function(fileItem, progress) {
  913. console.info('onProgressItem', fileItem, progress);
  914. };
  915. importUploader.onProgressAll = function(progress) {
  916. console.info('onProgressAll', progress);
  917. };
  918. importUploader.onSuccessItem = function(fileItem, response, status, headers) {
  919. if (response.status == 200) {
  920. SweetAlert.swal({
  921. title: "导入成功!",
  922. confirmButtonColor: "#007AFF",
  923. type: "success"
  924. }, function() {
  925. $rootScope.isMask = false;
  926. });
  927. console.info('onSuccessItem', fileItem, response, status, headers);
  928. } else {
  929. SweetAlert.swal({
  930. title: "导入失败!",
  931. text: response.error,
  932. type: "error"
  933. }, function() {
  934. $rootScope.isMask = false;
  935. });
  936. }
  937. };
  938. importUploader.onErrorItem = function(fileItem, response, status, headers) {
  939. console.info('onErrorItem', fileItem, response, status, headers);
  940. SweetAlert.swal({
  941. title: "系统错误!",
  942. text: "系统错误,请稍候重试!",
  943. type: "error"
  944. }, function() {
  945. $rootScope.isMask = false;
  946. });
  947. };
  948. importUploader.onCancelItem = function(fileItem, response, status, headers) {
  949. console.info('onCancelItem', fileItem, response, status, headers);
  950. };
  951. importUploader.onCompleteItem = function(fileItem, response, status, headers) {
  952. console.info('onCompleteItem', fileItem, response, status, headers);
  953. };
  954. importUploader.onCompleteAll = function() {
  955. console.info('onCompleteAll');
  956. };
  957. $scope.import = function(style) {
  958. $rootScope.isMask = true;
  959. importUploader.onBeforeUploadItem = function(item) {
  960. angular.extend(item.headers, $rootScope.getSession());
  961. item.formData.push({ 'filename': item.file.name });
  962. console.info('onBeforeUploadItem', item);
  963. };
  964. importUploader.uploadAll();
  965. }
  966. $scope.removeData = function() {
  967. var rmvList = $scope.selected.items.id;
  968. // angular.forEach($scope.selected.items,function(item){
  969. // rmvList.push(item.id);
  970. // });
  971. // if(rmvList.length>0){
  972. api_cmdb.put($scope.selected.items, rmvList).then(function(response) {
  973. if (response.status == 200) {
  974. SweetAlert.swal({
  975. title: "删除成功!",
  976. type: "success",
  977. confirmButtonColor: "#007AFF"
  978. }, function() {
  979. $scope.myData = _.reject($scope.myData, function(o) { return _.includes(rmvList, o.id); });
  980. $scope.selected = {
  981. items: []
  982. };
  983. });
  984. } else {
  985. SweetAlert.swal({
  986. title: "操作异常!",
  987. text: "系统异常,请稍后重试,或者联系管理员!",
  988. type: "error"
  989. });
  990. }
  991. })
  992. // }
  993. }
  994. $scope.selected = {
  995. items: []
  996. }
  997. $scope.editted = {
  998. items: []
  999. }
  1000. var defaultFilterData = {
  1001. // "assignee":2,
  1002. // "sign":"basehwitndl",
  1003. "idx": 0,
  1004. "sum": $scope.gridOptions.paginationPageSize
  1005. };
  1006. $scope.memoryfilterData = {
  1007. // "assignee":2,
  1008. // "sign":"basehwitndl",
  1009. "idx": 0,
  1010. "sum": $scope.gridOptions.paginationPageSize
  1011. }
  1012. $scope.ldloading = {};
  1013. var pdKey = $state.current.pdKey;
  1014. $scope.refreshData = function(style, filterData) {
  1015. if (angular.isUndefined(filterData)) {
  1016. filterData = defaultFilterData;
  1017. }
  1018. $scope.myData = [];
  1019. // $scope.gridOptions['sum']=filterData.sum;
  1020. api_cmdb.query(filterData).then(function(data) {
  1021. // $scope.callsPending--;
  1022. var myData = Restangular.stripRestangular(data);
  1023. $scope.gridOptions['totalItems'] = data.total;
  1024. // angular.forEach(myData.data.node,function(item){
  1025. // moment(item.createtime).format('YYYY-MM-DD');
  1026. // })
  1027. // for (var i = 0; i < myData.data.node.length; i++) {
  1028. // myData.data.node[i].createtime = moment(myData.data.node[i].createtime).format('YYYY-MM-DD');
  1029. // }
  1030. $scope.myData = myData.data.node;
  1031. for (var n = 0; n < $scope.myData.length; n++) {
  1032. $scope.myData[n]['item'] = n + 1 + filterData.idx * filterData.sum
  1033. }
  1034. console.log( $scope.myData)
  1035. }, function() {});
  1036. };
  1037. $scope.refreshData2 = function(style, filterData) {
  1038. if (angular.isUndefined(filterData)) {
  1039. filterData = defaultFilterData;
  1040. }
  1041. // $scope.myData = [];
  1042. // $scope.gridOptions['sum']=filterData.sum;
  1043. api_cmdb.query(filterData).then(function(data) {
  1044. // $scope.callsPending--;
  1045. var myData = Restangular.stripRestangular(data);
  1046. $scope.gridOptions['totalItems'] = data.total;
  1047. // angular.forEach(myData.data.node,function(item){
  1048. // moment(item.createtime).format('YYYY-MM-DD');
  1049. // })
  1050. // for (var i = 0; i < myData.data.node.length; i++) {
  1051. // myData.data.node[i].createtime = moment(myData.data.node[i].createtime).format('YYYY-MM-DD');
  1052. // }
  1053. $scope.myData = myData.data.node;
  1054. for (var i = 0; i < $scope.myData.length; i++) {
  1055. $scope.myData[i]['item'] = i + 1 + filterData.idx * filterData.sum
  1056. }
  1057. }, function() {});
  1058. };
  1059. $scope.refreshData('expand-right', $scope.fileData);
  1060. $scope.timer = $interval(function () {
  1061. $scope.refreshData2('expand-right', $scope.fileData)
  1062. }, $rootScope.refreshTime);
  1063. $scope.$on('$destroy', function () {
  1064. $interval.cancel($scope.timer)
  1065. });
  1066. }]);
  1067. app.controller('MeansOperCtrl', ['$rootScope', '$http', '$scope', function($rootScope, $http, $scope) {
  1068. // console.log('$rootScope.user3='+JSON.stringify($scope.item));
  1069. // if( $scope.item.handlerUser!=null){
  1070. // if ($rootScope.user.id==$scope.item.handlerUser.id) {
  1071. // $scope.item.chaozuoPower=true;
  1072. // }
  1073. // }
  1074. $scope.look = function() {
  1075. $scope.colobject.grid.appScope.lookFunction($scope.item);
  1076. // console.log('$scope.item='+JSON.stringify($scope.item));
  1077. }
  1078. $scope.edit = function() {
  1079. $scope.colobject.grid.appScope.selectRowFunction($scope.item);
  1080. console.log('$scope.item=' + JSON.stringify($scope.item));
  1081. // $scope.doEdit($scope.item.id);
  1082. }
  1083. }]);
  1084. //操作按钮权限控制
  1085. app.controller('gdzc_caozuoCtrl', ['$rootScope', '$http', '$scope', '$modal', 'api_cmdb2', 'api_bpm_domain', 'up_down_file', '$state', function($rootScope, $http, $scope, $modal, api_cmdb2, api_bpm_domain, up_down_file, $state) {
  1086. $scope.edit = function() {
  1087. var aaa = { "model": $scope.item };
  1088. localStorage.ciclassify = JSON.stringify($scope.colobject.grid.appScope.my_tree);
  1089. $state.go('app.means.fixed_edit', { formKey: 'means_edit', service: 'api_cmdb', 'model': JSON.stringify(aaa) })
  1090. }
  1091. $scope.watch = function() {
  1092. // console.log($scope.item.id);
  1093. console.log($scope.item);
  1094. $state.go('app.means.fixed_see', { gdzc_label: $scope.item.label, gdzc_item: JSON.stringify($scope.item), idd: $scope.item.id })
  1095. }
  1096. }]);
  1097. app.directive('meansoperator', function() {
  1098. return {
  1099. restrict: 'E',
  1100. scope: {
  1101. item: '=',
  1102. colobject: '='
  1103. },
  1104. controller: 'MeansOperCtrl',
  1105. template: '<div class="links cl-effect-1">' +
  1106. // '<a ng-click="look()" tooltip="查看" tooltip-placement="left"><i class="ti-eye"></i></a>' +
  1107. '<a ng-click="edit()" tooltip="修改" tooltip-placement="left"><i class="fa fa-pencil-square-o"></i></a>' +
  1108. '</div>'
  1109. };
  1110. });
  1111. //操作
  1112. app.directive('wttt', function() {
  1113. return {
  1114. restrict: 'E',
  1115. scope: {
  1116. item: '=',
  1117. colobject: '='
  1118. },
  1119. controller: 'gdzc_caozuoCtrl',
  1120. template: '<div><div class="cl-effect-1 ui-grid-cell-contents pull-left" >' +
  1121. '<a class="bianjifont" ng-click="watch()">查看</a>' +
  1122. // '<a ng-click="edit()" class="handlefont" ui-sref="app.fixed.edit">编辑</a>' +
  1123. '<a ng-click="edit()" class="bianjifont">编辑</a>' +
  1124. '</div></div>'
  1125. };
  1126. });