incident_reportCtrl.js 102 KB

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