incident_reportCtrl.js 96 KB

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