incident_reportCtrl.js 87 KB

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