incident_reportCtrl.js 96 KB

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