incident_reportCtrl.js 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741
  1. 'use strict';
  2. app.controller('incident_reportCtrl', ["$scope", "$rootScope", "$state", "$timeout", "$interval", "$http", "$cookieStore", "SweetAlert", "Restangular", "api_report", "api_statistic", "moment", 'api_user_data', 'api_bpm_data', 'api_report_data', function ($scope, $rootScope, $state, $timeout, $interval, $http, $cookieStore, SweetAlert, Restangular, api_report, api_statistic, moment, api_user_data, api_bpm_data, api_report_data) {
  3. // 选择日期:
  4. $scope.dateSelected = [{
  5. name: '近90天',
  6. id: 0
  7. }, {
  8. name: '近1年',
  9. id: 1
  10. }, {
  11. name: '近3年',
  12. id: 2
  13. }, {
  14. name: '近5年',
  15. id: 3
  16. }]
  17. $scope.tap = 'QSFX';
  18. $scope.tap1 = 'flqs';
  19. $scope.searchkeys = {}; //搜索条件
  20. $scope.area_place = {}; //搜索条件
  21. $scope.dateChoose = {}; //选择日期组件存储值
  22. $scope.BTdata
  23. $scope.nowdata = moment(new Date()).format('YYYY/MM/DD HH:ss:mm');
  24. var weeks = new Date().getDay();
  25. $scope.starttimes = moment(new Date().getTime() - 86400000 * (weeks + 6 - 1)).format('YYYY-MM-DD 00:00:00');
  26. $scope.endtimes = moment(new Date().getTime() - 86400000 * (weeks - 1)).format('YYYY-MM-DD 23:59:59');
  27. $scope.changeForm = function (paramDateFrom) {
  28. $scope.starttimes = moment(paramDateFrom).format('YYYY-MM-DD');
  29. }
  30. $scope.changeTo = function (paramDateTo) {
  31. $scope.endtimes = moment(paramDateTo).format('YYYY-MM-DD');
  32. }
  33. $scope.searchkeys.startTime = $scope.starttimes;
  34. $scope.searchkeys.endTime = $scope.endtimes;
  35. console.log($scope.searchkeys.startTime, $scope.searchkeys.endTime)
  36. // 运维报表搜索条件:
  37. $scope.YWBB_searchKeys = {
  38. 'startTime': $scope.searchkeys.startTime,
  39. 'endTime': $scope.searchkeys.endTime,
  40. }
  41. // n天前
  42. $scope.GetDateStr = function (AddDayCount) {
  43. var dd = new Date();
  44. dd.setDate(dd.getDate() + AddDayCount); //获取AddDayCount天后的日期
  45. var y = dd.getFullYear();
  46. var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取当前月份的日期,不足10补0
  47. var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate(); //获取当前几号,不足10补0
  48. return y + "-" + m + "-" + d;
  49. }
  50. //上周
  51. $scope.week = function () {
  52. $scope.searchstate = "week";
  53. var weeks = new Date().getDay();
  54. $scope.starttimes = moment(new Date().getTime() - 86400000 * (weeks + 6)).format('YYYY-MM-DD');
  55. $scope.endtimes = moment(new Date().getTime() - 86400000 * (weeks)).format('YYYY-MM-DD');
  56. $scope.searchkeys.startTime = $scope.starttimes;
  57. $scope.searchkeys.endTime = $scope.endtimes;
  58. }
  59. //上月
  60. $scope.month = function () {
  61. $scope.searchstate = "month";
  62. $scope.starttimes = moment((new Date(moment().startOf('month'))).setMonth((new Date()).getMonth() - 1)).format('YYYY-MM-DD');
  63. $scope.endtimes = moment((new Date(moment().startOf('month'))).setMonth((new Date()).getMonth()) - 86400000).format('YYYY-MM-DD');
  64. $scope.searchkeys.startTime = $scope.starttimes;
  65. $scope.searchkeys.endTime = $scope.endtimes;
  66. }
  67. //今年(1月1日-至今)
  68. $scope.year = function () {
  69. $scope.searchstate = "year";
  70. $scope.starttimes = moment().startOf('year').format('YYYY-MM-DD 00:00:00');
  71. $scope.endtimes = moment().format('YYYY-MM-DD 23:59:59');
  72. $scope.searchkeys.startTime = $scope.starttimes;
  73. $scope.searchkeys.endTime = $scope.endtimes;
  74. }
  75. // 近n年
  76. $scope.nearYear = function (n) {
  77. $scope.searchkeys.startTime = moment().subtract(n, "years").format("YYYY-MM-DD 00:00:00");
  78. $scope.searchkeys.endTime = $scope.endtimes;
  79. console.log($scope.searchkeys.startTime, $scope.searchkeys.endTime)
  80. }
  81. /**
  82. *日历
  83. */
  84. $scope.open = function ($event) {
  85. $event.preventDefault();
  86. $event.stopPropagation();
  87. $scope.opened = !$scope.opened;
  88. };
  89. $scope.endOpen = function ($event) {
  90. $event.preventDefault();
  91. $event.stopPropagation();
  92. $scope.startOpened = false;
  93. $scope.endOpened = !$scope.endOpened;
  94. };
  95. $scope.startOpen = function ($event) {
  96. $event.preventDefault();
  97. $event.stopPropagation();
  98. $scope.endOpened = false;
  99. $scope.startOpened = !$scope.startOpened;
  100. };
  101. //选择类型
  102. $scope.active = function (name) {
  103. console.log($scope.searchkeys)
  104. if($scope.searchkeys.placeId){
  105. delete($scope.searchkeys.placeId)
  106. }
  107. if($scope.searchkeys.areaId){
  108. delete($scope.searchkeys.areaId)
  109. }
  110. $scope.tap = name
  111. $scope.searchkeys.startTime = moment($scope.searchkeys.startTime).format("YYYY-MM-DD 00:00:00");
  112. $scope.searchkeys.endTime = moment($scope.searchkeys.endTime).format('YYYY-MM-DD 23:59:59');
  113. if ($scope.tap == 'QSFX') {
  114. $scope.tap1 = 'flqs'
  115. $scope.area_place = {};
  116. setTimeout(function () {
  117. $scope.SLQS_Data($scope.searchkeys)
  118. $scope.FLQS_Data1($scope.searchkeys)
  119. }, 500);
  120. } else if ($scope.tap == 'YWBB') {
  121. $scope.area_place = {};
  122. setTimeout(function () {
  123. // barechart2();
  124. barechart3();
  125. // barechart6()
  126. // barechart7()
  127. // barechart8()
  128. // barechart9();
  129. $scope.YWXL_Data()
  130. $scope.YWXQ_Data()
  131. $scope.YWMYD_Data()
  132. $scope.YWTop_Data()
  133. }, 500);
  134. } else if ($scope.tap == 'FLBB') {
  135. $scope.area_place = {};
  136. setTimeout(function () {
  137. $scope.FLTJ_Data($scope.searchkeys)
  138. $scope.FLQST_Data($scope.searchkeys)
  139. $scope.QYFL_Data($scope.searchkeys)
  140. }, 500);
  141. } else if ($scope.tap == 'LYBB') {
  142. $scope.area_place = {};
  143. setTimeout(function () {
  144. $scope.LYQS_Data($scope.searchkeys)
  145. $scope.LYTJ_Data($scope.searchkeys)
  146. }, 500);
  147. }
  148. }
  149. //选择类型1
  150. $scope.active1 = function (name) {
  151. $scope.tap1 = name
  152. if ($scope.tap1 == 'flxq') {
  153. setTimeout(function () {
  154. // barechart();
  155. $scope.FLQS_Data($scope.searchkeys)
  156. }, 500);
  157. } else if ($scope.tap1 == 'flqs') {
  158. setTimeout(function () {
  159. // barechart2();
  160. $scope.FLQS_Data1($scope.searchkeys)
  161. }, 500);
  162. }
  163. }
  164. // 请求人
  165. api_user_data.fetchDataList('requester', {
  166. "idx": 0,
  167. "sum": 10
  168. }).then(function (response) {
  169. if (response) {
  170. if (response.status = 200) {
  171. $scope.requester = response.list;
  172. }
  173. }
  174. })
  175. //区域地点过滤
  176. $scope.key = {};
  177. api_user_data.fetchDataList('area', {
  178. "idx": 0,
  179. "sum": 1000
  180. }).then(function (data) {
  181. if (data) {
  182. if (data.status = 200) {
  183. $scope.outarea = data.list;
  184. }
  185. }
  186. })
  187. //地点区域过滤
  188. $scope.onChangearea = function (data) {
  189. // delete $scope.searchkeys.place;
  190. // if ($scope.memoryfilterData.incident) {
  191. // delete $scope.memoryfilterData.incident.place;
  192. // }
  193. console.log(data)
  194. $scope.searchkeys['areaId'] = data.areaId.id
  195. var fildata = {
  196. "idx": 0,
  197. "sum": 1000,
  198. "place": {
  199. area: {
  200. id: data.areaId.id
  201. }
  202. }
  203. };
  204. api_user_data.fetchDataList('place', fildata).then(function (response) {
  205. if (response) {
  206. if (response.status = 200) {
  207. $scope.outplace = response.list;
  208. }
  209. }
  210. });
  211. console.log($scope.searchkeys)
  212. };
  213. // 地点筛选
  214. $scope.onChangeplace = function (key) {
  215. console.log(key)
  216. // $scope.searchkeys['areaId']=key.areaId.id
  217. if ($scope.searchkeys.areaId) {
  218. delete($scope.searchkeys.areaId)
  219. }
  220. $scope.searchkeys['placeId'] = key.placeId.id
  221. console.log($scope.searchkeys)
  222. }
  223. // 选择日期
  224. $scope.onChangeDate = function (s) {
  225. switch (s) {
  226. case 0:
  227. // 最近90天
  228. console.log('最近90天');
  229. $scope.searchkeys.startTime = $scope.GetDateStr(-90);
  230. break;
  231. case 1:
  232. // 最近一年
  233. console.log('最近一年');
  234. $scope.nearYear(1)
  235. break;
  236. case 2:
  237. // 最近三年
  238. console.log('最近三年');
  239. $scope.nearYear(3)
  240. break;
  241. case 3:
  242. // 最近五年
  243. console.log('最近五年');
  244. $scope.nearYear(5)
  245. break;
  246. }
  247. }
  248. //树形控件加载
  249. $scope.my_tree = {};
  250. $scope.try_async_load = function () {
  251. $scope.my_data = [];
  252. $scope.doing_async = true;
  253. api_bpm_data.fetchDataList('incidentcategory', {
  254. "idx": 0,
  255. "sum": 1000
  256. }).then(function (response) {
  257. if (response.status == 200) {
  258. var data = response.list;
  259. var objects = [];
  260. for (var i = 0; i < data.length; i++) {
  261. var object = {};
  262. object.id = data[i].id;
  263. if (data[i].parent && data[i].parent.id != 0) {
  264. object.parent = data[i].parent.id;
  265. }
  266. object.label = data[i].category;
  267. objects.push(object);
  268. }
  269. $scope.my_data = convertParentToChildList(objects);
  270. $scope.tree_data = angular.copy($scope.my_data);
  271. if ($scope.my_data.length > 0) {
  272. $scope.doing_async = false;
  273. }
  274. // return $scope.my_tree.expand_all()
  275. } else {
  276. SweetAlert.swal({
  277. title: "系统错误!",
  278. text: "请刷新重试!",
  279. type: "error"
  280. });
  281. }
  282. });
  283. };
  284. function convertListToTree(data, treeMap) {
  285. var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
  286. var root = null; //Initially set our loop to null
  287. var parentNode = null;
  288. //loop over data
  289. for (var i = 0; i < data.length; i++) {
  290. var datum = data[i];
  291. //each node will have children, so let's give it a "children" poperty
  292. datum.children = [];
  293. //add an entry for this node to the map so that any future children can
  294. //lookup the parent
  295. idToNodeMap[datum.id] = datum;
  296. //Does this node have a parent?
  297. if (typeof datum.parent === "undefined" || datum.parent == null) {
  298. //Doesn't look like it, so this node is the root of the tree
  299. root = datum;
  300. treeMap[datum.id] = root;
  301. } else {
  302. //This node has a parent, so let's look it up using the id
  303. parentNode = idToNodeMap[datum.parent];
  304. //We don't need this property, so let's delete it.
  305. delete datum.parent;
  306. //Let's add the current node as a child of the parent node.
  307. parentNode.children.push(datum);
  308. }
  309. }
  310. return root;
  311. }
  312. function convertParentToChildList(data) {
  313. var treeMap = {};
  314. var list = [];
  315. convertListToTree(data, treeMap);
  316. angular.forEach(treeMap, function (item) {
  317. list.push(item);
  318. });
  319. return list;
  320. }
  321. // $scope.my_tree = tree = {};
  322. $scope.try_async_load1 = function () {
  323. $scope.my_data1 = [];
  324. $scope.select_treedata = [];
  325. $scope.doing_async = true;
  326. api_user_data.fetchDataList('group', {
  327. "idx": 0,
  328. "sum": 1000
  329. }).then(function (data) {
  330. $scope.select_treedata = $scope.my_data1
  331. //
  332. = convertParentToChildList(data['list']);
  333. $scope.doing_async = false;
  334. // tree.expand_all();
  335. //console.log(treelist);
  336. });
  337. };
  338. $scope.try_async_load();
  339. $scope.try_async_load1();
  340. // 一、运维报表:
  341. // 事件类型选择:
  342. $scope.onFilterCategary = function (item) {
  343. $scope.YWBB_searchKeys.categoryId = item.id;
  344. }
  345. $scope.onFilterGroup = function (item) {
  346. $scope.YWBB_searchKeys.groupId = item.id;
  347. }
  348. // 图表1、事件运维效率
  349. $scope.YWXL_Data = function () {
  350. api_report_data.reportsData('incident_operations_efficiency', $scope.YWBB_searchKeys).then(function (data) {
  351. $scope.YWXL_Datas = data;
  352. barechart2(data);
  353. })
  354. }
  355. // 图表2、事件运维详情
  356. $scope.YWXQ_Data = function () {
  357. api_report_data.reportsData('incident_operations_details', $scope.YWBB_searchKeys).then(function (data) {
  358. // $scope.YWXL_Datas = data;
  359. // 响应饼图
  360. barechart6(data.response);
  361. // 解决饼图
  362. barechart7(data.solve);
  363. // 柱状图
  364. barechart8(data.barGraph);
  365. })
  366. }
  367. //事件趋势分析报表
  368. //数量趋势分析 图1
  369. $scope.SLQS_Data = function (data) {
  370. api_report_data.reportsData('incident_trend', data).then(function (data) {
  371. console.log(data)
  372. if (data) {
  373. $scope.SLQS_Datas = data;
  374. // console.log($scope.LYQS_Datas)
  375. setTimeout(function () {
  376. barechart($scope.SLQS_Datas)
  377. }, 1000)
  378. }
  379. })
  380. }
  381. //分类趋势分析 图1
  382. $scope.FLQS_Data1 = function (data) {
  383. api_report_data.reportsData('incident_category_trend_time', data).then(function (data) {
  384. console.log(data)
  385. if (data) {
  386. $scope.FLQS_Datas = data;
  387. // console.log($scope.LYQS_Datas)
  388. setTimeout(function () {
  389. barechart1($scope.FLQS_Datas)
  390. }, 1000)
  391. }
  392. })
  393. }
  394. //分类趋势分析 图2
  395. $scope.FLQS_Data = function (data) {
  396. api_report_data.reportsData('incident_category_month', data).then(function (data) {
  397. console.log(data)
  398. var list1 = []
  399. var list2 = []
  400. if (data) {
  401. // for (var i = 0; i < data.data.length; i++) {
  402. // for (var j = 0; j < data.data[i].length; j++) {
  403. // // console.log(list1[i][j])
  404. // for (var l = 0; l < data.dates.length; l++) {
  405. // data.data[i][j]['time'] = data.dates[l]
  406. // }
  407. // }
  408. // console.log(data.data[i])
  409. // }
  410. $scope.BTdata = data;
  411. // console.log($scope.LYQS_Datas)
  412. setTimeout(function () {
  413. // barechart5($scope.BTdata)
  414. wt($scope.BTdata)
  415. }, 1000)
  416. }
  417. })
  418. }
  419. // 图表3、事件运维满意度
  420. $scope.YWMYD_Data = function () {
  421. api_report_data.reportsData('incident_operations_satisfaction', $scope.YWBB_searchKeys).then(function (data) {
  422. $scope.YWMYD_Datas = data.sum;
  423. barechart9(data.barGraph);
  424. })
  425. }
  426. // 表格1、事件运维解决TOP排名
  427. $scope.YWTop_Data = function (sort) {
  428. console.log(sort)
  429. var postData = $scope.YWBB_searchKeys;
  430. if (sort) {
  431. postData.sortKye = sort;
  432. }
  433. api_report_data.reportsData('incident_operations_top', postData).then(function (data) {
  434. $scope.YWBB_table_data = data.table;
  435. })
  436. }
  437. //事件来源报表数据获取
  438. //来源趋势数据 图1
  439. $scope.LYQS_Data = function (data) {
  440. api_report_data.reportsData('incident_source', data).then(function (data) {
  441. console.log(data)
  442. if (data.stats == 200) {
  443. $scope.LYQS_Datas = data.data;
  444. console.log($scope.LYQS_Datas)
  445. barechart13($scope.LYQS_Datas)
  446. }
  447. })
  448. }
  449. //来源统计数据 图2
  450. $scope.LYTJ_Data = function (data) {
  451. api_report_data.reportsData('incident_source_trend', data).then(function (data) {
  452. console.log(data)
  453. if (data.stats == 200) {
  454. $scope.LYTJ_Datas = data.data;
  455. console.log($scope.LYTJ_Datas)
  456. barechart14($scope.LYTJ_Datas)
  457. }
  458. })
  459. }
  460. //事件分类报表
  461. // 分类统计饼图
  462. $scope.FLTJ_Data = function (list) {
  463. api_report_data.reportsData('incident_category_proportion', list).then(function (data) {
  464. // $scope.YWMYD_Datas = data.sum;
  465. // barechart9(data.barGraph);
  466. console.log(data)
  467. barechart10(data)
  468. })
  469. }
  470. // 分类趋势线图
  471. $scope.FLQST_Data = function (list) {
  472. api_report_data.reportsData('incident_category_trend', list).then(function (data) {
  473. // $scope.YWMYD_Datas = data.sum;
  474. // barechart9(data.barGraph);
  475. console.log(data)
  476. barechart11(data)
  477. })
  478. }
  479. // 区域分类分析柱状图
  480. $scope.QYFL_Data = function (list) {
  481. api_report_data.reportsData('incident_category_area', list).then(function (data) {
  482. // $scope.YWMYD_Datas = data.sum;
  483. // barechart9(data.barGraph);
  484. console.log(data)
  485. barechart12(data)
  486. })
  487. }
  488. //搜索
  489. $scope.report_datas = function () {
  490. console.log($scope.searchkeys)
  491. var s = new Date($scope.searchkeys.startTime);
  492. var st=s.getFullYear() + '-' + (s.getMonth() + 1) + '-' + s.getDate() + ' ' + s.getHours() + ':' + s.getMinutes() + ':' + s.getSeconds();
  493. var e = new Date($scope.searchkeys.endTime);
  494. var en=e.getFullYear() + '-' + (e.getMonth() + 1) + '-' + e.getDate() + ' ' + e.getHours() + ':' + e.getMinutes() + ':' + e.getSeconds();
  495. $scope.searchkeys.startTime=st
  496. $scope.searchkeys.endTime=en
  497. if ($scope.tap == "YWBB") {
  498. $scope.YWBB_searchKeys.startTime = $scope.searchkeys.startTime;
  499. $scope.YWBB_searchKeys.endTime = $scope.searchkeys.endTime;
  500. $scope.YWXL_Data()
  501. $scope.YWXQ_Data()
  502. $scope.YWMYD_Data()
  503. $scope.YWTop_Data()
  504. }
  505. if ($scope.tap == 'LYBB') {
  506. $scope.LYQS_Data($scope.searchkeys)
  507. $scope.LYTJ_Data($scope.searchkeys)
  508. }
  509. if ($scope.tap == 'QSFX') {
  510. $scope.SLQS_Data($scope.searchkeys)
  511. $scope.FLQS_Data($scope.searchkeys)
  512. $scope.FLQS_Data1($scope.searchkeys)
  513. }
  514. if ($scope.tap == 'FLBB') {
  515. $scope.FLTJ_Data($scope.searchkeys)
  516. $scope.FLQST_Data($scope.searchkeys)
  517. $scope.QYFL_Data($scope.searchkeys)
  518. }
  519. }
  520. //重置
  521. $scope.report_Reset = function () {
  522. $scope.select_treedata = [];
  523. $scope.my_data = [];
  524. $scope.dateChoose.dateSelected = {};
  525. if($scope.searchkeys.placeId){
  526. delete($scope.searchkeys.placeId)
  527. }
  528. if($scope.searchkeys.areaId){
  529. delete($scope.searchkeys.areaId)
  530. }
  531. $scope.area_place = {};
  532. $scope.starttimes = moment(new Date().getTime() - 86400000 * (weeks + 6 - 1)).format('YYYY-MM-DD');
  533. $scope.endtimes = moment(new Date().getTime() - 86400000 * (weeks - 1)).format('YYYY-MM-DD');
  534. $scope.searchkeys.startTime = $scope.starttimes
  535. $scope.searchkeys.endTime = $scope.endtimes
  536. console.log($scope)
  537. if ($scope.tap == "YWBB") {
  538. $scope.YWBB_searchKeys.startTime = $scope.searchkeys.startTime;
  539. $scope.YWBB_searchKeys.endTime = $scope.searchkeys.endTime;
  540. $scope.YWXL_Data()
  541. $scope.YWXQ_Data()
  542. $scope.YWMYD_Data()
  543. $scope.YWTop_Data()
  544. }
  545. if ($scope.tap == 'LYBB') {
  546. $scope.LYQS_Data($scope.searchkeys)
  547. $scope.LYTJ_Data($scope.searchkeys)
  548. }
  549. if ($scope.tap == 'QSFX') {
  550. $scope.SLQS_Data($scope.searchkeys)
  551. $scope.FLQS_Data($scope.searchkeys)
  552. $scope.FLQS_Data1($scope.searchkeys)
  553. }
  554. if ($scope.tap == 'FLBB') {
  555. $scope.FLTJ_Data($scope.searchkeys)
  556. $scope.FLQST_Data($scope.searchkeys)
  557. $scope.QYFL_Data($scope.searchkeys)
  558. }
  559. }
  560. //图表 来电转换
  561. function barechart(datas) {
  562. console.log(datas)
  563. console.log(echarts)
  564. if (datas) {
  565. var dom = document.getElementById("ldzh");
  566. console.log(dom)
  567. var myChart = echarts.init(dom);
  568. var option = null;
  569. console.log(myChart)
  570. myChart.showLoading({
  571. text: '数据加载中...',
  572. color: '#c23531',
  573. textColor: '#fff',
  574. maskColor: 'rgba(255,255,255,0)',
  575. zlevel: 0
  576. });
  577. myChart.hideLoading();
  578. option = {
  579. tooltip: {
  580. trigger: 'axis',
  581. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  582. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  583. }
  584. },
  585. legend: {
  586. data: ['事件总数', '环比增幅'],
  587. align: 'left',
  588. // itemWidth:10,
  589. // itemHeight:10,
  590. bottom: 0
  591. },
  592. grid: {
  593. top: '8%',
  594. left: '.5%',
  595. right: '0%',
  596. bottom: '15%',
  597. containLabel: true
  598. },
  599. xAxis: [{
  600. type: 'category',
  601. // axisTick: {
  602. // alignWithLabel: true
  603. // },
  604. axisLabel: {
  605. textStyle: {
  606. color: '#7B7B7B',
  607. // fontSize: '14',
  608. }
  609. },
  610. axisLine: {
  611. show: true,
  612. lineStyle: {
  613. color: '#7B7B7B',
  614. // type: 'dotted'
  615. },
  616. },
  617. data: datas.dates
  618. }],
  619. yAxis: [{
  620. type: 'value',
  621. scale: true,
  622. name: '事件数量 (件)',
  623. min: 0,
  624. boundaryGap: [0.2, 0.2],
  625. axisLabel: {
  626. textStyle: {
  627. color: '#7B7B7B',
  628. // fontSize: '14',
  629. }
  630. },
  631. axisLine: {
  632. show: true,
  633. lineStyle: {
  634. color: '#7B7B7B',
  635. // type: 'dotted'
  636. },
  637. },
  638. },
  639. {
  640. type: 'value',
  641. scale: true,
  642. name: '环比增幅 (%)',
  643. min: 0,
  644. max: 100,
  645. boundaryGap: [0.2, 0.2],
  646. axisLabel: {
  647. formatter: '{value} %',
  648. textStyle: {
  649. color: '#7B7B7B',
  650. // fontSize: '14',
  651. }
  652. },
  653. axisLine: {
  654. show: true,
  655. lineStyle: {
  656. color: '#7B7B7B',
  657. // type: 'dotted'
  658. },
  659. },
  660. }
  661. ],
  662. series: [{
  663. name: '事件总数',
  664. type: 'bar',
  665. barMaxWidth: 30,
  666. itemStyle: {
  667. normal: {
  668. color: '#005395'
  669. }
  670. },
  671. data: datas.data
  672. },
  673. {
  674. name: '环比增幅',
  675. type: 'line',
  676. itemStyle: {
  677. normal: {
  678. color: '#1CA58F'
  679. }
  680. },
  681. lineStyle: {
  682. normal: {
  683. color: '#1CA58F'
  684. }
  685. },
  686. data: datas.per
  687. }
  688. ]
  689. };
  690. if (option && typeof option === "object") {
  691. myChart.setOption(option);
  692. myChart.hideLoading();
  693. }
  694. }
  695. }
  696. //图表 事件分类趋势分析
  697. function barechart1(datas) {
  698. console.log(datas)
  699. if (datas) {
  700. var dom = document.getElementById("sjfx");
  701. // console.log(dom)
  702. var myChart1 = echarts.init(dom);
  703. var option1 = null;
  704. // console.log(myChart1)
  705. myChart1.showLoading({
  706. text: '数据加载中...',
  707. color: '#c23531',
  708. textColor: '#fff',
  709. maskColor: 'rgba(255,255,255,0)',
  710. zlevel: 0
  711. });
  712. myChart1.hideLoading();
  713. var serie = []
  714. for (var i = 0; i < datas.data.length; i++) {
  715. // for (var j = 0; j < datas.title.length; j++) {
  716. // Series.name = datas.title[j]
  717. var Series = {
  718. name: datas.title[i],
  719. type: 'line',
  720. itemStyle: {
  721. normal: {
  722. // color: '#49A9EE'
  723. }
  724. },
  725. lineStyle: {
  726. normal: {
  727. // color: '#49A9EE'
  728. }
  729. },
  730. data: datas.data[i]
  731. }
  732. // }
  733. serie.push(Series)
  734. }
  735. option1 = {
  736. // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  737. tooltip: {
  738. trigger: 'axis',
  739. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  740. // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  741. lineStyle: {
  742. color: '#49A9EE',
  743. type: 'dotted'
  744. },
  745. },
  746. formatter: function (params) {
  747. // console.log(params);
  748. // console.log($scope.FLQS_Datas);
  749. var retStr = "";
  750. for (var j = 0; j < $scope.FLQS_Datas.title.length; j++) {
  751. for (var i = 0; i < params.length; i++) {
  752. var dateIndex = $scope.FLQS_Datas.dates.indexOf(params[i].name);
  753. };
  754. // var str = $scope.FLQS_Datas.title[j] + ":" + $scope.FLQS_Datas.data[j][dateIndex] + "&nbsp;&nbsp;" + "环比增幅:" + $scope.FLQS_Datas.per[j][dateIndex] + "%" + "<br />"
  755. // $scope.FLQS_Datas.per[j][dateIndex]= $scope.FLQS_Datas.per[j][dateIndex].toString()
  756. // if($scope.FLQS_Datas.per[j][dateIndex].indexOf('-')<0){
  757. // $scope.FLQS_Datas.per[j][dateIndex]='+'+$scope.FLQS_Datas.per[j][dateIndex]
  758. // }else{
  759. // }
  760. // console.log('+'+$scope.FLQS_Datas.per[j][dateIndex])
  761. var str = "<div style='width: 105%;font-size: 12px;'><div style='float: left;width: 48%;'>" + $scope.FLQS_Datas.title[j] + ": " + $scope.FLQS_Datas.data[j][dateIndex] + "件</div>" + "&nbsp;&nbsp;" + "<div style='float: left;width: 46%;margin-left: 1%;'>" + "环比增幅: " + $scope.FLQS_Datas.per[j][dateIndex] + "%" + "</div></div>"
  762. retStr += str
  763. $scope.FLQS_Datas.dates[j] + '</br>' + retStr
  764. }
  765. // console.log($scope.FLQS_Datas)
  766. for (var k = 0; k < params.length; k++) {
  767. // return params[i].name+'</br>'+params[i].seriesName+' :'+params[i].value+'&nbsp;&nbsp;'+'环比增幅 :'+params[i].dataIndex+'%';
  768. return params[k].name + '</br>' + retStr
  769. }
  770. // return retStr
  771. }
  772. // formatter:'{a}{b} </br>事件数量: {c} &nbsp;&nbsp;环比增幅: {c}%'
  773. // formatter: function (params, ticket, callback) {
  774. // console.log(params, ticket, callback)
  775. // // $.get('detail?name=' + params.name, function (content) {
  776. // // callback(ticket, toHTML(content));
  777. // // });
  778. // var list={
  779. // }
  780. // for(var i=0;i<params.length;i++){
  781. // return params[i].name+'</br>'+params[i].seriesName+' :'+params[i].value+'&nbsp;&nbsp;'+'环比增幅 :'+params[i].dataIndex+'%';
  782. // }
  783. // }
  784. },
  785. legend: {
  786. show: true,
  787. data: datas.title,
  788. align: 'left',
  789. // itemWidth:10,
  790. // itemHeight:10,
  791. bottom: 0,
  792. // formatter: function (name) {
  793. // console.log(name)
  794. // return name;
  795. // }
  796. },
  797. grid: {
  798. top: '8%',
  799. left: '.5%',
  800. right: '0%',
  801. bottom: '10%',
  802. containLabel: true
  803. },
  804. xAxis: [{
  805. type: 'category',
  806. // axisTick: {
  807. // alignWithLabel: true
  808. // },
  809. axisLabel: {
  810. textStyle: {
  811. color: '#7B7B7B',
  812. // fontSize: '14',
  813. }
  814. },
  815. axisLine: {
  816. show: true,
  817. lineStyle: {
  818. color: '#7B7B7B',
  819. // type: 'dotted'
  820. },
  821. },
  822. data: datas.dates
  823. }],
  824. yAxis: [{
  825. type: 'value',
  826. scale: true,
  827. name: '事件数量 (件)',
  828. min: 0,
  829. boundaryGap: [0.2, 0.2],
  830. axisLabel: {
  831. textStyle: {
  832. color: '#7B7B7B',
  833. // fontSize: '14',
  834. }
  835. },
  836. axisLine: {
  837. show: true,
  838. lineStyle: {
  839. color: '#7B7B7B',
  840. // type: 'dotted'
  841. },
  842. },
  843. }
  844. // , {
  845. // type: 'value',
  846. // scale: true,
  847. // name: '环比增幅 (%)',
  848. // min: 0,
  849. // max: 100,
  850. // boundaryGap: [0.2, 0.2],
  851. // axisLabel: {
  852. // formatter: '{value} %',
  853. // textStyle: {
  854. // color: '#7B7B7B',
  855. // // fontSize: '14',
  856. // }
  857. // },
  858. // axisLine: {
  859. // show: true,
  860. // lineStyle: {
  861. // color: '#7B7B7B',
  862. // // type: 'dotted'
  863. // },
  864. // },
  865. // }
  866. ],
  867. series: serie
  868. // [
  869. // {
  870. // name: '事件总数',
  871. // type: 'line',
  872. // show: false,
  873. // // itemStyle: {
  874. // // normal: {
  875. // // color: '#005395'
  876. // // }
  877. // // },
  878. // // lineStyle: {
  879. // // normal: {
  880. // // color: '#005395'
  881. // // }
  882. // // },
  883. // data: [10, 20, 5, 23, 12, 3, 63, 12, 23, 34, 76, 45]
  884. // }, {
  885. // name: '环比增幅',
  886. // type: 'line',
  887. // show: false,
  888. // // itemStyle: {
  889. // // normal: {
  890. // // color: '#005395'
  891. // // }
  892. // // },
  893. // // lineStyle: {
  894. // // normal: {
  895. // // color: '#005395'
  896. // // }
  897. // // },
  898. // data: [6, 45, 12, 4, 7, 43, 9, 32, 12, 21, 8, 10]
  899. // }, {
  900. // name: '通话时长2',
  901. // type: 'line',
  902. // // itemStyle: {
  903. // // normal: {
  904. // // color: '#005395'
  905. // // }
  906. // // },
  907. // // lineStyle: {
  908. // // normal: {
  909. // // color: '#005395'
  910. // // }
  911. // // },
  912. // data: [9, 41, 9, 12, 7, 34, 12, 54, 8, 9, 31, 12]
  913. // }, {
  914. // name: '通话时长3',
  915. // type: 'line',
  916. // // itemStyle: {
  917. // // normal: {
  918. // // color: '#005395'
  919. // // }
  920. // // },
  921. // // lineStyle: {
  922. // // normal: {
  923. // // color: '#005395'
  924. // // }
  925. // // },
  926. // data: [12, 24, 15, 22, 15, 31, 60, 16, 13, 24, 36, 55]
  927. // },
  928. // ]
  929. };
  930. if (option1 && typeof option1 === "object") {
  931. myChart1.setOption(option1);
  932. myChart1.hideLoading();
  933. }
  934. }
  935. // console.log(echarts)
  936. }
  937. //图表 事件运维效率
  938. function barechart2(datas) {
  939. var dom = document.getElementById("sjqs");
  940. var myChart = echarts.init(dom);
  941. var option = null;
  942. myChart.showLoading({
  943. text: '数据加载中...',
  944. color: '#c23531',
  945. textColor: '#fff',
  946. maskColor: 'rgba(255,255,255,0)',
  947. zlevel: 0
  948. });
  949. myChart.hideLoading();
  950. option = {
  951. tooltip: {
  952. trigger: 'axis',
  953. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  954. // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  955. lineStyle: {
  956. color: '#49A9EE',
  957. type: 'dotted'
  958. },
  959. }
  960. },
  961. legend: {
  962. data: ['响应平均时长', '解决平均时长'],
  963. align: 'left',
  964. // itemWidth:10,
  965. // itemHeight:10,
  966. bottom: 0
  967. },
  968. grid: {
  969. left: '1%',
  970. right: '0%',
  971. bottom: '15%',
  972. containLabel: true
  973. },
  974. xAxis: [{
  975. type: 'category',
  976. // axisTick: {
  977. // alignWithLabel: true
  978. // },
  979. axisLabel: {
  980. textStyle: {
  981. color: '#7B7B7B',
  982. // fontSize: '14',
  983. }
  984. },
  985. axisLine: {
  986. show: true,
  987. lineStyle: {
  988. color: '#7B7B7B',
  989. // type: 'dotted'
  990. },
  991. },
  992. data: datas.keyList
  993. }],
  994. yAxis: [{
  995. type: 'value',
  996. scale: true,
  997. name: '平均时长',
  998. min: 0,
  999. boundaryGap: [0.2, 0.2],
  1000. // axisLabel: {
  1001. // formatter: '{value}'
  1002. // }
  1003. axisLabel: {
  1004. textStyle: {
  1005. color: '#7B7B7B',
  1006. // fontSize: '14',
  1007. }
  1008. },
  1009. axisLine: {
  1010. show: true,
  1011. lineStyle: {
  1012. color: '#7B7B7B',
  1013. // type: 'dotted'
  1014. },
  1015. },
  1016. }, ],
  1017. series: [{
  1018. name: '响应平均时长',
  1019. type: 'line',
  1020. itemStyle: {
  1021. normal: {
  1022. color: '#49A9EE'
  1023. }
  1024. },
  1025. lineStyle: {
  1026. normal: {
  1027. color: '#49A9EE'
  1028. }
  1029. },
  1030. data: datas.responseDataList
  1031. }, {
  1032. name: '解决平均时长',
  1033. type: 'line',
  1034. itemStyle: {
  1035. normal: {
  1036. color: '#87C966'
  1037. }
  1038. },
  1039. lineStyle: {
  1040. normal: {
  1041. color: '#87C966'
  1042. }
  1043. },
  1044. data: datas.solveDataList2
  1045. }]
  1046. };
  1047. if (option && typeof option === "object") {
  1048. myChart.setOption(option);
  1049. myChart.hideLoading();
  1050. }
  1051. }
  1052. //图表 运维转派,协同,升级
  1053. function barechart3() {
  1054. // console.log(echarts)
  1055. var dom = document.getElementById("sjpd");
  1056. console.log(dom)
  1057. var myChart = echarts.init(dom);
  1058. var option = null;
  1059. console.log(myChart)
  1060. myChart.showLoading({
  1061. text: '数据加载中...',
  1062. color: '#c23531',
  1063. textColor: '#fff',
  1064. maskColor: 'rgba(255,255,255,0)',
  1065. zlevel: 0
  1066. });
  1067. myChart.hideLoading();
  1068. option = {
  1069. tooltip: {
  1070. trigger: 'axis',
  1071. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1072. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  1073. }
  1074. },
  1075. legend: {
  1076. data: ['转派', '升级', '协同'],
  1077. align: 'left',
  1078. // itemWidth:10,
  1079. // itemHeight:10,
  1080. bottom: 0
  1081. },
  1082. grid: {
  1083. left: '.5%',
  1084. right: '0%',
  1085. bottom: '15%',
  1086. containLabel: true
  1087. },
  1088. xAxis: [{
  1089. type: 'category',
  1090. // axisTick: {
  1091. // alignWithLabel: true
  1092. // },
  1093. axisLabel: {
  1094. textStyle: {
  1095. color: '#7B7B7B',
  1096. // fontSize: '14',
  1097. }
  1098. },
  1099. axisLine: {
  1100. show: true,
  1101. lineStyle: {
  1102. color: '#7B7B7B',
  1103. // type: 'dotted'
  1104. },
  1105. },
  1106. data: ['10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12']
  1107. }],
  1108. yAxis: [{
  1109. type: 'value',
  1110. scale: true,
  1111. name: '事件数量 (件)',
  1112. min: 0,
  1113. boundaryGap: [0.2, 0.2],
  1114. axisLabel: {
  1115. formatter: '{value}',
  1116. textStyle: {
  1117. color: '#7B7B7B',
  1118. // fontSize: '14',
  1119. }
  1120. },
  1121. axisLine: {
  1122. show: true,
  1123. lineStyle: {
  1124. color: '#7B7B7B',
  1125. // type: 'dotted'
  1126. },
  1127. },
  1128. }],
  1129. series: [{
  1130. name: '转派',
  1131. type: 'bar',
  1132. itemStyle: {
  1133. normal: {
  1134. color: '#005395'
  1135. }
  1136. },
  1137. data: [20, 12, 31, 23, 56, 78, 92, 12, 23]
  1138. }, {
  1139. name: '升级',
  1140. type: 'bar',
  1141. itemStyle: {
  1142. normal: {
  1143. color: '#87C966'
  1144. }
  1145. },
  1146. data: [10, 20, 5, 5, 2, 32, 34, 56, 23]
  1147. }, {
  1148. name: '协同',
  1149. type: 'bar',
  1150. itemStyle: {
  1151. normal: {
  1152. color: '#79A3C4'
  1153. }
  1154. },
  1155. data: [15, 26, 15, 25, 32, 36, 6, 43, 12]
  1156. }]
  1157. };
  1158. if (option && typeof option === "object") {
  1159. myChart.setOption(option);
  1160. myChart.hideLoading();
  1161. }
  1162. }
  1163. function wt(data) {
  1164. console.log(data)
  1165. // $scope.wt_data = ['1','2','3']
  1166. setTimeout(function () {
  1167. console.log(1)
  1168. for (var i = 0; i < data.data.length; i++) {
  1169. (function wt1() {
  1170. var dom = document.getElementById("item" + i);
  1171. console.log(dom)
  1172. var myChart = echarts.init(dom);
  1173. var datas1 = []
  1174. for (var j = 0; j < data.data[i].length; j++) {
  1175. var datas = {
  1176. "name": data.data[i][j].category,
  1177. "value": data.data[i][j].num
  1178. }
  1179. // {
  1180. // "name": "上网账号",
  1181. // "value": 10
  1182. // }, {
  1183. // "name": "邮箱问题",
  1184. // "value": 10
  1185. // }, {
  1186. // "name": "用户资讯服务",
  1187. // "value": 10
  1188. // }, {
  1189. // "name": "校园卡",
  1190. // "value": 10
  1191. // }, {
  1192. // "name": "分类1",
  1193. // "value": 20
  1194. // }, {
  1195. // "name": "分类2",
  1196. // "value": 30
  1197. // },
  1198. datas1.push(datas)
  1199. }
  1200. // if(data.total[i]==0){
  1201. // $scope.zero=i
  1202. // }
  1203. console.log(datas1)
  1204. var option = {
  1205. // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  1206. // backgroundColor: '#000',
  1207. title: {
  1208. text: '总数',
  1209. subtext: data.total[i] || '0',
  1210. textStyle: {
  1211. color: '#333',
  1212. fontSize: 16,
  1213. align: 'center',
  1214. verticalAlign: 'middle'
  1215. },
  1216. subtextStyle: {
  1217. fontSize: 14,
  1218. color: ['#005395'],
  1219. fontWeight: 'bolder',
  1220. align: 'center',
  1221. verticalAlign: 'middle'
  1222. },
  1223. x: '22%',
  1224. y: '55%',
  1225. },
  1226. grid: {
  1227. bottom: 150,
  1228. left: 100,
  1229. right: '10%'
  1230. },
  1231. legend: {
  1232. orient: 'vertical',
  1233. top: "middle",
  1234. right: "5%",
  1235. textStyle: {
  1236. color: '#333',
  1237. fontSize: 12,
  1238. },
  1239. itemWidth: 8,
  1240. itemHeight: 8,
  1241. icon: 'roundRect',
  1242. data: datas1,
  1243. },
  1244. series: [
  1245. // 主要展示层的
  1246. {
  1247. radius: ['35%', '50%'],
  1248. center: ['25%', '65%'],
  1249. type: 'pie',
  1250. label: {
  1251. normal: {
  1252. show: true,
  1253. formatter: "{c}%",
  1254. textStyle: {
  1255. fontSize: 14,
  1256. },
  1257. position: 'outside'
  1258. },
  1259. emphasis: {
  1260. show: true
  1261. }
  1262. },
  1263. labelLine: {
  1264. normal: {
  1265. show: true,
  1266. length: 5,
  1267. length2: 5
  1268. },
  1269. emphasis: {
  1270. show: true
  1271. }
  1272. },
  1273. hoverOffset: 5,
  1274. name: "民警训练总量",
  1275. data: datas1,
  1276. },
  1277. ]
  1278. };
  1279. if (option && typeof option === "object") {
  1280. myChart.setOption(option);
  1281. myChart.hideLoading();
  1282. }
  1283. })()
  1284. // wt1()
  1285. }
  1286. }, 1000);
  1287. // for (var i = 0; i < $scope.wt_data.length; i++) {
  1288. // (function wt1() {
  1289. // var dom = document.getElementById("item" + i);
  1290. // console.log(dom)
  1291. // var myChart = echarts.init(dom);
  1292. // var data = [{
  1293. // "name": "网络故障报修",
  1294. // "value": 10
  1295. // }, {
  1296. // "name": "上网账号",
  1297. // "value": 10
  1298. // }, {
  1299. // "name": "邮箱问题",
  1300. // "value": 10
  1301. // }, {
  1302. // "name": "用户资讯服务",
  1303. // "value": 10
  1304. // }, {
  1305. // "name": "校园卡",
  1306. // "value": 10
  1307. // }, {
  1308. // "name": "分类1",
  1309. // "value": 20
  1310. // }, {
  1311. // "name": "分类2",
  1312. // "value": 30
  1313. // }, ]
  1314. // option = {
  1315. // // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  1316. // // backgroundColor: '#000',
  1317. // title: {
  1318. // text: '总数',
  1319. // subtext: i + 1,
  1320. // textStyle: {
  1321. // color: '#333',
  1322. // fontSize: 16,
  1323. // // align: 'center'
  1324. // },
  1325. // subtextStyle: {
  1326. // fontSize: 14,
  1327. // color: ['#005395'],
  1328. // fontWeight: 'bolder'
  1329. // },
  1330. // x: '22%',
  1331. // y: '35%',
  1332. // },
  1333. // grid: {
  1334. // bottom: 150,
  1335. // left: 100,
  1336. // right: '10%'
  1337. // },
  1338. // legend: {
  1339. // orient: 'vertical',
  1340. // top: "middle",
  1341. // right: "5%",
  1342. // textStyle: {
  1343. // color: '#333',
  1344. // fontSize: 12,
  1345. // },
  1346. // itemWidth: 8,
  1347. // itemHeight: 8,
  1348. // icon: 'roundRect',
  1349. // data: data,
  1350. // },
  1351. // series: [
  1352. // // 主要展示层的
  1353. // {
  1354. // radius: ['55%', '85%'],
  1355. // center: ['25%', '50%'],
  1356. // type: 'pie',
  1357. // label: {
  1358. // normal: {
  1359. // show: true,
  1360. // formatter: "{c}%",
  1361. // textStyle: {
  1362. // fontSize: 14,
  1363. // },
  1364. // position: 'outside'
  1365. // },
  1366. // emphasis: {
  1367. // show: true
  1368. // }
  1369. // },
  1370. // labelLine: {
  1371. // normal: {
  1372. // show: true,
  1373. // length: 5,
  1374. // length2: 25
  1375. // },
  1376. // emphasis: {
  1377. // show: true
  1378. // }
  1379. // },
  1380. // name: "民警训练总量",
  1381. // data: data,
  1382. // },
  1383. // ]
  1384. // };
  1385. // if (option && typeof option === "object") {
  1386. // myChart.setOption(option);
  1387. // myChart.hideLoading();
  1388. // }
  1389. // })()
  1390. // // wt1()
  1391. // }
  1392. }
  1393. // wt()
  1394. //图表 事件分类趋势分析饼图
  1395. // function barechart5(datas) {
  1396. // console.log(datas)
  1397. // console.log(echarts)
  1398. // // $scope.BTdata=datas
  1399. // console.log($scope.BTdata)
  1400. // var DATA = []
  1401. // for (var i = 0; i < $scope.BTdata.data.length; i++) {
  1402. // var dom = document.getElementById("item" + i);
  1403. // console.log(dom)
  1404. // var option = null;
  1405. // var myChart = echarts.init(dom);
  1406. // for (var j = 0; j < $scope.BTdata.data[i].length; j++) {
  1407. // var data = {
  1408. // "name": $scope.BTdata.data[i][j].category,
  1409. // "value": $scope.BTdata.data[i][j].num
  1410. // }
  1411. // DATA.push(data)
  1412. // }
  1413. // var total = $scope.BTdata.total[i]
  1414. // // if($scope.BTdata.total[i]==0){
  1415. // // total=0
  1416. // // }
  1417. // option = {
  1418. // // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  1419. // // backgroundColor: '#000',
  1420. // title: {
  1421. // text: '总数',
  1422. // subtext: total,
  1423. // textStyle: {
  1424. // color: '#333',
  1425. // fontSize: 16,
  1426. // // align: 'center'
  1427. // },
  1428. // subtextStyle: {
  1429. // fontSize: 14,
  1430. // color: ['#005395'],
  1431. // fontWeight: 'bolder'
  1432. // },
  1433. // x: '22%',
  1434. // y: '35%',
  1435. // },
  1436. // grid: {
  1437. // bottom: 150,
  1438. // left: 100,
  1439. // right: '10%'
  1440. // },
  1441. // legend: {
  1442. // orient: 'vertical',
  1443. // top: "middle",
  1444. // right: "5%",
  1445. // textStyle: {
  1446. // color: '#333',
  1447. // fontSize: 12,
  1448. // },
  1449. // itemWidth: 8,
  1450. // itemHeight: 8,
  1451. // icon: 'roundRect',
  1452. // data: DATA,
  1453. // },
  1454. // series: [
  1455. // // 主要展示层的
  1456. // {
  1457. // radius: ['55%', '85%'],
  1458. // center: ['25%', '50%'],
  1459. // type: 'pie',
  1460. // label: {
  1461. // normal: {
  1462. // show: true,
  1463. // formatter: "{c}%",
  1464. // textStyle: {
  1465. // fontSize: 14,
  1466. // },
  1467. // position: 'outside'
  1468. // },
  1469. // emphasis: {
  1470. // show: true
  1471. // }
  1472. // },
  1473. // labelLine: {
  1474. // normal: {
  1475. // show: true,
  1476. // length: 5,
  1477. // length2: 25
  1478. // },
  1479. // emphasis: {
  1480. // show: true
  1481. // }
  1482. // },
  1483. // name: "民警训练总量",
  1484. // data: DATA,
  1485. // },
  1486. // ]
  1487. // };
  1488. // if (option && typeof option === "object") {
  1489. // myChart.setOption(option);
  1490. // myChart.hideLoading();
  1491. // }
  1492. // }
  1493. // }
  1494. //图表 事件运维详情饼图1
  1495. function barechart6(datas) {
  1496. var dom = document.getElementById("XYSJ");
  1497. var option = null;
  1498. var myChart = echarts.init(dom);
  1499. var data = datas.pieChart;
  1500. option = {
  1501. color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  1502. // backgroundColor: '#000',
  1503. title: {
  1504. text: '响应事件总数 (件)',
  1505. subtext: datas.pieChartSum,
  1506. textAlign: 'center',
  1507. textStyle: {
  1508. color: '#333',
  1509. fontSize: 16,
  1510. // align: 'center'
  1511. },
  1512. subtextStyle: {
  1513. fontSize: 14,
  1514. color: ['#005395'],
  1515. fontWeight: 'bolder'
  1516. // align: 'center'
  1517. },
  1518. x: '24.5%',
  1519. y: '40%',
  1520. },
  1521. tooltip: {
  1522. trigger: 'item',
  1523. formatter: function (a) {
  1524. return (
  1525. a['data']['name'] + ":" + a['data']['value']
  1526. )
  1527. },
  1528. position: ['50%', '30%']
  1529. },
  1530. grid: {
  1531. bottom: 150,
  1532. left: 100,
  1533. right: '10%'
  1534. },
  1535. legend: {
  1536. orient: 'vertical',
  1537. top: "middle",
  1538. right: "5%",
  1539. textStyle: {
  1540. color: '#333',
  1541. fontSize: 12,
  1542. },
  1543. itemWidth: 8,
  1544. itemHeight: 8,
  1545. icon: 'roundRect',
  1546. data: data,
  1547. },
  1548. series: [
  1549. // 主要展示层的
  1550. {
  1551. radius: ['65%', '85%'],
  1552. center: ['25%', '50%'],
  1553. type: 'pie',
  1554. label: {
  1555. normal: {
  1556. show: true,
  1557. formatter: "{d}%",
  1558. textStyle: {
  1559. fontSize: 14,
  1560. },
  1561. position: 'outside'
  1562. },
  1563. emphasis: {
  1564. show: true
  1565. }
  1566. },
  1567. labelLine: {
  1568. normal: {
  1569. show: true,
  1570. length: 5,
  1571. length2: 25
  1572. },
  1573. emphasis: {
  1574. show: true
  1575. }
  1576. },
  1577. name: "",
  1578. data: data,
  1579. },
  1580. ]
  1581. };
  1582. if (option && typeof option === "object") {
  1583. myChart.setOption(option);
  1584. myChart.hideLoading();
  1585. }
  1586. }
  1587. //图表 事件运维详情饼图2
  1588. function barechart7(datas) {
  1589. // for (var i = 0; i < $scope.BTdata.length; i++) {
  1590. var dom = document.getElementById("JJSJ");
  1591. var option = null;
  1592. var myChart = echarts.init(dom);
  1593. var data = datas.pieChart;
  1594. option = {
  1595. color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  1596. // backgroundColor: '#000',
  1597. title: {
  1598. text: '解决事件总数 (件)',
  1599. subtext: datas.pieChartSum,
  1600. textAlign: 'center',
  1601. textStyle: {
  1602. color: '#333',
  1603. fontSize: 16,
  1604. // align: 'center'
  1605. },
  1606. subtextStyle: {
  1607. fontSize: 14,
  1608. color: ['#005395'],
  1609. fontWeight: 'bolder'
  1610. // align: 'center'
  1611. },
  1612. x: '24.5%',
  1613. y: '40%',
  1614. },
  1615. tooltip: {
  1616. // show: false,
  1617. trigger: 'item',
  1618. formatter: function (a) {
  1619. // console.log(a)
  1620. return (
  1621. a['data']['name'] + ":" + a['data']['value']
  1622. )
  1623. },
  1624. position: ['50%', '30%']
  1625. },
  1626. grid: {
  1627. bottom: 150,
  1628. left: 100,
  1629. right: '10%'
  1630. },
  1631. legend: {
  1632. orient: 'vertical',
  1633. top: "middle",
  1634. right: "5%",
  1635. textStyle: {
  1636. color: '#333',
  1637. fontSize: 12,
  1638. },
  1639. itemWidth: 8,
  1640. itemHeight: 8,
  1641. icon: 'roundRect',
  1642. data: data,
  1643. },
  1644. series: [
  1645. // 主要展示层的
  1646. {
  1647. radius: ['65%', '85%'],
  1648. center: ['25%', '50%'],
  1649. type: 'pie',
  1650. label: {
  1651. normal: {
  1652. show: true,
  1653. formatter: "{d}%",
  1654. textStyle: {
  1655. fontSize: 14,
  1656. },
  1657. position: 'outside'
  1658. },
  1659. emphasis: {
  1660. show: true
  1661. }
  1662. },
  1663. labelLine: {
  1664. normal: {
  1665. show: true,
  1666. length: 5,
  1667. length2: 25
  1668. },
  1669. emphasis: {
  1670. show: true
  1671. }
  1672. },
  1673. name: "",
  1674. data: data,
  1675. },
  1676. ]
  1677. };
  1678. if (option && typeof option === "object") {
  1679. myChart.setOption(option);
  1680. myChart.hideLoading();
  1681. }
  1682. // }
  1683. }
  1684. //图表 事件运维详情柱状图
  1685. function barechart8(datas) {
  1686. // console.log(datas);
  1687. var datas = datas;
  1688. var dom = document.getElementById("JJSJZZ");
  1689. var myChart = echarts.init(dom);
  1690. var option = null;
  1691. myChart.showLoading({
  1692. text: '数据加载中...',
  1693. color: '#c23531',
  1694. textColor: '#fff',
  1695. maskColor: 'rgba(255,255,255,0)',
  1696. zlevel: 0
  1697. });
  1698. myChart.hideLoading();
  1699. option = {
  1700. tooltip: {
  1701. trigger: 'axis',
  1702. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1703. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  1704. }
  1705. },
  1706. legend: {
  1707. data: ['按时响应', '逾期响应', '响应平均时间', '按时解决', '逾期解决', '解决平均时间'],
  1708. align: 'left',
  1709. // itemWidth:10,
  1710. // itemHeight:10,
  1711. bottom: 0
  1712. },
  1713. grid: {
  1714. top: '10%',
  1715. left: '1.5%',
  1716. right: '1.5%',
  1717. bottom: '15%',
  1718. containLabel: true
  1719. },
  1720. xAxis: [{
  1721. type: 'category',
  1722. // axisTick: {
  1723. // alignWithLabel: true
  1724. // },
  1725. axisLabel: {
  1726. textStyle: {
  1727. color: '#7B7B7B',
  1728. // fontSize: '14',
  1729. }
  1730. },
  1731. axisLine: {
  1732. show: true,
  1733. lineStyle: {
  1734. color: '#7B7B7B',
  1735. // type: 'dotted'
  1736. },
  1737. },
  1738. data: datas.name
  1739. }],
  1740. yAxis: [{
  1741. type: 'value',
  1742. scale: true,
  1743. name: '事件数量 (件)',
  1744. min: 0,
  1745. boundaryGap: [0.2, 0.2],
  1746. axisLabel: {
  1747. formatter: '{value}',
  1748. textStyle: {
  1749. color: '#7B7B7B',
  1750. // fontSize: '14',
  1751. }
  1752. },
  1753. axisLine: {
  1754. show: true,
  1755. lineStyle: {
  1756. color: '#7B7B7B',
  1757. // type: 'dotted'
  1758. },
  1759. },
  1760. },
  1761. {
  1762. type: 'value',
  1763. scale: true,
  1764. name: '按时解决率/逾期解决率',
  1765. min: 0,
  1766. max: 100,
  1767. boundaryGap: [0.2, 0.2],
  1768. axisLabel: {
  1769. textStyle: {
  1770. color: '#7B7B7B',
  1771. // fontSize: '14',
  1772. },
  1773. formatter: '{value} %'
  1774. },
  1775. axisLine: {
  1776. show: true,
  1777. lineStyle: {
  1778. color: '#7B7B7B',
  1779. // type: 'dotted'
  1780. },
  1781. },
  1782. }
  1783. ],
  1784. series: [{
  1785. name: '逾期响应',
  1786. type: 'bar',
  1787. stack: '1',
  1788. barWidth:30,
  1789. itemStyle: {
  1790. normal: {
  1791. color: '#005395'
  1792. }
  1793. },
  1794. data: datas.overtimeresponse
  1795. }, {
  1796. name: '按时响应',
  1797. type: 'bar',
  1798. barWidth:30,
  1799. stack: '1',
  1800. itemStyle: {
  1801. normal: {
  1802. color: '#E6EEF4'
  1803. }
  1804. },
  1805. data: datas.ontimeresponse
  1806. }, {
  1807. name: '逾期解决',
  1808. type: 'bar',
  1809. barWidth:30,
  1810. stack: '2',
  1811. itemStyle: {
  1812. normal: {
  1813. color: '#1CA58F'
  1814. }
  1815. },
  1816. data: datas.overtimesolve
  1817. }, {
  1818. name: '按时解决',
  1819. type: 'bar',
  1820. barWidth:30,
  1821. stack: '2',
  1822. itemStyle: {
  1823. normal: {
  1824. color: '#87C966'
  1825. }
  1826. },
  1827. data: datas.ontimesolve
  1828. }, {
  1829. name: '解决平均时间',
  1830. type: 'line',
  1831. itemStyle: {
  1832. normal: {
  1833. color: '#EF665C'
  1834. }
  1835. },
  1836. lineStyle: {
  1837. normal: {
  1838. color: '#EF665C'
  1839. }
  1840. },
  1841. data: datas.solvetime
  1842. },
  1843. {
  1844. name: '响应平均时间',
  1845. type: 'line',
  1846. itemStyle: {
  1847. normal: {
  1848. color: '#FFA35E'
  1849. }
  1850. },
  1851. lineStyle: {
  1852. normal: {
  1853. color: '#FFA35E'
  1854. }
  1855. },
  1856. data: datas.responsetime
  1857. }
  1858. ]
  1859. };
  1860. if (option && typeof option === "object") {
  1861. myChart.setOption(option);
  1862. myChart.hideLoading();
  1863. }
  1864. }
  1865. //图表 事件运维满意度柱状图
  1866. function barechart9(datas) {
  1867. var name = []
  1868. var series = []
  1869. for (var key in datas) {
  1870. if (key !== 'name') {
  1871. name.push(key);
  1872. series.push({
  1873. name: key,
  1874. type: 'bar',
  1875. stack: '1',
  1876. barWidth:40,
  1877. itemStyle: {
  1878. normal: {}
  1879. },
  1880. data: datas[key]
  1881. })
  1882. }
  1883. }
  1884. var dom = document.getElementById("jjmyd");
  1885. var myChart = echarts.init(dom);
  1886. var option = null;
  1887. myChart.showLoading({
  1888. text: '数据加载中...',
  1889. color: '#c23531',
  1890. textColor: '#fff',
  1891. maskColor: 'rgba(255,255,255,0)',
  1892. zlevel: 0
  1893. });
  1894. myChart.hideLoading();
  1895. option = {
  1896. tooltip: {
  1897. trigger: 'axis',
  1898. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  1899. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  1900. }
  1901. },
  1902. legend: {
  1903. data: name,
  1904. align: 'left',
  1905. // itemWidth:10,
  1906. // itemHeight:10,
  1907. bottom: 0
  1908. },
  1909. grid: {
  1910. top: '15%',
  1911. left: '1.5%',
  1912. right: '1.5%',
  1913. bottom: '15%',
  1914. containLabel: true
  1915. },
  1916. xAxis: [{
  1917. type: 'category',
  1918. // axisTick: {
  1919. // alignWithLabel: true
  1920. // },
  1921. axisLabel: {
  1922. textStyle: {
  1923. color: '#7B7B7B',
  1924. // fontSize: '14',
  1925. }
  1926. },
  1927. axisLine: {
  1928. show: true,
  1929. lineStyle: {
  1930. color: '#7B7B7B',
  1931. // type: 'dotted'
  1932. },
  1933. },
  1934. data: datas.name
  1935. }],
  1936. yAxis: [{
  1937. type: 'value',
  1938. scale: true,
  1939. name: '事件数量 (件)',
  1940. min: 0,
  1941. boundaryGap: [0.2, 0.2],
  1942. axisLabel: {
  1943. formatter: '{value}',
  1944. textStyle: {
  1945. color: '#7B7B7B',
  1946. // fontSize: '14',
  1947. }
  1948. },
  1949. axisLine: {
  1950. show: true,
  1951. lineStyle: {
  1952. color: '#7B7B7B',
  1953. // type: 'dotted'
  1954. },
  1955. },
  1956. }, ],
  1957. series: series
  1958. };
  1959. if (option && typeof option === "object") {
  1960. myChart.setOption(option);
  1961. myChart.hideLoading();
  1962. }
  1963. }
  1964. //图表 事件分类统计饼图
  1965. function barechart10(datas) {
  1966. console.log(datas)
  1967. if (datas) {
  1968. var dom = document.getElementById("sjflqs");
  1969. // console.log(dom)
  1970. var option = null;
  1971. var myChart = echarts.init(dom);
  1972. var data = [];
  1973. // var data1=[]
  1974. var data2 = []
  1975. for (var i = 0; i < datas.lsit.length; i++) {
  1976. var list = {
  1977. "name": datas.lsit[i].category,
  1978. "value": datas.lsit[i].proportion
  1979. }
  1980. data.push(list)
  1981. // data1.push(datas.lsit[i].proportion)
  1982. data2.push(datas.lsit[i].category)
  1983. }
  1984. // var data = [
  1985. // {
  1986. // "name": "网络故障报修",
  1987. // "value": 10
  1988. // },
  1989. // {
  1990. // "name": "上网账号",
  1991. // "value": 10
  1992. // }, {
  1993. // "name": "邮箱问题",
  1994. // "value": 10
  1995. // }, {
  1996. // "name": "用户资讯服务",
  1997. // "value": 10
  1998. // }, {
  1999. // "name": "校园卡",
  2000. // "value": 10
  2001. // }, {
  2002. // "name": "分类1",
  2003. // "value": 20
  2004. // }, {
  2005. // "name": "分类2",
  2006. // "value": 30
  2007. // },
  2008. // ]
  2009. option = {
  2010. // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  2011. // backgroundColor: '#000',
  2012. title: {
  2013. text: '事件总数 (件)',
  2014. subtext: datas.sum,
  2015. textAlign: 'center',
  2016. textStyle: {
  2017. color: '#333',
  2018. fontSize: 20,
  2019. // align: 'center'
  2020. },
  2021. subtextStyle: {
  2022. fontSize: 18,
  2023. color: ['#005395'],
  2024. fontWeight: 'bolder'
  2025. // align: 'center'
  2026. },
  2027. x: '25%',
  2028. y: '50%',
  2029. },
  2030. grid: {
  2031. top: '0%',
  2032. bottom: 150,
  2033. left: 100,
  2034. right: '10%'
  2035. },
  2036. legend: {
  2037. orient: 'vertical',
  2038. top: "middle",
  2039. left: "55%",
  2040. itemGap: 20,
  2041. textStyle: {
  2042. color: '#333',
  2043. fontSize: 16,
  2044. },
  2045. itemWidth: 15,
  2046. itemHeight: 15,
  2047. icon: 'roundRect',
  2048. data: data2,
  2049. },
  2050. series: [
  2051. // 主要展示层的
  2052. {
  2053. radius: ['45%', '65%'],
  2054. center: ['25%', '60%'],
  2055. type: 'pie',
  2056. label: {
  2057. normal: {
  2058. show: true,
  2059. formatter: "{c}%",
  2060. textStyle: {
  2061. fontSize: 14,
  2062. },
  2063. position: 'outside'
  2064. },
  2065. emphasis: {
  2066. show: true
  2067. }
  2068. },
  2069. labelLine: {
  2070. normal: {
  2071. show: true,
  2072. length: 5,
  2073. length2: 5,
  2074. fontSize: 16
  2075. },
  2076. emphasis: {
  2077. show: true
  2078. }
  2079. },
  2080. name: "民警训练总量",
  2081. data: data,
  2082. },
  2083. ]
  2084. };
  2085. if (option && typeof option === "object") {
  2086. myChart.setOption(option);
  2087. myChart.hideLoading();
  2088. }
  2089. }
  2090. // console.log(echarts)
  2091. // for (var i = 0; i < $scope.BTdata.length; i++) {
  2092. // }
  2093. }
  2094. //图表 事件分类趋势图
  2095. function barechart11(datas) {
  2096. console.log(datas)
  2097. if (datas) {
  2098. var dom = document.getElementById("sjfltj");
  2099. // console.log(dom)
  2100. var myChart = echarts.init(dom);
  2101. var option = null;
  2102. // console.log(myChart)
  2103. var serie = []
  2104. for (var i = 0; i < datas.data.length; i++) {
  2105. // for (var j = 0; j < datas.title.length; j++) {
  2106. // Series.name = datas.title[j]
  2107. var Series = {
  2108. name: datas.title[i],
  2109. type: 'line',
  2110. itemStyle: {
  2111. normal: {
  2112. // color: '#49A9EE'
  2113. }
  2114. },
  2115. lineStyle: {
  2116. normal: {
  2117. // color: '#49A9EE'
  2118. }
  2119. },
  2120. data: datas.data[i]
  2121. }
  2122. // }
  2123. serie.push(Series)
  2124. }
  2125. console.log(serie)
  2126. myChart.showLoading({
  2127. text: '数据加载中...',
  2128. color: '#c23531',
  2129. textColor: '#fff',
  2130. maskColor: 'rgba(255,255,255,0)',
  2131. zlevel: 0
  2132. });
  2133. myChart.hideLoading();
  2134. option = {
  2135. tooltip: {
  2136. trigger: 'axis',
  2137. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  2138. // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  2139. lineStyle: {
  2140. color: '#49A9EE',
  2141. type: 'dotted'
  2142. },
  2143. }
  2144. },
  2145. legend: {
  2146. data: datas.title,
  2147. align: 'left',
  2148. // itemWidth:10,
  2149. // itemHeight:10,
  2150. bottom: 0
  2151. },
  2152. grid: {
  2153. left: '1%',
  2154. right: '0%',
  2155. bottom: '15%',
  2156. top: '10%',
  2157. containLabel: true
  2158. },
  2159. xAxis: [{
  2160. type: 'category',
  2161. // axisTick: {
  2162. // alignWithLabel: true
  2163. // },
  2164. axisLabel: {
  2165. textStyle: {
  2166. color: '#7B7B7B',
  2167. // fontSize: '14',
  2168. }
  2169. },
  2170. axisLine: {
  2171. show: true,
  2172. lineStyle: {
  2173. color: '#7B7B7B',
  2174. // type: 'dotted'
  2175. },
  2176. },
  2177. // data: ['10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12']
  2178. data: datas.dates,
  2179. }],
  2180. yAxis: [{
  2181. type: 'value',
  2182. scale: true,
  2183. name: '事件数量 (件)',
  2184. min: 0,
  2185. boundaryGap: [0.2, 0.2],
  2186. // axisLabel: {
  2187. // formatter: '{value}'
  2188. // }
  2189. axisLabel: {
  2190. textStyle: {
  2191. color: '#7B7B7B',
  2192. // fontSize: '14',
  2193. }
  2194. },
  2195. axisLine: {
  2196. show: true,
  2197. lineStyle: {
  2198. color: '#7B7B7B',
  2199. // type: 'dotted'
  2200. },
  2201. },
  2202. }, ],
  2203. series: serie
  2204. // [{
  2205. // name: '分类1',
  2206. // type: 'line',
  2207. // itemStyle: {
  2208. // normal: {
  2209. // color: '#49A9EE'
  2210. // }
  2211. // },
  2212. // lineStyle: {
  2213. // normal: {
  2214. // color: '#49A9EE'
  2215. // }
  2216. // },
  2217. // data: [10, 20, 5, 43, 12, 34, 12, 56, 67]
  2218. // }, {
  2219. // name: '分类2',
  2220. // type: 'line',
  2221. // itemStyle: {
  2222. // normal: {
  2223. // color: '#87C966'
  2224. // }
  2225. // },
  2226. // lineStyle: {
  2227. // normal: {
  2228. // color: '#87C966'
  2229. // }
  2230. // },
  2231. // data: [12, 10, 15, 23, 19, 24, 18, 26, 57]
  2232. // }]
  2233. };
  2234. if (option && typeof option === "object") {
  2235. myChart.setOption(option);
  2236. myChart.hideLoading();
  2237. }
  2238. }
  2239. // console.log(echarts)
  2240. }
  2241. //图表 事件区域与事件分类分析图柱状图
  2242. function barechart12(datas) {
  2243. console.log(datas)
  2244. if (datas) {
  2245. var dom = document.getElementById("qysjfx");
  2246. // console.log(dom)
  2247. var myChart = echarts.init(dom);
  2248. var option = null;
  2249. // console.log(myChart)
  2250. myChart.showLoading({
  2251. text: '数据加载中...',
  2252. color: '#c23531',
  2253. textColor: '#fff',
  2254. maskColor: 'rgba(255,255,255,0)',
  2255. zlevel: 0
  2256. });
  2257. myChart.hideLoading();
  2258. var serie = []
  2259. for (var i = 0; i < datas.data.length; i++) {
  2260. // for(var j=0;datas.data[i].title;j++){
  2261. var Series = {
  2262. name: datas.data[i].title[i],
  2263. type: 'bar',
  2264. stack: '1',
  2265. itemStyle: {
  2266. normal: {
  2267. // color: '#49A9EE'
  2268. }
  2269. },
  2270. data: datas.data[i].num
  2271. }
  2272. // }
  2273. serie.push(Series)
  2274. // }
  2275. }
  2276. console.log(serie)
  2277. option = {
  2278. tooltip: {
  2279. trigger: 'axis',
  2280. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  2281. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  2282. }
  2283. },
  2284. legend: {
  2285. data: datas.category,
  2286. align: 'left',
  2287. // itemWidth:10,
  2288. // itemHeight:10,
  2289. bottom: 0
  2290. },
  2291. grid: {
  2292. top: '15%',
  2293. left: '1.5%',
  2294. right: '1.5%',
  2295. bottom: '15%',
  2296. containLabel: true
  2297. },
  2298. xAxis: [{
  2299. type: 'category',
  2300. // axisTick: {
  2301. // alignWithLabel: true
  2302. // },
  2303. axisLabel: {
  2304. textStyle: {
  2305. color: '#7B7B7B',
  2306. // fontSize: '14',
  2307. }
  2308. },
  2309. axisLine: {
  2310. show: true,
  2311. lineStyle: {
  2312. color: '#7B7B7B',
  2313. // type: 'dotted'
  2314. },
  2315. },
  2316. data: datas.area
  2317. }],
  2318. yAxis: [{
  2319. type: 'value',
  2320. scale: true,
  2321. name: '事件数量 (件)',
  2322. min: 0,
  2323. boundaryGap: [0.2, 0.2],
  2324. axisLabel: {
  2325. formatter: '{value}',
  2326. textStyle: {
  2327. color: '#7B7B7B',
  2328. // fontSize: '14',
  2329. }
  2330. },
  2331. axisLine: {
  2332. show: true,
  2333. lineStyle: {
  2334. color: '#7B7B7B',
  2335. // type: 'dotted'
  2336. },
  2337. },
  2338. }, ],
  2339. series: serie
  2340. // [{
  2341. // name: '分类1',
  2342. // type: 'bar',
  2343. // stack: '1',
  2344. // itemStyle: {
  2345. // normal: {
  2346. // color: '#49A9EE'
  2347. // }
  2348. // },
  2349. // data: [20, 12, 31, 23, 56, 78, 92, 12, 23, 14, 23, 54]
  2350. // }, {
  2351. // name: '分类2',
  2352. // type: 'bar',
  2353. // stack: '1',
  2354. // itemStyle: {
  2355. // normal: {
  2356. // color: '#1EA58F'
  2357. // }
  2358. // },
  2359. // data: [20, 12, 31, 23, 56, 78, 92, 12, 23, 14, 23, 54]
  2360. // }, {
  2361. // name: '分类3',
  2362. // type: 'bar',
  2363. // stack: '1',
  2364. // itemStyle: {
  2365. // normal: {
  2366. // color: '#87C966'
  2367. // }
  2368. // },
  2369. // data: [20, 12, 31, 23, 56, 78, 92, 12, 23, 14, 23, 54]
  2370. // }, {
  2371. // name: '分类4',
  2372. // type: 'bar',
  2373. // stack: '1',
  2374. // itemStyle: {
  2375. // normal: {
  2376. // color: '#FFA35E'
  2377. // }
  2378. // },
  2379. // data: [20, 12, 31, 23, 56, 78, 92, 12, 23, 14, 23, 54]
  2380. // }, {
  2381. // name: '分类5',
  2382. // type: 'bar',
  2383. // stack: '1',
  2384. // itemStyle: {
  2385. // normal: {
  2386. // color: '#EF665C'
  2387. // }
  2388. // },
  2389. // data: [12, 30, 15, 23, 32, 64, 17, 26, 87, 17, 63, 26]
  2390. // }, ]
  2391. };
  2392. if (option && typeof option === "object") {
  2393. myChart.setOption(option);
  2394. myChart.hideLoading();
  2395. }
  2396. }
  2397. // console.log(echarts)
  2398. }
  2399. //图表 事件来源统计饼图
  2400. function barechart13(datas) {
  2401. // console.log(datas)
  2402. // console.log(echarts)
  2403. var dom = document.getElementById("sjlyqs");
  2404. // console.log(dom)
  2405. var option = null;
  2406. var myChart = echarts.init(dom);
  2407. var Data_LYTJ = []
  2408. var Total = 0
  2409. if (datas && datas.length > 0) {
  2410. for (var j = 0; j < datas.length; j++) {
  2411. console.log(datas[j])
  2412. var data = {
  2413. "name": datas[j]._name,
  2414. "value": datas[j].percentage
  2415. }
  2416. Total = Total += datas[j]._count
  2417. Data_LYTJ.push(data)
  2418. }
  2419. console.log(Total)
  2420. option = {
  2421. color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  2422. // backgroundColor: '#000',
  2423. title: {
  2424. text: '事件总数 (件)',
  2425. subtext: Total,
  2426. textAlign: 'center',
  2427. textStyle: {
  2428. color: '#333',
  2429. fontSize: 20,
  2430. // align: 'center'
  2431. },
  2432. subtextStyle: {
  2433. fontSize: 18,
  2434. color: ['#005395'],
  2435. fontWeight: 'bolder'
  2436. // align: 'center'
  2437. },
  2438. x: '25%',
  2439. y: '40%',
  2440. },
  2441. grid: {
  2442. top: '0%',
  2443. bottom: 150,
  2444. left: 100,
  2445. right: '10%'
  2446. },
  2447. legend: {
  2448. orient: 'vertical',
  2449. top: "middle",
  2450. left: "55%",
  2451. itemGap: 20,
  2452. textStyle: {
  2453. color: '#333',
  2454. fontSize: 16,
  2455. },
  2456. itemWidth: 15,
  2457. itemHeight: 15,
  2458. icon: 'roundRect',
  2459. data: Data_LYTJ,
  2460. },
  2461. series: [
  2462. // 主要展示层的
  2463. {
  2464. radius: ['62%', '85%'],
  2465. center: ['25%', '50%'],
  2466. type: 'pie',
  2467. label: {
  2468. normal: {
  2469. show: true,
  2470. formatter: "{c}%",
  2471. textStyle: {
  2472. fontSize: 14,
  2473. },
  2474. position: 'outside'
  2475. },
  2476. emphasis: {
  2477. show: true
  2478. }
  2479. },
  2480. labelLine: {
  2481. normal: {
  2482. show: true,
  2483. length: 10,
  2484. length2: 35,
  2485. fontSize: 16
  2486. },
  2487. emphasis: {
  2488. show: true
  2489. }
  2490. },
  2491. name: "民警训练总量",
  2492. data: Data_LYTJ,
  2493. },
  2494. ]
  2495. };
  2496. if (option && typeof option === "object") {
  2497. myChart.setOption(option);
  2498. myChart.hideLoading();
  2499. }
  2500. }
  2501. }
  2502. //图表 事件来源趋势图
  2503. function barechart14(datas) {
  2504. console.log(datas)
  2505. var Series = []
  2506. var legend = {
  2507. data: [],
  2508. align: 'left',
  2509. // itemWidth:10,
  2510. // itemHeight:10,
  2511. bottom: 0
  2512. }
  2513. if (datas && datas.length > 0) {
  2514. for (var j = 0; j < datas[1].length; j++) {
  2515. console.log(datas[1][j])
  2516. for (var key in datas[1][j]) {
  2517. console.log(key)
  2518. console.log(datas[1][j][key])
  2519. var data = {
  2520. name: key,
  2521. type: 'line',
  2522. itemStyle: {
  2523. normal: {
  2524. // color: '#49A9EE'
  2525. }
  2526. },
  2527. lineStyle: {
  2528. normal: {
  2529. // color: '#49A9EE'
  2530. }
  2531. },
  2532. data: datas[1][j][key]
  2533. }
  2534. legend.data.push(key)
  2535. Series.push(data)
  2536. }
  2537. }
  2538. console.log(echarts)
  2539. var dom = document.getElementById("sjlytj");
  2540. console.log(dom)
  2541. var myChart = echarts.init(dom);
  2542. var option = null;
  2543. console.log(myChart)
  2544. myChart.showLoading({
  2545. text: '数据加载中...',
  2546. color: '#c23531',
  2547. textColor: '#fff',
  2548. maskColor: 'rgba(255,255,255,0)',
  2549. zlevel: 0
  2550. });
  2551. myChart.hideLoading();
  2552. option = {
  2553. color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
  2554. tooltip: {
  2555. trigger: 'axis',
  2556. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  2557. // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  2558. lineStyle: {
  2559. color: '#49A9EE',
  2560. type: 'dotted'
  2561. },
  2562. }
  2563. },
  2564. legend: legend,
  2565. grid: {
  2566. left: '1%',
  2567. right: '0%',
  2568. bottom: '15%',
  2569. top: '10%',
  2570. containLabel: true
  2571. },
  2572. xAxis: [{
  2573. type: 'category',
  2574. // axisTick: {
  2575. // alignWithLabel: true
  2576. // },
  2577. axisLabel: {
  2578. textStyle: {
  2579. color: '#7B7B7B',
  2580. // fontSize: '14',
  2581. }
  2582. },
  2583. axisLine: {
  2584. show: true,
  2585. lineStyle: {
  2586. color: '#7B7B7B',
  2587. // type: 'dotted'
  2588. },
  2589. },
  2590. data: datas[0]
  2591. }],
  2592. yAxis: [{
  2593. type: 'value',
  2594. scale: true,
  2595. name: '事件数量 (件)',
  2596. min: 0,
  2597. boundaryGap: [0.2, 0.2],
  2598. // axisLabel: {
  2599. // formatter: '{value}'
  2600. // }
  2601. axisLabel: {
  2602. textStyle: {
  2603. color: '#7B7B7B',
  2604. // fontSize: '14',
  2605. }
  2606. },
  2607. axisLine: {
  2608. show: true,
  2609. lineStyle: {
  2610. color: '#7B7B7B',
  2611. // type: 'dotted'
  2612. },
  2613. },
  2614. }, ],
  2615. series: Series
  2616. // [{
  2617. // name: '分类1',
  2618. // type: 'line',
  2619. // itemStyle: {
  2620. // normal: {
  2621. // color: '#49A9EE'
  2622. // }
  2623. // },
  2624. // lineStyle: {
  2625. // normal: {
  2626. // color: '#49A9EE'
  2627. // }
  2628. // },
  2629. // data: [10, 20, 5, 43, 12, 34, 12, 56, 67]
  2630. // }, {
  2631. // name: '分类2',
  2632. // type: 'line',
  2633. // itemStyle: {
  2634. // normal: {
  2635. // color: '#87C966'
  2636. // }
  2637. // },
  2638. // lineStyle: {
  2639. // normal: {
  2640. // color: '#87C966'
  2641. // }
  2642. // },
  2643. // data: [12, 10, 15, 23, 19, 24, 18, 26, 57]
  2644. // }]
  2645. };
  2646. if (option && typeof option === "object") {
  2647. myChart.setOption(option);
  2648. myChart.hideLoading();
  2649. }
  2650. }
  2651. }
  2652. // setTimeout(function () {
  2653. $scope.SLQS_Data($scope.searchkeys)
  2654. $scope.FLQS_Data1($scope.searchkeys)
  2655. // }, 1000);
  2656. }])