incident_reportCtrl.js 95 KB

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