1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475 |
- "use strict";
- app.controller("incident_reportCtrl", [
- "$scope",
- "$rootScope",
- "$state",
- "$timeout",
- "$interval",
- "$http",
- "$cookieStore",
- "SweetAlert",
- "Restangular",
- "api_report",
- "api_statistic",
- "moment",
- "api_user_data",
- "api_bpm_data",
- "api_report_data",
- "api_category",
- function (
- $scope,
- $rootScope,
- $state,
- $timeout,
- $interval,
- $http,
- $cookieStore,
- SweetAlert,
- Restangular,
- api_report,
- api_statistic,
- moment,
- api_user_data,
- api_bpm_data,
- api_report_data,
- api_category
- ) {
- // 选择日期:
- $scope.dateSelected = [
- {
- name: "近90天",
- id: 0,
- },
- {
- name: "近1年",
- id: 1,
- },
- // {
- // name: "近3年",
- // id: 2,
- // },
- // {
- // name: "近5年",
- // id: 3,
- // },
- ];
- $scope.tap = "QSFX";
- $scope.tap1 = "flqs";
- $scope.searchkeys = {}; //搜索条件
- $scope.area_place = {}; //搜索条件
- $scope.dateChoose = {}; //选择日期组件存储值
- $scope.BTdata;
- var weeks = new Date().getDay();
- $scope.starttimes = moment(
- new Date().getTime() - 86400000 * (weeks + 6 - 1)
- ).format("YYYY-MM-DD 00:00:00");
- $scope.endtimes = moment(
- new Date().getTime() - 86400000 * (weeks - 1)
- ).format("YYYY-MM-DD 23:59:59");
- $scope.changeForm = function (paramDateFrom) {
- $scope.starttimes = moment(paramDateFrom).format("YYYY-MM-DD 00:00:00");
- };
- $scope.changeTo = function (paramDateTo) {
- $scope.endtimes = moment(paramDateTo).format("YYYY-MM-DD 23:59:59");
- };
- // 日期重置
- $scope.dateReset = function () {
- if ($scope.tap == "QSFX") {
- $scope.searchkeys.startTime = moment(new Date())
- .subtract(6, "months")
- .startOf("month")
- .format("YYYY-MM-DD 00:00:00");
- $scope.searchkeys.endTime = moment(new Date())
- .subtract(1, "months")
- .endOf("month")
- .format("YYYY-MM-DD 23:59:59");
- } else if ($scope.tap == "YWBB") {
- $scope.searchkeys.startTime = moment(new Date())
- .subtract(30, "days")
- .format("YYYY-MM-DD 00:00:00");
- $scope.searchkeys.endTime = moment(new Date())
- .subtract(1, "days")
- .format("YYYY-MM-DD 23:59:59");
- $scope.YWBB_searchKeys.startTime = $scope.searchkeys.startTime;
- $scope.YWBB_searchKeys.endTime = $scope.searchkeys.endTime;
- } else if ($scope.tap == "FLBB") {
- $scope.searchkeys.startTime = moment(
- new Date().getTime() - 86400000 * (weeks + 6 - 1)
- ).format("YYYY-MM-DD 00:00:00");
- $scope.searchkeys.endTime = moment(
- new Date().getTime() - 86400000 * (weeks - 1)
- ).format("YYYY-MM-DD 23:59:59");
- } else if ($scope.tap == "LYBB") {
- $scope.searchkeys.startTime = moment(
- new Date().getTime() - 86400000 * (weeks + 6 - 1)
- ).format("YYYY-MM-DD 00:00:00");
- $scope.searchkeys.endTime = moment(
- new Date().getTime() - 86400000 * (weeks - 1)
- ).format("YYYY-MM-DD 23:59:59");
- }
- };
- // $scope.init = function(branchId, duty){
- // $scope.SLQS_Data($scope.searchkeys);
- // $scope.FLQS_Data1($scope.searchkeys);
- // branchId && $scope.getAreas(branchId);
- // duty && $scope.getIncidentCategory(duty.id);
- // duty && $scope.getGroups(duty);
- // }
- // 切换院区
- $scope.own = {};
- $scope.changeBranch = function(){
- console.log($scope.own.branch);
- $scope.dutys = [];
- $scope.own.duty = null;
- $scope.own.branch && $scope.getOwnDuty($scope.own.branch.id);
- $scope.outarea = [];
- $scope.area_place.areaId = null;
- $scope.own.branch && $scope.getAreas($scope.own.branch.id);
- $scope.select_treedata = [];
- $scope.YWBB_searchKeys.groupId = undefined;
- $scope.my_data = [];
- $scope.YWBB_searchKeys.categoryId = undefined;
- $scope.area_place.placeId = null;
- $scope.outplace = [];
- }
- // 切换责任科室
- $scope.changeDuty = function(){
- console.log($scope.own.duty);
- $scope.select_treedata = [];
- $scope.YWBB_searchKeys.groupId = undefined;
- $scope.own.duty && $scope.getGroups($scope.own.duty);
-
- $scope.my_data = [];
- $scope.YWBB_searchKeys.categoryId = undefined;
- $scope.own.duty && $scope.getIncidentCategory($scope.own.duty.id);
- }
- // 获取院区
- $scope.branchs = [];
- $scope.getOwnBranch = function(){
- api_category
- .getOwnBranch({})
- .then(function (response) {
- if (response) {
- if ((response.status = 200)) {
- $scope.branchs = response.data;
- if($rootScope.user.duty){
- $scope.own.branch = {id: $rootScope.user.duty.branch, hosName: $rootScope.user.duty.branchName};
- $scope.getOwnDuty($rootScope.user.duty.branch, true);
- }else if($rootScope.user.branch){
- $scope.own.branch = $rootScope.user.branch;
- $scope.getOwnDuty($rootScope.user.branch.id, true);
- $scope.init($scope.own.branch.id);
- }
- }
- }
- });
- }
- $scope.getOwnBranch();
- // 获取责任科室
- $scope.dutys = [];
- $scope.getOwnDuty = function(branchId, isFirst = false, isReload = false){
- api_category
- .getOwnDuty({branchId: branchId})
- .then(function (response) {
- if (response) {
- if ((response.status = 200)) {
- $scope.dutys = response.data;
- if(isFirst && $rootScope.user.duty){
- $scope.own.duty = $rootScope.user.duty;
- // $scope.getGroup1s($scope.own.duty);
- $scope.init($scope.own.duty.branch, $scope.own.duty);
- }
- if(isReload){
- $rootScope.user.duty && ($scope.own.duty = $rootScope.user.duty);
- if ($scope.tap == "YWBB") {
- $scope.YWXL_Data();
- $scope.YWXQ_Data();
- $scope.YWMYD_Data();
- $scope.YWTop_Data();
- }
- if ($scope.tap == "LYBB") {
- $scope.LYQS_Data($scope.searchkeys);
- $scope.LYTJ_Data($scope.searchkeys);
- }
- if ($scope.tap == "QSFX") {
- $scope.SLQS_Data($scope.searchkeys);
- $scope.FLQS_Data($scope.searchkeys);
- $scope.FLQS_Data1($scope.searchkeys);
- }
- if ($scope.tap == "FLBB") {
- $scope.FLTJ_Data($scope.searchkeys);
- $scope.FLQST_Data($scope.searchkeys);
- // $scope.QYFL_Data($scope.searchkeys);
- }
- }
- }
- }
- });
- }
- // $scope.searchkeys.startTime = $scope.starttimes;
- // $scope.searchkeys.endTime = $scope.endtimes;
- $scope.dateReset();
- console.log($scope.searchkeys.startTime, $scope.searchkeys.endTime);
- // 运维报表搜索条件:
- $scope.YWBB_searchKeys = {
- startTime: $scope.searchkeys.startTime,
- endTime: $scope.searchkeys.endTime,
- };
- // n天前
- $scope.GetDateStr = function (AddDayCount) {
- var dd = new Date();
- dd.setDate(dd.getDate() + AddDayCount); //获取AddDayCount天后的日期
- var y = dd.getFullYear();
- var m =
- dd.getMonth() + 1 < 10 ? "0" + (dd.getMonth() + 1) : dd.getMonth() + 1; //获取当前月份的日期,不足10补0
- var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate(); //获取当前几号,不足10补0
- return y + "-" + m + "-" + d;
- };
- //上周
- $scope.week = function () {
- $scope.searchstate = "week";
- var weeks = new Date().getDay();
- $scope.starttimes = moment(
- new Date().getTime() - 86400000 * (weeks + 6)
- ).format("YYYY-MM-DD");
- $scope.endtimes = moment(new Date().getTime() - 86400000 * weeks).format(
- "YYYY-MM-DD"
- );
- $scope.searchkeys.startTime = $scope.starttimes;
- $scope.searchkeys.endTime = $scope.endtimes;
- };
- //上月
- $scope.month = function () {
- $scope.searchstate = "month";
- $scope.starttimes = moment(
- new Date(moment().startOf("month")).setMonth(new Date().getMonth() - 1)
- ).format("YYYY-MM-DD");
- $scope.endtimes = moment(
- new Date(moment().startOf("month")).setMonth(new Date().getMonth()) -
- 86400000
- ).format("YYYY-MM-DD");
- $scope.searchkeys.startTime = $scope.starttimes;
- $scope.searchkeys.endTime = $scope.endtimes;
- };
- //今年(1月1日-至今)
- $scope.year = function () {
- $scope.searchstate = "year";
- $scope.starttimes = moment()
- .startOf("year")
- .format("YYYY-MM-DD 00:00:00");
- $scope.endtimes = moment().format("YYYY-MM-DD 23:59:59");
- $scope.searchkeys.startTime = $scope.starttimes;
- $scope.searchkeys.endTime = $scope.endtimes;
- };
- // 近n年
- $scope.nearYear = function (n) {
- $scope.searchkeys.startTime = moment()
- .subtract(n, "years")
- .format("YYYY-MM-DD 00:00:00");
- $scope.endtimes = moment().format("YYYY-MM-DD 23:59:59");
- $scope.searchkeys.endTime = $scope.endtimes;
- console.log($scope.searchkeys.startTime, $scope.searchkeys.endTime);
- };
- /**
- *日历
- */
- $scope.open = function ($event) {
- $event.preventDefault();
- $event.stopPropagation();
- $scope.opened = !$scope.opened;
- };
- $scope.endOpen = function ($event) {
- $event.preventDefault();
- $event.stopPropagation();
- $scope.startOpened = false;
- $scope.endOpened = !$scope.endOpened;
- };
- $scope.startOpen = function ($event) {
- $event.preventDefault();
- $event.stopPropagation();
- $scope.endOpened = false;
- $scope.startOpened = !$scope.startOpened;
- };
-
- //选择类型
- $scope.active = function (name) {
- console.log($scope.own);
- $scope.dateChoose.dateSelected = {};
- $scope.deleteKey($scope.select_treedata);
- $scope.deleteKey($scope.my_data);
- $scope.select_treedata = angular.copy($scope.select_treedata);
- // $scope.my_data = angular.copy($scope.my_data);
- console.log($scope.searchkeys);
- if ($scope.searchkeys.placeId) {
- delete $scope.searchkeys.placeId;
- }
- if ($scope.searchkeys.areaId) {
- delete $scope.searchkeys.areaId;
- }
- $scope.tap = name;
- // $scope.searchkeys.startTime = moment($scope.searchkeys.startTime).format(
- // "YYYY-MM-DD 00:00:00"
- // );
- // $scope.searchkeys.endTime = moment($scope.searchkeys.endTime).format(
- // "YYYY-MM-DD 23:59:59"
- // );
- $scope.dateReset();
- if ($scope.tap == "QSFX") {
- $scope.tap1 = "flqs";
- $scope.area_place = {};
- setTimeout(function () {
- $scope.SLQS_Data($scope.searchkeys);
- $scope.FLQS_Data1($scope.searchkeys);
- }, 500);
- } else if ($scope.tap == "YWBB") {
- console.log($scope.own);
- $scope.area_place = {};
- setTimeout(function () {
- // barechart2();
- barechart3();
- // barechart6()
- // barechart7()
- // barechart8()
- // barechart9();
- $scope.YWXL_Data();
- $scope.YWXQ_Data();
- $scope.YWMYD_Data();
- $scope.YWTop_Data();
- }, 500);
- } else if ($scope.tap == "FLBB") {
- console.log($scope.own);
- $scope.area_place = {};
- setTimeout(function () {
- $scope.FLTJ_Data($scope.searchkeys);
- $scope.FLQST_Data($scope.searchkeys);
- // $scope.QYFL_Data($scope.searchkeys);
- }, 500);
- } else if ($scope.tap == "LYBB") {
- $scope.area_place = {};
- setTimeout(function () {
- $scope.LYQS_Data($scope.searchkeys);
- $scope.LYTJ_Data($scope.searchkeys);
- }, 500);
- }
- };
- //选择类型1
- $scope.active1 = function (name) {
- $scope.tap1 = name;
- if ($scope.tap1 == "flxq") {
- setTimeout(function () {
- // barechart();
- $scope.FLQS_Data($scope.searchkeys);
- }, 500);
- } else if ($scope.tap1 == "flqs") {
- setTimeout(function () {
- // barechart2();
- $scope.FLQS_Data1($scope.searchkeys);
- }, 500);
- }
- };
- //区域地点过滤
- $scope.key = {};
- $scope.getAreas = function(branchId){
- api_user_data
- .fetchDataList("area", {
- idx: 0,
- sum: 1000,
- area: {branch: branchId}
- })
- .then(function (data) {
- if (data) {
- if ((data.status = 200)) {
- $scope.outarea = data.list;
- }
- }
- });
- }
- //地点区域过滤
- $scope.onChangearea = function (data) {
- console.log(data);
- $scope.area_place.placeId = null;
- $scope.outplace = [];
- if(data.areaId){
- $scope.searchkeys["areaId"] = data.areaId.id;
- var fildata = {
- idx: 0,
- sum: 1000,
- place: {
- area: {
- id: data.areaId.id,
- },
- },
- };
- api_user_data.fetchDataList("place", fildata).then(function (response) {
- if (response) {
- if ((response.status = 200)) {
- $scope.outplace = response.list;
- }
- }
- });
- }else{
- $scope.searchkeys["areaId"] = undefined;
- $scope.searchkeys["placeId"] = undefined;
- $scope.outplace = [];
- }
-
- console.log($scope.searchkeys);
- };
- // 地点筛选
- $scope.onChangeplace = function (key) {
- console.log(key);
- delete $scope.searchkeys.areaId;
- delete $scope.searchkeys.placeId;
- if(key.placeId){
- $scope.searchkeys["placeId"] = key.placeId.id;
- }else{
- key.areaId && ($scope.searchkeys.areaId = key.areaId.id);
- }
- };
- // 选择日期
- $scope.onChangeDate = function (s) {
- $scope.dateChoose.dateSelected = s;
- switch (s.id) {
- case 0:
- // 最近90天
- console.log("最近90天");
- $scope.searchkeys.startTime = $scope.GetDateStr(-90);
- $scope.searchkeys.endTime = $scope.GetDateStr(0);
- break;
- case 1:
- // 最近一年
- console.log("最近一年");
- $scope.nearYear(1);
- break;
- case 2:
- // 最近三年
- console.log("最近三年");
- $scope.nearYear(3);
- break;
- case 3:
- // 最近五年
- console.log("最近五年");
- $scope.nearYear(5);
- break;
- }
- };
- //树形控件加载
- $scope.my_tree = {};
- $scope.getIncidentCategory = function (dutyId) {
- $scope.my_data = [];
- $scope.doing_async = true;
- api_bpm_data
- .fetchDataList("incidentcategory", {
- idx: 0,
- sum: 1000,
- incidentcategory: {
- duty: dutyId || undefined
- }
- })
- .then(function (response) {
- if (response.status == 200) {
- var data = response.list;
- var objects = [];
- for (var i = 0; i < data.length; i++) {
- var object = {};
- object.id = data[i].id;
- if (data[i].parent && data[i].parent.id != 0) {
- object.parent = data[i].parent.id;
- }
- object.label = data[i].category;
- objects.push(object);
- }
- $scope.my_data = convertParentToChildList(objects);
- $scope.tree_data = angular.copy($scope.my_data);
- if ($scope.my_data.length > 0) {
- $scope.doing_async = false;
- }
- // return $scope.my_tree.expand_all()
- } else {
- SweetAlert.swal({
- title: "系统错误!",
- text: "请刷新重试!",
- type: "error",
- });
- }
- });
- };
- function convertListToTree(data, treeMap) {
- var idToNodeMap = {}; //Keeps track of nodes using id as key, for fast lookup
- var root = null; //Initially set our loop to null
- var parentNode = null;
- //loop over data
- for (var i = 0; i < data.length; i++) {
- var datum = data[i];
- //each node will have children, so let's give it a "children" poperty
- datum.children = [];
- //add an entry for this node to the map so that any future children can
- //lookup the parent
- idToNodeMap[datum.id] = datum;
- //Does this node have a parent?
- if (typeof datum.parent === "undefined" || datum.parent == null) {
- //Doesn't look like it, so this node is the root of the tree
- root = datum;
- treeMap[datum.id] = root;
- } else {
- //This node has a parent, so let's look it up using the id
- parentNode = idToNodeMap[datum.parent];
- //We don't need this property, so let's delete it.
- delete datum.parent;
- //Let's add the current node as a child of the parent node.
- parentNode.children.push(datum);
- }
- }
- return root;
- }
- function convertParentToChildList(data) {
- var treeMap = {};
- var list = [];
- convertListToTree(data, treeMap);
- angular.forEach(treeMap, function (item) {
- list.push(item);
- });
- return list;
- }
- // $scope.my_tree = tree = {};
- $scope.getGroups = function (duty) {
- $scope.my_data1 = [];
- $scope.select_treedata = [];
- $scope.doing_async = true;
- api_user_data
- .fetchDataList("group", {
- idx: 0,
- sum: 1000,
- group: {
- selectType: "nouser",
- duty: duty || undefined
- },
- })
- .then(function (data) {
- $scope.select_treedata = $scope.my_data1 =
- //
- convertParentToChildList(data["list"]);
- $scope.doing_async = false;
- // tree.expand_all();
- //console.log(treelist);
- });
- };
- // $scope.getAreas();
- // $scope.getIncidentCategory();
- // $scope.getGroups();
- // 一、运维报表:
- // 故障现象选择:
- $scope.onFilterCategary = function (item) {
- // $scope.own.incidentCategory = item;
- console.log($scope.own);
- $scope.YWBB_searchKeys.categoryId = item.id;
- };
- $scope.onFilterGroup = function (item) {
- console.log(item);
- $scope.YWBB_searchKeys.groupId = item.id;
- };
- // 图表1、事件运维效率
- $scope.YWXL_Data = function () {
- $scope.YWBB_searchKeys.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- $scope.YWBB_searchKeys.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_operations_efficiency", $scope.YWBB_searchKeys)
- .then(function (data) {
- $scope.YWXL_Datas = data;
- barechart2(data);
- });
- };
- // 图表2、事件运维详情
- $scope.YWXQ_Data = function () {
- $scope.YWBB_searchKeys.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- $scope.YWBB_searchKeys.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_operations_details", $scope.YWBB_searchKeys)
- .then(function (data) {
- // $scope.YWXL_Datas = data;
- // 响应饼图
- barechart6(data.response);
- // 解决饼图
- barechart7(data.solve);
- // 柱状图
- // barechart8(data.barGraph);
- if (data.barGraph) {
- data.barGraph.ontimesolvePercentage = []; //按时解决率seimin
- data.barGraph.overtimesolvePercentage = []; //逾期解决率seimin
- data.barGraph.ontimesolve.forEach((v, i) => {
- data.barGraph.ontimesolvePercentage[i] =
- ((data.barGraph.ontimesolve[i] * 100) /
- (data.barGraph.ontimesolve[i] + data.barGraph.overtimesolve[i])).toFixed(2);
- data.barGraph.overtimesolvePercentage[i] =
- ((data.barGraph.overtimesolve[i] * 100) /
- (data.barGraph.ontimesolve[i] + data.barGraph.overtimesolve[i])).toFixed(2);
- });
- }
- console.log(data.barGraph);
- barechart8_1(data.barGraph);
- barechart8_2(data.barGraph);
- barechart8_3(data.barGraph);
- });
- };
- //事件趋势分析报表
- //数量趋势分析 图1
- $scope.SLQS_Data = function (data) {
- data.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- data.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data.reportsData("incident_trend", data).then(function (data) {
- console.log(data);
- if (data) {
- $scope.SLQS_Datas = data;
- // console.log($scope.LYQS_Datas)
- setTimeout(function () {
- barechart($scope.SLQS_Datas);
- }, 1000);
- }
- });
- };
- //分类趋势分析 图1
- $scope.FLQS_Data1 = function (data) {
- data.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- data.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_category_trend_time", data)
- .then(function (data) {
- console.log(data);
- if (data) {
- $scope.FLQS_Datas = data;
- // console.log($scope.LYQS_Datas)
- setTimeout(function () {
- barechart1($scope.FLQS_Datas);
- }, 1000);
- }
- });
- };
- //分类趋势分析 图2
- $scope.FLQS_Data = function (data) {
- data.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- data.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_category_month", data)
- .then(function (data) {
- console.log(data);
- var list1 = [];
- var list2 = [];
- if (data) {
- // for (var i = 0; i < data.data.length; i++) {
- // for (var j = 0; j < data.data[i].length; j++) {
- // // console.log(list1[i][j])
- // for (var l = 0; l < data.dates.length; l++) {
- // data.data[i][j]['time'] = data.dates[l]
- // }
- // }
- // console.log(data.data[i])
- // }
- $scope.BTdata = data;
- // console.log($scope.LYQS_Datas)
- setTimeout(function () {
- // barechart5($scope.BTdata)
- wt($scope.BTdata);
- }, 1000);
- }
- });
- };
- // 图表3、事件运维满意度
- $scope.YWMYD_Data = function () {
- $scope.YWBB_searchKeys.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- $scope.YWBB_searchKeys.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_operations_satisfaction", $scope.YWBB_searchKeys)
- .then(function (data) {
- $scope.YWMYD_Datas = data.sum;
- barechart9(data.barGraph);
- });
- };
- // 表格1、事件运维解决TOP排名
- $scope.YWTop_Data = function (sort) {
- console.log(sort);
- $scope.YWBB_searchKeys.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- $scope.YWBB_searchKeys.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- var postData = $scope.YWBB_searchKeys;
- if (sort) {
- postData.sortKye = sort;
- }
- api_report_data
- .reportsData("incident_operations_top", postData)
- .then(function (data) {
- $scope.YWBB_table_data = data.table;
- });
- };
- //事件来源报表数据获取
- //来源趋势数据 图1
- $scope.LYQS_Data = function (data) {
- data.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- data.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_source2_count", data)
- .then(function (data) {
- console.log(data);
- if (data.stats == 200) {
- $scope.LYQS_Datas = data.data;
- console.log($scope.LYQS_Datas);
- barechart13($scope.LYQS_Datas);
- }
- });
- };
- //来源统计数据 图2
- $scope.LYTJ_Data = function (data) {
- data.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- data.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_source2_trend", data)
- .then(function (data) {
- console.log(data);
- if (data.stats == 200) {
- $scope.LYTJ_Datas = data.data;
- console.log($scope.LYTJ_Datas);
- barechart14($scope.LYTJ_Datas);
- }
- });
- };
- //故障现象报表
- // 分类统计饼图
- $scope.FLTJ_Data = function (list) {
- list.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- list.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_category_proportion", list)
- .then(function (data) {
- // $scope.YWMYD_Datas = data.sum;
- // barechart9(data.barGraph);
- console.log(data);
- barechart10(data);
- });
- };
- // 分类趋势线图
- $scope.FLQST_Data = function (list) {
- list.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- list.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_category_trend", list)
- .then(function (data) {
- // $scope.YWMYD_Datas = data.sum;
- // barechart9(data.barGraph);
- console.log(data);
- barechart11(data);
- });
- };
- // 区域分类分析柱状图
- $scope.QYFL_Data = function (list) {
- list.dutyId = $scope.own.duty ? $scope.own.duty.id : undefined;
- list.branchId = $scope.own.branch ? $scope.own.branch.id : undefined;
- api_report_data
- .reportsData("incident_category_area", list)
- .then(function (data) {
- // $scope.YWMYD_Datas = data.sum;
- // barechart9(data.barGraph);
- console.log(data);
- barechart12(data);
- });
- };
- //搜索
- $scope.report_datas = function () {
- console.log($scope.searchkeys);
- var s = new Date($scope.searchkeys.startTime);
- var st = moment(s).format('YYYY-MM-DD 00:00:00')
- var e = new Date($scope.searchkeys.endTime);
- var en = moment(e).format('YYYY-MM-DD 23:59:59')
- $scope.searchkeys.startTime = st;
- $scope.searchkeys.endTime = en;
- if ($scope.tap == "YWBB") {
- $scope.YWBB_searchKeys.startTime = $scope.searchkeys.startTime;
- $scope.YWBB_searchKeys.endTime = $scope.searchkeys.endTime;
- $scope.YWXL_Data();
- $scope.YWXQ_Data();
- $scope.YWMYD_Data();
- $scope.YWTop_Data();
- }
- if ($scope.tap == "LYBB") {
- $scope.LYQS_Data($scope.searchkeys);
- $scope.LYTJ_Data($scope.searchkeys);
- }
- if ($scope.tap == "QSFX") {
- $scope.SLQS_Data($scope.searchkeys);
- $scope.FLQS_Data($scope.searchkeys);
- $scope.FLQS_Data1($scope.searchkeys);
- }
- if ($scope.tap == "FLBB") {
- var flbbData = angular.copy($scope.searchkeys);
- if ($scope.YWBB_searchKeys.categoryId) {
- flbbData.categoryId = $scope.YWBB_searchKeys.categoryId;
- }
- $scope.FLTJ_Data(flbbData);
- $scope.FLQST_Data(flbbData);
- // $scope.QYFL_Data(flbbData);
- }
- };
- //多选下拉框重置方法
- $scope.deleteKey = function (arr=[]) {
- arr.forEach((v) => {
- delete v.selected;
- v.isExpanded = false;
- if (v.children && v.children.length) {
- $scope.deleteKey(v.children);
- }
- });
- };
- //重置
- $scope.report_Reset = function () {
- // $scope.select_treedata = [];
- // $scope.my_data = [];
- $scope.deleteKey($scope.select_treedata);
- $scope.deleteKey($scope.my_data);
- $scope.select_treedata = angular.copy($scope.select_treedata);
- $scope.my_data = angular.copy($scope.my_data);
- // --------------------------
- console.log($scope.my_data);
- console.log($scope.select_treedata);
- $scope.dateChoose.dateSelected = {};
- if ($scope.searchkeys.placeId) {
- delete $scope.searchkeys.placeId;
- }
- if ($scope.searchkeys.areaId) {
- delete $scope.searchkeys.areaId;
- }
- $scope.area_place = {};
- // $scope.starttimes = moment(
- // new Date().getTime() - 86400000 * (weeks + 6 - 1)
- // ).format("YYYY-MM-DD");
- // $scope.endtimes = moment(
- // new Date().getTime() - 86400000 * (weeks - 1)
- // ).format("YYYY-MM-DD");
- // $scope.searchkeys.startTime = $scope.starttimes;
- // $scope.searchkeys.endTime = $scope.endtimes;
- $scope.dateReset();
- console.log($scope);
- $scope.YWBB_searchKeys = {
- startTime: $scope.searchkeys.startTime,
- endTime: $scope.searchkeys.endTime,
- };
- if($rootScope.user.duty){
- $scope.own.branch = {id: $rootScope.user.duty.branch, hosName: $rootScope.user.duty.branchName};
- $scope.getOwnDuty($rootScope.user.duty.branch, false, true);
- }else if($rootScope.user.branch){
- $scope.own.branch = $rootScope.user.branch;
- $scope.getOwnDuty($rootScope.user.branch.id, false, true);
- }
-
- };
- //图表 来电转换
- function barechart(datas) {
- console.log(datas);
- console.log(echarts);
- if (datas) {
- var dom = document.getElementById("ldzh");
- console.log(dom);
- var myChart = echarts.init(dom);
- var option = null;
- console.log(myChart);
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- legend: {
- data: ["事件总数", "环比增幅"],
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- top: "8%",
- left: "2%",
- right: "0%",
- bottom: "15%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas.dates,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- boundaryGap: [0.2, 0.2],
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- // {
- // type: "value",
- // scale: true,
- // name: "环比增幅 (%)",
- // min: 0,
- // max: 100,
- // boundaryGap: [0.2, 0.2],
- // axisLabel: {
- // formatter: "{value} %",
- // textStyle: {
- // color: "#7B7B7B",
- // // fontSize: '14',
- // },
- // },
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: "#7B7B7B",
- // // type: 'dotted'
- // },
- // },
- // },
- ],
- series: [
- {
- name: "事件总数",
- type: "bar",
- barMaxWidth: 30,
- itemStyle: {
- normal: {
- color: "#005395",
- },
- },
- data: datas.data,
- },
- // {
- // name: "环比增幅",
- // type: "line",
- // itemStyle: {
- // normal: {
- // color: "#1CA58F",
- // },
- // },
- // lineStyle: {
- // normal: {
- // color: "#1CA58F",
- // },
- // },
- // data: datas.per,
- // },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- }
- //图表 故障现象趋势分析
- function barechart1(datas) {
- console.log(datas);
- if (datas) {
- var dom = document.getElementById("sjfx");
- // console.log(dom)
- var myChart1 = echarts.init(dom);
- var option1 = null;
- // console.log(myChart1)
- myChart1.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart1.hideLoading();
- var serie = [];
- for (var i = 0; i < datas.data.length; i++) {
- // for (var j = 0; j < datas.title.length; j++) {
- // Series.name = datas.title[j]
- var Series = {
- name: datas.title[i],
- type: "line",
- itemStyle: {
- normal: {
- // color: '#49A9EE'
- },
- },
- lineStyle: {
- normal: {
- // color: '#49A9EE'
- },
- },
- data: datas.data[i],
- };
- // }
- serie.push(Series);
- }
- option1 = {
- // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- lineStyle: {
- color: "#49A9EE",
- type: "dotted",
- },
- },
- formatter: function (params) {
- // console.log(params);
- // console.log($scope.FLQS_Datas);
- var retStr = "";
- for (var j = 0; j < $scope.FLQS_Datas.title.length; j++) {
- for (var i = 0; i < params.length; i++) {
- var dateIndex = $scope.FLQS_Datas.dates.indexOf(
- params[i].name
- );
- }
- // var str = $scope.FLQS_Datas.title[j] + ":" + $scope.FLQS_Datas.data[j][dateIndex] + " " + "环比增幅:" + $scope.FLQS_Datas.per[j][dateIndex] + "%" + "<br />"
- // $scope.FLQS_Datas.per[j][dateIndex]= $scope.FLQS_Datas.per[j][dateIndex].toString()
- // if($scope.FLQS_Datas.per[j][dateIndex].indexOf('-')<0){
- // $scope.FLQS_Datas.per[j][dateIndex]='+'+$scope.FLQS_Datas.per[j][dateIndex]
- // }else{
- // }
- // console.log('+'+$scope.FLQS_Datas.per[j][dateIndex])
- var str =
- "<div style='width: 105%;font-size: 12px;'><div style='float: left;width: 48%;'>" +
- $scope.FLQS_Datas.title[j] +
- ": " +
- $scope.FLQS_Datas.data[j][dateIndex] +
- "件</div>" +
- " " +
- "<div style='float: left;width: 46%;margin-left: 1%;'>" +
- "环比增幅: " +
- $scope.FLQS_Datas.per[j][dateIndex] +
- "%" +
- "</div></div>";
- retStr += str;
- $scope.FLQS_Datas.dates[j] + "</br>" + retStr;
- }
- // console.log($scope.FLQS_Datas)
- for (var k = 0; k < params.length; k++) {
- // return params[i].name+'</br>'+params[i].seriesName+' :'+params[i].value+' '+'环比增幅 :'+params[i].dataIndex+'%';
- return params[k].name + "</br>" + retStr;
- }
- // return retStr
- },
- // formatter:'{a}{b} </br>事件数量: {c} 环比增幅: {c}%'
- // formatter: function (params, ticket, callback) {
- // console.log(params, ticket, callback)
- // // $.get('detail?name=' + params.name, function (content) {
- // // callback(ticket, toHTML(content));
- // // });
- // var list={
- // }
- // for(var i=0;i<params.length;i++){
- // return params[i].name+'</br>'+params[i].seriesName+' :'+params[i].value+' '+'环比增幅 :'+params[i].dataIndex+'%';
- // }
- // }
- },
- legend: {
- show: true,
- data: datas.title,
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- // formatter: function (name) {
- // console.log(name)
- // return name;
- // }
- },
- grid: {
- top: "8%",
- left: "2%",
- right: "0%",
- bottom: "10%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas.dates,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- boundaryGap: [0.2, 0.2],
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- // , {
- // type: 'value',
- // scale: true,
- // name: '环比增幅 (%)',
- // min: 0,
- // max: 100,
- // boundaryGap: [0.2, 0.2],
- // axisLabel: {
- // formatter: '{value} %',
- // textStyle: {
- // color: '#7B7B7B',
- // // fontSize: '14',
- // }
- // },
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: '#7B7B7B',
- // // type: 'dotted'
- // },
- // },
- // }
- ],
- series: serie,
- // [
- // {
- // name: '事件总数',
- // type: 'line',
- // show: false,
- // // itemStyle: {
- // // normal: {
- // // color: '#005395'
- // // }
- // // },
- // // lineStyle: {
- // // normal: {
- // // color: '#005395'
- // // }
- // // },
- // data: [10, 20, 5, 23, 12, 3, 63, 12, 23, 34, 76, 45]
- // }, {
- // name: '环比增幅',
- // type: 'line',
- // show: false,
- // // itemStyle: {
- // // normal: {
- // // color: '#005395'
- // // }
- // // },
- // // lineStyle: {
- // // normal: {
- // // color: '#005395'
- // // }
- // // },
- // data: [6, 45, 12, 4, 7, 43, 9, 32, 12, 21, 8, 10]
- // }, {
- // name: '通话时长2',
- // type: 'line',
- // // itemStyle: {
- // // normal: {
- // // color: '#005395'
- // // }
- // // },
- // // lineStyle: {
- // // normal: {
- // // color: '#005395'
- // // }
- // // },
- // data: [9, 41, 9, 12, 7, 34, 12, 54, 8, 9, 31, 12]
- // }, {
- // name: '通话时长3',
- // type: 'line',
- // // itemStyle: {
- // // normal: {
- // // color: '#005395'
- // // }
- // // },
- // // lineStyle: {
- // // normal: {
- // // color: '#005395'
- // // }
- // // },
- // data: [12, 24, 15, 22, 15, 31, 60, 16, 13, 24, 36, 55]
- // },
- // ]
- };
- if (option1 && typeof option1 === "object") {
- myChart1.setOption(option1, true);
- myChart1.hideLoading();
- }
- }
- // console.log(echarts)
- }
- //图表 事件运维效率
- function barechart2(datas) {
- var dom = document.getElementById("sjqs");
- var myChart = echarts.init(dom);
- var option = null;
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- lineStyle: {
- color: "#49A9EE",
- type: "dotted",
- },
- },
- },
- legend: {
- data: ["响应平均时长", "解决平均时长"],
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- left: "1%",
- right: "0%",
- bottom: "15%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas.keyList,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "平均时长",
- min: 0,
- boundaryGap: [0.2, 0.2],
- // axisLabel: {
- // formatter: '{value}'
- // }
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: [
- {
- name: "响应平均时长",
- type: "line",
- itemStyle: {
- normal: {
- color: "#49A9EE",
- },
- },
- lineStyle: {
- normal: {
- color: "#49A9EE",
- },
- },
- data: datas.responseDataList,
- },
- {
- name: "解决平均时长",
- type: "line",
- itemStyle: {
- normal: {
- color: "#87C966",
- },
- },
- lineStyle: {
- normal: {
- color: "#87C966",
- },
- },
- data: datas.solveDataList2,
- },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- //图表 运维转派,协同,升级
- function barechart3() {
- // console.log(echarts)
- var dom = document.getElementById("sjpd");
- console.log(dom);
- var myChart = echarts.init(dom);
- var option = null;
- console.log(myChart);
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- legend: {
- data: ["转派", "升级", "协同"],
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- left: ".5%",
- right: "0%",
- bottom: "15%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: [
- "10-12",
- "10-12",
- "10-12",
- "10-12",
- "10-12",
- "10-12",
- "10-12",
- "10-12",
- "10-12",
- ],
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- boundaryGap: [0.2, 0.2],
- axisLabel: {
- formatter: "{value}",
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: [
- {
- name: "转派",
- type: "bar",
- itemStyle: {
- normal: {
- color: "#005395",
- },
- },
- data: [20, 12, 31, 23, 56, 78, 92, 12, 23],
- },
- {
- name: "升级",
- type: "bar",
- itemStyle: {
- normal: {
- color: "#87C966",
- },
- },
- data: [10, 20, 5, 5, 2, 32, 34, 56, 23],
- },
- {
- name: "协同",
- type: "bar",
- itemStyle: {
- normal: {
- color: "#79A3C4",
- },
- },
- data: [15, 26, 15, 25, 32, 36, 6, 43, 12],
- },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- function wt(data) {
- console.log(data);
- // $scope.wt_data = ['1','2','3']
- setTimeout(function () {
- console.log(1);
- for (var i = 0; i < data.data.length; i++) {
- (function wt1() {
- var dom = document.getElementById("item" + i);
- console.log(dom);
- var myChart = echarts.init(dom);
- var datas1 = [];
- for (var j = 0; j < data.data[i].length; j++) {
- var datas = {
- name: data.data[i][j].category,
- value: data.data[i][j].num,
- };
- // {
- // "name": "上网账号",
- // "value": 10
- // }, {
- // "name": "邮箱问题",
- // "value": 10
- // }, {
- // "name": "用户资讯服务",
- // "value": 10
- // }, {
- // "name": "校园卡",
- // "value": 10
- // }, {
- // "name": "分类1",
- // "value": 20
- // }, {
- // "name": "分类2",
- // "value": 30
- // },
- datas1.push(datas);
- }
- // if(data.total[i]==0){
- // $scope.zero=i
- // }
- console.log(datas1);
- var option = {
- // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
- // backgroundColor: '#000',
- title: {
- text: "总数",
- subtext: data.total[i] || "0",
- textStyle: {
- color: "#333",
- fontSize: 16,
- align: "center",
- verticalAlign: "middle",
- },
- subtextStyle: {
- fontSize: 14,
- color: ["#005395"],
- fontWeight: "bolder",
- align: "center",
- verticalAlign: "middle",
- },
- x: "22%",
- y: "55%",
- },
- grid: {
- bottom: 150,
- left: 100,
- right: "10%",
- },
- legend: {
- orient: "vertical",
- top: "middle",
- right: "5%",
- textStyle: {
- color: "#333",
- fontSize: 12,
- },
- itemWidth: 8,
- itemHeight: 8,
- icon: "roundRect",
- data: datas1,
- },
- series: [
- // 主要展示层的
- {
- radius: ["35%", "50%"],
- center: ["25%", "65%"],
- type: "pie",
- label: {
- normal: {
- show: true,
- formatter: "{c}",
- textStyle: {
- fontSize: 14,
- },
- position: "outside",
- },
- emphasis: {
- show: true,
- },
- },
- labelLine: {
- normal: {
- show: true,
- length: 5,
- length2: 5,
- },
- emphasis: {
- show: true,
- },
- },
- hoverOffset: 5,
- name: "民警训练总量",
- data: datas1,
- },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- })();
- // wt1()
- }
- }, 1000);
- // for (var i = 0; i < $scope.wt_data.length; i++) {
- // (function wt1() {
- // var dom = document.getElementById("item" + i);
- // console.log(dom)
- // var myChart = echarts.init(dom);
- // var data = [{
- // "name": "网络故障报修",
- // "value": 10
- // }, {
- // "name": "上网账号",
- // "value": 10
- // }, {
- // "name": "邮箱问题",
- // "value": 10
- // }, {
- // "name": "用户资讯服务",
- // "value": 10
- // }, {
- // "name": "校园卡",
- // "value": 10
- // }, {
- // "name": "分类1",
- // "value": 20
- // }, {
- // "name": "分类2",
- // "value": 30
- // }, ]
- // option = {
- // // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
- // // backgroundColor: '#000',
- // title: {
- // text: '总数',
- // subtext: i + 1,
- // textStyle: {
- // color: '#333',
- // fontSize: 16,
- // // align: 'center'
- // },
- // subtextStyle: {
- // fontSize: 14,
- // color: ['#005395'],
- // fontWeight: 'bolder'
- // },
- // x: '22%',
- // y: '35%',
- // },
- // grid: {
- // bottom: 150,
- // left: 100,
- // right: '10%'
- // },
- // legend: {
- // orient: 'vertical',
- // top: "middle",
- // right: "5%",
- // textStyle: {
- // color: '#333',
- // fontSize: 12,
- // },
- // itemWidth: 8,
- // itemHeight: 8,
- // icon: 'roundRect',
- // data: data,
- // },
- // series: [
- // // 主要展示层的
- // {
- // radius: ['55%', '85%'],
- // center: ['25%', '50%'],
- // type: 'pie',
- // label: {
- // normal: {
- // show: true,
- // formatter: "{c}%",
- // textStyle: {
- // fontSize: 14,
- // },
- // position: 'outside'
- // },
- // emphasis: {
- // show: true
- // }
- // },
- // labelLine: {
- // normal: {
- // show: true,
- // length: 5,
- // length2: 25
- // },
- // emphasis: {
- // show: true
- // }
- // },
- // name: "民警训练总量",
- // data: data,
- // },
- // ]
- // };
- // if (option && typeof option === "object") {
- // myChart.setOption(option);
- // myChart.hideLoading();
- // }
- // })()
- // // wt1()
- // }
- }
- // wt()
- //图表 故障现象趋势分析饼图
- // function barechart5(datas) {
- // console.log(datas)
- // console.log(echarts)
- // // $scope.BTdata=datas
- // console.log($scope.BTdata)
- // var DATA = []
- // for (var i = 0; i < $scope.BTdata.data.length; i++) {
- // var dom = document.getElementById("item" + i);
- // console.log(dom)
- // var option = null;
- // var myChart = echarts.init(dom);
- // for (var j = 0; j < $scope.BTdata.data[i].length; j++) {
- // var data = {
- // "name": $scope.BTdata.data[i][j].category,
- // "value": $scope.BTdata.data[i][j].num
- // }
- // DATA.push(data)
- // }
- // var total = $scope.BTdata.total[i]
- // // if($scope.BTdata.total[i]==0){
- // // total=0
- // // }
- // option = {
- // // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
- // // backgroundColor: '#000',
- // title: {
- // text: '总数',
- // subtext: total,
- // textStyle: {
- // color: '#333',
- // fontSize: 16,
- // // align: 'center'
- // },
- // subtextStyle: {
- // fontSize: 14,
- // color: ['#005395'],
- // fontWeight: 'bolder'
- // },
- // x: '22%',
- // y: '35%',
- // },
- // grid: {
- // bottom: 150,
- // left: 100,
- // right: '10%'
- // },
- // legend: {
- // orient: 'vertical',
- // top: "middle",
- // right: "5%",
- // textStyle: {
- // color: '#333',
- // fontSize: 12,
- // },
- // itemWidth: 8,
- // itemHeight: 8,
- // icon: 'roundRect',
- // data: DATA,
- // },
- // series: [
- // // 主要展示层的
- // {
- // radius: ['55%', '85%'],
- // center: ['25%', '50%'],
- // type: 'pie',
- // label: {
- // normal: {
- // show: true,
- // formatter: "{c}%",
- // textStyle: {
- // fontSize: 14,
- // },
- // position: 'outside'
- // },
- // emphasis: {
- // show: true
- // }
- // },
- // labelLine: {
- // normal: {
- // show: true,
- // length: 5,
- // length2: 25
- // },
- // emphasis: {
- // show: true
- // }
- // },
- // name: "民警训练总量",
- // data: DATA,
- // },
- // ]
- // };
- // if (option && typeof option === "object") {
- // myChart.setOption(option);
- // myChart.hideLoading();
- // }
- // }
- // }
- //图表 事件运维详情饼图1
- function barechart6(datas) {
- var dom = document.getElementById("XYSJ");
- var option = null;
- var myChart = echarts.init(dom);
- var data = datas.pieChart;
- option = {
- color: ["#91c7ae", "#61a0a8", "#2f4554", "#c23531", "#d48265"],
- title: {
- text: "微信用户评价\n\n满意度占比",
- // subtext: datas.pieChartSum,
- textAlign: "center",
- textStyle: {
- color: "#333",
- fontSize: 16,
- // align: 'center',
- },
- subtextStyle: {
- fontSize: 14,
- color: ["#005395"],
- fontWeight: "bolder",
- // align: 'center'
- },
- x: "34.5%",
- y: "50%",
- },
- tooltip: {
- trigger: "item",
- formatter: function (a) {
- return a["data"]["name"] + ":" + a["data"]["value"];
- },
- position: ["50%", "30%"],
- },
- grid: {
- bottom: 150,
- left: 100,
- right: "10%",
- },
- legend: {
- orient: "vertical",
- top: "middle",
- right: "5%",
- textStyle: {
- color: "#333",
- fontSize: 12,
- },
- itemWidth: 8,
- itemHeight: 8,
- icon: "roundRect",
- data: data,
- },
- series: [
- // 主要展示层的
- {
- radius: ["50%", "65%"],
- center: ["35%", "60%"],
- type: "pie",
- label: {
- normal: {
- show: true,
- formatter: "{d}%",
- textStyle: {
- fontSize: 14,
- },
- position: "outside",
- },
- emphasis: {
- show: true,
- },
- },
- labelLine: {
- normal: {
- show: true,
- length: 5,
- length2: 25,
- },
- emphasis: {
- show: true,
- },
- },
- name: "",
- data: data,
- },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- //图表 事件运维详情饼图2
- function barechart7(datas) {
- // for (var i = 0; i < $scope.BTdata.length; i++) {
- var dom = document.getElementById("JJSJ");
- var option = null;
- var myChart = echarts.init(dom);
- var data = datas.pieChart;
- option = {
- color: [
- "#005395",
- "#1EA58F",
- "#87C966",
- "#FFCD61",
- "#585247",
- "#49A9EE",
- "#009D85",
- "rgba(250,250,250,0.3)",
- ],
- // backgroundColor: '#000',
- title: {
- text: "解决事件总数 (件)",
- subtext: datas.pieChartSum,
- textAlign: "center",
- textStyle: {
- color: "#333",
- fontSize: 16,
- // align: 'center'
- },
- subtextStyle: {
- fontSize: 14,
- color: ["#005395"],
- fontWeight: "bolder",
- // align: 'center'
- },
- x: "34.5%",
- y: "50%",
- },
- tooltip: {
- // show: false,
- trigger: "item",
- formatter: function (a) {
- // console.log(a)
- return a["data"]["name"] + ":" + a["data"]["value"];
- },
- position: ["50%", "30%"],
- },
- grid: {
- bottom: 150,
- left: 100,
- right: "10%",
- },
- legend: {
- orient: "vertical",
- top: "middle",
- right: "5%",
- textStyle: {
- color: "#333",
- fontSize: 12,
- },
- itemWidth: 8,
- itemHeight: 8,
- icon: "roundRect",
- data: data,
- },
- series: [
- // 主要展示层的
- {
- radius: ["50%", "65%"],
- center: ["35%", "60%"],
- type: "pie",
- label: {
- normal: {
- show: true,
- formatter: "{d}%",
- textStyle: {
- fontSize: 14,
- },
- position: "outside",
- },
- emphasis: {
- show: true,
- },
- },
- labelLine: {
- normal: {
- show: true,
- length: 5,
- length2: 25,
- },
- emphasis: {
- show: true,
- },
- },
- name: "",
- data: data,
- },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- // }
- }
- //图表 事件运维详情柱状图seimin-1
- // function barechart8(datas) {
- // var datas = datas;
- // var dom = document.getElementById("JJSJZZ");
- // var myChart = echarts.init(dom);
- // var option = null;
- // myChart.showLoading({
- // text: "数据加载中...",
- // color: "#c23531",
- // textColor: "#fff",
- // maskColor: "rgba(255,255,255,0)",
- // zlevel: 0,
- // });
- // myChart.hideLoading();
- // option = {
- // tooltip: {
- // trigger: "axis",
- // axisPointer: {
- // // 坐标轴指示器,坐标轴触发有效
- // type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
- // },
- // },
- // legend: {
- // data: [
- // "按时响应",
- // "逾期响应",
- // "响应平均时间",
- // "按时解决",
- // "逾期解决",
- // "解决平均时间",
- // ],
- // align: "left",
- // // itemWidth:10,
- // // itemHeight:10,
- // bottom: 0,
- // },
- // grid: {
- // top: "10%",
- // left: "1.5%",
- // right: "1.5%",
- // bottom: "15%",
- // containLabel: true,
- // },
- // xAxis: [
- // {
- // type: "category",
- // // axisTick: {
- // // alignWithLabel: true
- // // },
- // axisLabel: {
- // textStyle: {
- // color: "#7B7B7B",
- // // fontSize: '14',
- // },
- // },
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: "#7B7B7B",
- // // type: 'dotted'
- // },
- // },
- // data: datas.name,
- // },
- // ],
- // yAxis: [
- // {
- // type: "value",
- // scale: true,
- // name: "事件数量 (件)",
- // min: 0,
- // boundaryGap: [0.2, 0.2],
- // axisLabel: {
- // formatter: "{value}",
- // textStyle: {
- // color: "#7B7B7B",
- // // fontSize: '14',
- // },
- // },
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: "#7B7B7B",
- // // type: 'dotted'
- // },
- // },
- // },
- // {
- // type: "value",
- // scale: true,
- // name: "按时解决率/逾期解决率",
- // min: 0,
- // max: 100,
- // boundaryGap: [0.2, 0.2],
- // axisLabel: {
- // textStyle: {
- // color: "#7B7B7B",
- // // fontSize: '14',
- // },
- // formatter: "{value} %",
- // },
- // axisLine: {
- // show: true,
- // lineStyle: {
- // color: "#7B7B7B",
- // // type: 'dotted'
- // },
- // },
- // },
- // ],
- // series: [
- // {
- // name: "逾期响应",
- // type: "bar",
- // stack: "1",
- // barWidth: 30,
- // itemStyle: {
- // normal: {
- // color: "#005395",
- // },
- // },
- // data: datas.overtimeresponse,
- // },
- // {
- // name: "按时响应",
- // type: "bar",
- // barWidth: 30,
- // stack: "1",
- // itemStyle: {
- // normal: {
- // color: "#E6EEF4",
- // },
- // },
- // data: datas.ontimeresponse,
- // },
- // {
- // name: "逾期解决",
- // type: "bar",
- // barWidth: 30,
- // stack: "2",
- // itemStyle: {
- // normal: {
- // color: "#1CA58F",
- // },
- // },
- // data: datas.overtimesolve,
- // },
- // {
- // name: "按时解决",
- // type: "bar",
- // barWidth: 30,
- // stack: "2",
- // itemStyle: {
- // normal: {
- // color: "#87C966",
- // },
- // },
- // data: datas.ontimesolve,
- // },
- // {
- // name: "解决平均时间",
- // type: "line",
- // itemStyle: {
- // normal: {
- // color: "#EF665C",
- // },
- // },
- // lineStyle: {
- // normal: {
- // color: "#EF665C",
- // },
- // },
- // data: datas.solvetime,
- // },
- // {
- // name: "响应平均时间",
- // type: "line",
- // itemStyle: {
- // normal: {
- // color: "#FFA35E",
- // },
- // },
- // lineStyle: {
- // normal: {
- // color: "#FFA35E",
- // },
- // },
- // data: datas.responsetime,
- // },
- // ],
- // };
- // if (option && typeof option === "object") {
- // myChart.setOption(option);
- // myChart.hideLoading();
- // }
- // }
- //图表 按时解决率、逾期解决率seimin-1
- function barechart8_1(datas) {
- console.log(datas, "barechart8_1");
- var dom = document.getElementById("JJSJZZ_1");
- var myChart = echarts.init(dom);
- var option = null;
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- lineStyle: {
- color: "#49A9EE",
- type: "dotted",
- },
- },
- formatter: function (params) {
- var result = params[0].name + "<br>";
- params.forEach(function (item) {
- result +=
- item.marker +
- " " +
- item.seriesName +
- " : " +
- item.value +
- "%</br>";
- });
- return result;
- },
- },
- legend: {
- data: ["按时解决率", "逾期解决率"],
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- left: "1%",
- right: "0%",
- bottom: "15%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas.name,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "解决率(%)",
- min: 0,
- max: 100,
- boundaryGap: [0.2, 0.2],
- axisLabel: {
- formatter: "{value}%",
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: [
- {
- name: "按时解决率",
- type: "line",
- itemStyle: {
- normal: {
- lineStyle: {
- color: "#91c7ae",
- },
- color: "#91c7ae",
- },
- },
- lineStyle: {
- normal: {
- color: "#91c7ae",
- },
- },
- data: datas.ontimesolvePercentage,
- },
- {
- name: "逾期解决率",
- type: "line",
- itemStyle: {
- normal: {
- lineStyle: {
- color: "#d48265",
- },
- color: "#d48265",
- },
- },
- lineStyle: {
- normal: {
- color: "#d48265",
- },
- },
- data: datas.overtimesolvePercentage,
- },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- //图表 按时响应逾期响应柱状图seimin-2
- function barechart8_2(datas) {
- var series = [];
- var arrName = ["按时响应", "逾期响应"];
- var arrObj = [datas.ontimeresponse, datas.overtimeresponse];
- arrName.forEach((v, i) => {
- series.push({
- name: v,
- type: "bar",
- stack: "1",
- barWidth: 40,
- itemStyle: {
- normal: {},
- },
- data: arrObj[i],
- });
- });
- var dom = document.getElementById("JJSJZZ_2");
- var myChart = echarts.init(dom);
- var option = null;
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- color: ["#91c7ae", "#d48265"],
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- legend: {
- data: arrName,
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- top: "15%",
- left: "3%",
- right: "1.5%",
- bottom: "15%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas.name,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- minInterval: 1,
- boundaryGap: [0.2, 0.2],
- axisLabel: {
- formatter: "{value}",
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: series,
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- //图表 按时解决逾期解决柱状图seimin-3
- function barechart8_3(datas) {
- var series = [];
- var arrName = ["按时解决", "逾期解决"];
- var arrObj = [datas.ontimesolve, datas.overtimesolve];
- arrName.forEach((v, i) => {
- series.push({
- name: v,
- type: "bar",
- stack: "1",
- barWidth: 40,
- itemStyle: {
- normal: {},
- },
- data: arrObj[i],
- });
- });
- var dom = document.getElementById("JJSJZZ_3");
- var myChart = echarts.init(dom);
- var option = null;
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- color: ["#91c7ae", "#d48265"],
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- legend: {
- data: arrName,
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- top: "15%",
- left: "3%",
- right: "1.5%",
- bottom: "15%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas.name,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- minInterval: 1,
- boundaryGap: [0.2, 0.2],
- axisLabel: {
- formatter: "{value}",
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: series,
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- //图表 事件运维满意度柱状图
- function barechart9(datas) {
- console.log(datas);
- var name = [];
- var series = [];
- for (var key in datas) {
- if (key !== "name") {
- name.push(key);
- series.push({
- name: key,
- type: "bar",
- stack: "1",
- barWidth: 40,
- itemStyle: {
- normal: {},
- },
- data: datas[key],
- });
- }
- }
- var dom = document.getElementById("jjmyd");
- var myChart = echarts.init(dom);
- var option = null;
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- legend: {
- data: name,
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- top: "15%",
- left: "1.5%",
- right: "1.5%",
- bottom: "15%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas.name,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- boundaryGap: [0.2, 0.2],
- axisLabel: {
- formatter: "{value}",
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: series,
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- //图表 故障现象统计饼图
- function barechart10(datas) {
- console.log(datas);
- if (datas) {
- var dom = document.getElementById("sjflqs");
- // console.log(dom)
- var option = null;
- var myChart = echarts.init(dom);
- var data = [];
- // var data1=[]
- var data2 = [];
- for (var i = 0; i < datas.lsit.length; i++) {
- var list = {
- name: datas.lsit[i].category,
- value: datas.lsit[i].proportion,
- };
- data.push(list);
- // data1.push(datas.lsit[i].proportion)
- data2.push(datas.lsit[i].category);
- }
- // var data = [
- // {
- // "name": "网络故障报修",
- // "value": 10
- // },
- // {
- // "name": "上网账号",
- // "value": 10
- // }, {
- // "name": "邮箱问题",
- // "value": 10
- // }, {
- // "name": "用户资讯服务",
- // "value": 10
- // }, {
- // "name": "校园卡",
- // "value": 10
- // }, {
- // "name": "分类1",
- // "value": 20
- // }, {
- // "name": "分类2",
- // "value": 30
- // },
- // ]
- option = {
- // color: ['#005395', '#1EA58F', '#87C966', '#FFCD61', '#585247', '#49A9EE', '#009D85', "rgba(250,250,250,0.3)"],
- // backgroundColor: '#000',
- title: {
- text: "事件总数 (件)",
- subtext: datas.sum,
- textAlign: "center",
- textStyle: {
- color: "#333",
- fontSize: 20,
- // align: 'center'
- },
- subtextStyle: {
- fontSize: 18,
- color: ["#005395"],
- fontWeight: "bolder",
- // align: 'center'
- },
- x: "25%",
- y: "50%",
- },
- grid: {
- top: "0%",
- bottom: 150,
- left: 100,
- right: "10%",
- },
- legend: {
- orient: "vertical",
- top: "middle",
- left: "55%",
- itemGap: 20,
- textStyle: {
- color: "#333",
- fontSize: 16,
- },
- itemWidth: 15,
- itemHeight: 15,
- icon: "roundRect",
- data: data2,
- },
- series: [
- // 主要展示层的
- {
- radius: ["45%", "65%"],
- center: ["25%", "60%"],
- type: "pie",
- label: {
- normal: {
- show: true,
- formatter: "{c}%",
- textStyle: {
- fontSize: 14,
- },
- position: "outside",
- },
- emphasis: {
- show: true,
- },
- },
- labelLine: {
- normal: {
- show: true,
- length: 5,
- length2: 5,
- fontSize: 16,
- },
- emphasis: {
- show: true,
- },
- },
- name: "民警训练总量",
- data: data,
- },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- // console.log(echarts)
- // for (var i = 0; i < $scope.BTdata.length; i++) {
- // }
- }
- //图表 故障现象趋势图
- function barechart11(datas) {
- console.log(datas);
- if (datas) {
- var dom = document.getElementById("sjfltj");
- // console.log(dom)
- var myChart = echarts.init(dom);
- var option = null;
- // console.log(myChart)
- var serie = [];
- for (var i = 0; i < datas.data.length; i++) {
- // for (var j = 0; j < datas.title.length; j++) {
- // Series.name = datas.title[j]
- var Series = {
- name: datas.title[i],
- type: "line",
- itemStyle: {
- normal: {
- // color: '#49A9EE'
- },
- },
- lineStyle: {
- normal: {
- // color: '#49A9EE'
- },
- },
- data: datas.data[i],
- };
- // }
- serie.push(Series);
- }
- console.log(serie);
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- lineStyle: {
- color: "#49A9EE",
- type: "dotted",
- },
- },
- },
- legend: {
- data: datas.title,
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- left: "3%",
- right: "0%",
- bottom: "15%",
- top: "10%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- // data: ['10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12', '10-12']
- data: datas.dates,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- boundaryGap: [0.2, 0.2],
- // axisLabel: {
- // formatter: '{value}'
- // }
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: serie,
- // [{
- // name: '分类1',
- // type: 'line',
- // itemStyle: {
- // normal: {
- // color: '#49A9EE'
- // }
- // },
- // lineStyle: {
- // normal: {
- // color: '#49A9EE'
- // }
- // },
- // data: [10, 20, 5, 43, 12, 34, 12, 56, 67]
- // }, {
- // name: '分类2',
- // type: 'line',
- // itemStyle: {
- // normal: {
- // color: '#87C966'
- // }
- // },
- // lineStyle: {
- // normal: {
- // color: '#87C966'
- // }
- // },
- // data: [12, 10, 15, 23, 19, 24, 18, 26, 57]
- // }]
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- // console.log(echarts)
- }
- //图表 事件区域与故障现象分析图柱状图
- function barechart12(datas) {
- console.log(datas);
- if (datas) {
- var dom = document.getElementById("qysjfx");
- // console.log(dom)
- var myChart = echarts.init(dom);
- var option = null;
- // console.log(myChart)
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- var serie = [];
- for (var i = 0; i < datas.data.length; i++) {
- // for(var j=0;datas.data[i].title;j++){
- var Series = {
- name: datas.data[i].title[i],
- type: "bar",
- stack: "1",
- itemStyle: {
- normal: {
- // color: '#49A9EE'
- },
- },
- data: datas.data[i].num,
- };
- // }
- serie.push(Series);
- // }
- }
- console.log(serie);
- option = {
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- legend: {
- data: datas.category,
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- },
- grid: {
- top: "15%",
- left: "1.5%",
- right: "1.5%",
- bottom: "15%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas.area,
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- boundaryGap: [0.2, 0.2],
- axisLabel: {
- formatter: "{value}",
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: serie,
- // [{
- // name: '分类1',
- // type: 'bar',
- // stack: '1',
- // itemStyle: {
- // normal: {
- // color: '#49A9EE'
- // }
- // },
- // data: [20, 12, 31, 23, 56, 78, 92, 12, 23, 14, 23, 54]
- // }, {
- // name: '分类2',
- // type: 'bar',
- // stack: '1',
- // itemStyle: {
- // normal: {
- // color: '#1EA58F'
- // }
- // },
- // data: [20, 12, 31, 23, 56, 78, 92, 12, 23, 14, 23, 54]
- // }, {
- // name: '分类3',
- // type: 'bar',
- // stack: '1',
- // itemStyle: {
- // normal: {
- // color: '#87C966'
- // }
- // },
- // data: [20, 12, 31, 23, 56, 78, 92, 12, 23, 14, 23, 54]
- // }, {
- // name: '分类4',
- // type: 'bar',
- // stack: '1',
- // itemStyle: {
- // normal: {
- // color: '#FFA35E'
- // }
- // },
- // data: [20, 12, 31, 23, 56, 78, 92, 12, 23, 14, 23, 54]
- // }, {
- // name: '分类5',
- // type: 'bar',
- // stack: '1',
- // itemStyle: {
- // normal: {
- // color: '#EF665C'
- // }
- // },
- // data: [12, 30, 15, 23, 32, 64, 17, 26, 87, 17, 63, 26]
- // }, ]
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- // console.log(echarts)
- }
- //图表 事件来源统计饼图
- function barechart13(datas) {
- // console.log(datas)
- // console.log(echarts)
- var dom = document.getElementById("sjlyqs");
- // console.log(dom)
- var option = null;
- var myChart = echarts.init(dom);
- var Data_LYTJ = [];
- var Total = 0;
- if (datas && datas.length > 0) {
- for (var j = 0; j < datas.length; j++) {
- console.log(datas[j]);
- var data = {
- name: datas[j]._name,
- value: datas[j].percentage,
- };
- Total = Total += datas[j]._count;
- Data_LYTJ.push(data);
- }
- console.log(Total);
- option = {
- color: [
- "#005395",
- "#1EA58F",
- "#87C966",
- "#FFCD61",
- "#585247",
- "#49A9EE",
- "#009D85",
- "rgba(250,250,250,0.3)",
- ],
- // backgroundColor: '#000',
- title: {
- text: "事件总数 (件)",
- subtext: Total,
- textAlign: "center",
- textStyle: {
- color: "#333",
- fontSize: 20,
- // align: 'center'
- },
- subtextStyle: {
- fontSize: 18,
- color: ["#005395"],
- fontWeight: "bolder",
- // align: 'center'
- },
- x: "25%",
- y: "40%",
- },
- grid: {
- top: "0%",
- bottom: 150,
- left: 100,
- right: "10%",
- },
- legend: {
- orient: "vertical",
- top: "middle",
- left: "55%",
- itemGap: 20,
- textStyle: {
- color: "#333",
- fontSize: 16,
- },
- itemWidth: 15,
- itemHeight: 15,
- icon: "roundRect",
- data: Data_LYTJ,
- },
- series: [
- // 主要展示层的
- {
- radius: ["62%", "85%"],
- center: ["25%", "50%"],
- type: "pie",
- label: {
- normal: {
- show: true,
- formatter: "{c}%",
- textStyle: {
- fontSize: 14,
- },
- position: "outside",
- },
- emphasis: {
- show: true,
- },
- },
- labelLine: {
- normal: {
- show: true,
- length: 10,
- length2: 35,
- fontSize: 16,
- },
- emphasis: {
- show: true,
- },
- },
- name: "民警训练总量",
- data: Data_LYTJ,
- },
- ],
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- }
- //图表 事件来源趋势图
- function barechart14(datas) {
- console.log(datas);
- var Series = [];
- var legend = {
- data: [],
- align: "left",
- // itemWidth:10,
- // itemHeight:10,
- bottom: 0,
- };
- if (datas && datas.length > 0) {
- for (var j = 0; j < datas[1].length; j++) {
- var data = {
- name: datas[0][j],
- type: "line",
- itemStyle: {
- normal: {
- // color: '#49A9EE'
- },
- },
- lineStyle: {
- normal: {
- // color: '#49A9EE'
- },
- },
- data: datas[1][j][1],
- };
- legend.data.push(datas[0][j]);
- Series.push(data);
- // for (var key in datas[1][j]) {
- // var data = {
- // name: key,
- // type: "line",
- // itemStyle: {
- // normal: {
- // // color: '#49A9EE'
- // },
- // },
- // lineStyle: {
- // normal: {
- // // color: '#49A9EE'
- // },
- // },
- // data: datas[1][j][key],
- // };
- // legend.data.push(key);
- // Series.push(data);
- // }
- }
- console.log(echarts);
- var dom = document.getElementById("sjlytj");
- console.log(dom);
- var myChart = echarts.init(dom);
- var option = null;
- console.log(myChart);
- myChart.showLoading({
- text: "数据加载中...",
- color: "#c23531",
- textColor: "#fff",
- maskColor: "rgba(255,255,255,0)",
- zlevel: 0,
- });
- myChart.hideLoading();
- option = {
- color: [
- "#005395",
- "#1EA58F",
- "#87C966",
- "#FFCD61",
- "#585247",
- "#49A9EE",
- "#009D85",
- "rgba(250,250,250,0.3)",
- ],
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- // type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- lineStyle: {
- color: "#49A9EE",
- type: "dotted",
- },
- },
- },
- legend: legend,
- grid: {
- left: "2%",
- right: "0%",
- bottom: "15%",
- top: "10%",
- containLabel: true,
- },
- xAxis: [
- {
- type: "category",
- // axisTick: {
- // alignWithLabel: true
- // },
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- data: datas[1][0][0],
- },
- ],
- yAxis: [
- {
- type: "value",
- scale: true,
- name: "事件数量 (件)",
- min: 0,
- boundaryGap: [0.2, 0.2],
- // axisLabel: {
- // formatter: '{value}'
- // }
- axisLabel: {
- textStyle: {
- color: "#7B7B7B",
- // fontSize: '14',
- },
- },
- axisLine: {
- show: true,
- lineStyle: {
- color: "#7B7B7B",
- // type: 'dotted'
- },
- },
- },
- ],
- series: Series,
- // [{
- // name: '分类1',
- // type: 'line',
- // itemStyle: {
- // normal: {
- // color: '#49A9EE'
- // }
- // },
- // lineStyle: {
- // normal: {
- // color: '#49A9EE'
- // }
- // },
- // data: [10, 20, 5, 43, 12, 34, 12, 56, 67]
- // }, {
- // name: '分类2',
- // type: 'line',
- // itemStyle: {
- // normal: {
- // color: '#87C966'
- // }
- // },
- // lineStyle: {
- // normal: {
- // color: '#87C966'
- // }
- // },
- // data: [12, 10, 15, 23, 19, 24, 18, 26, 57]
- // }]
- };
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- myChart.hideLoading();
- }
- }
- }
- // 初始化
- $scope.init = function(branchId, duty){
- $scope.SLQS_Data($scope.searchkeys);
- $scope.FLQS_Data1($scope.searchkeys);
- branchId && $scope.getAreas(branchId);
- duty && $scope.getIncidentCategory(duty.id);
- duty && $scope.getGroups(duty);
- }
- },
- ]);
|