incident_reportCtrl.js 95 KB

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