Sin descripción

index.js 57KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094
  1. /*
  2. 一级大屏
  3. */
  4. var img = './image/frame.png';
  5. var numscroll = [];
  6. var numscroll1 = [];
  7. var trafficState = 0
  8. var trafficData = [];
  9. var sourceCountId = [],
  10. seatData = [],
  11. timeState = 1,
  12. telCountByNowType = 0,
  13. hotlineDataType = 0,
  14. MajoreventsDataType = 0,
  15. keyCountDataType = 0,
  16. typeCountDataType = 0
  17. //关闭按钮
  18. $('.close_icon').click(function() {
  19. console.log(11)
  20. $('.bulletFrame').hide();
  21. $('.bulletFrameT').hide();
  22. if($('.bulletFrame').css('display') == 'none') {
  23. $('.body').css('opacity', '1')
  24. }
  25. if($('.bulletFrameT').css('display') == 'none') {
  26. $('.body').css('opacity', '1')
  27. }
  28. })
  29. //关闭按钮退回工单列表
  30. $('.backProcedure').click(function() {
  31. $('.workDetails').show();
  32. $('.workDetails').siblings().hide()
  33. })
  34. //返回按钮
  35. $('.back_icon').click(function() {
  36. $('.bulletFrameT').hide();
  37. if($('.bulletFrameT').css('display') == 'none') {
  38. $('.body').css('opacity', '1')
  39. }
  40. })
  41. //中间地图关闭按钮
  42. $('.closeMap_icon').click(function() {
  43. $('.bulletFrame').hide();
  44. $('.bulletFrameT').hide();
  45. if($('.bulletFrame').css('display') == 'none') {
  46. $('.body').css('opacity', '1')
  47. }
  48. if($('.bulletFrameT').css('display') == 'none') {
  49. $('.body').css('opacity', '1')
  50. }
  51. $('.type').css({
  52. 'background': 'url(./image/second/btn1.png)'
  53. })
  54. $('.classify').css({
  55. 'background': 'url(./image/second/btn2.png)'
  56. })
  57. $('.secondLevel_map .regionMap').html('');
  58. })
  59. $("#keyword").mouseleave(function() {
  60. $('.keyWrap').css('display', 'none')
  61. });
  62. $("#hotline3").mouseleave(function() {
  63. $('.lineB').css('display', 'none')
  64. });
  65. function getHotlineAccept() {
  66. new doAjax({
  67. url: huayi.config.callcenter_url + "/InfoNew/GetSourceCountBy",
  68. data: {
  69. token: $.cookie("token"),
  70. },
  71. callBack: function(res) {
  72. if(res.state === "notoken") {
  73. window.location.href = "login.html";
  74. }
  75. let str = ''
  76. Object.keys(res[0]).forEach((key, n) => {
  77. if(n == 0) {
  78. if($('#slw_num').text() != parseInt(res[0][key] % 100000 / 10000)) {
  79. $('#slw_num').text(parseInt(res[0][key] % 100000 / 10000))
  80. $('#slw_num').counterUp({
  81. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  82. time: 500 //计数动画总的持续时间。
  83. });
  84. }
  85. if($('#slq_num').text() != parseInt(res[0][key] % 10000 / 1000)) {
  86. $('#slq_num').text(parseInt(res[0][key] % 10000 / 1000))
  87. $('#slq_num').counterUp({
  88. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  89. time: 500 //计数动画总的持续时间。
  90. });
  91. }
  92. if($('#slb_num').text() != parseInt(res[0][key] % 1000 / 100)) {
  93. $('#slb_num').text(parseInt(res[0][key] % 1000 / 100))
  94. $('#slb_num').counterUp({
  95. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  96. time: 500 //计数动画总的持续时间。
  97. });
  98. }
  99. if($('#sls_num').text() != parseInt((res[0][key] % 100) / 10)) {
  100. $('#sls_num').text(parseInt((res[0][key] % 100) / 10))
  101. $('#sls_num').counterUp({
  102. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  103. time: 500 //计数动画总的持续时间。
  104. });
  105. }
  106. if($('#slg_num').text() != parseInt(res[0][key] % 10)) {
  107. $('#slg_num').text(parseInt(res[0][key] % 10))
  108. $('#slg_num').counterUp({
  109. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  110. time: 500 //计数动画总的持续时间。
  111. });
  112. }
  113. } else if(n == 3) {
  114. if($('#dxw_num').text() != parseInt(res[0][key] % 100000 / 10000)) {
  115. $('#dxw_num').text(parseInt(res[0][key] % 100000 / 10000))
  116. $('#dxw_num').counterUp({
  117. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  118. time: 500 //计数动画总的持续时间。
  119. });
  120. }
  121. if($('#dxq_num').text() != parseInt(res[0][key] % 10000 / 1000)) {
  122. $('#dxq_num').text(parseInt(res[0][key] % 10000 / 1000))
  123. $('#dxq_num').counterUp({
  124. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  125. time: 500 //计数动画总的持续时间。
  126. });
  127. }
  128. if($('#dxb_num').text() != parseInt(res[0][key] % 1000 / 100)) {
  129. $('#dxb_num').text(parseInt(res[0][key] % 1000 / 100))
  130. $('#dxb_num').counterUp({
  131. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  132. time: 500 //计数动画总的持续时间。
  133. });
  134. }
  135. if($('#dxs_num').text() != parseInt((res[0][key] % 100) / 10)) {
  136. $('#dxs_num').text(parseInt((res[0][key] % 100) / 10))
  137. $('#dxs_num').counterUp({
  138. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  139. time: 500 //计数动画总的持续时间。
  140. });
  141. }
  142. if($('#dxg_num').text() != parseInt(res[0][key] % 10)) {
  143. $('#dxg_num').text(parseInt(res[0][key] % 10))
  144. $('#dxg_num').counterUp({
  145. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  146. time: 500 //计数动画总的持续时间。
  147. });
  148. }
  149. } else if(n == 1) {
  150. if($('#szw_num').text() != parseInt(res[0][key] % 100000 / 10000)) {
  151. $('#szw_num').text(parseInt(res[0][key] % 100000 / 10000))
  152. $('#szw_num').counterUp({
  153. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  154. time: 500 //计数动画总的持续时间。
  155. });
  156. }
  157. if($('#szq_num').text() != parseInt(res[0][key] % 10000 / 1000)) {
  158. $('#szq_num').text(parseInt(res[0][key] % 10000 / 1000))
  159. $('#szq_num').counterUp({
  160. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  161. time: 500 //计数动画总的持续时间。
  162. });
  163. }
  164. if($('#szb_num').text() != parseInt(res[0][key] % 1000 / 100)) {
  165. $('#szb_num').text(parseInt(res[0][key] % 1000 / 100))
  166. $('#szb_num').counterUp({
  167. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  168. time: 500 //计数动画总的持续时间。
  169. });
  170. }
  171. if($('#szs_num').text() != parseInt((res[0][key] % 100) / 10)) {
  172. $('#szs_num').text(parseInt((res[0][key] % 100) / 10))
  173. $('#szs_num').counterUp({
  174. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  175. time: 500 //计数动画总的持续时间。
  176. });
  177. }
  178. if($('#szg_num').text() != parseInt(res[0][key] % 10)) {
  179. $('#szg_num').text(parseInt(res[0][key] % 10))
  180. $('#szg_num').counterUp({
  181. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  182. time: 500 //计数动画总的持续时间。
  183. });
  184. }
  185. } else if(n == 5) {
  186. if($('#wxw_num').text() != parseInt(res[0][key] % 100000 / 10000)) {
  187. $('#wxw_num').text(parseInt(res[0][key] % 100000 / 10000))
  188. $('#wxw_num').counterUp({
  189. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  190. time: 500 //计数动画总的持续时间。
  191. });
  192. }
  193. if($('#wxq_num').text() != parseInt(res[0][key] % 10000 / 1000)) {
  194. $('#wxq_num').text(parseInt(res[0][key] % 10000 / 1000))
  195. $('#wxq_num').counterUp({
  196. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  197. time: 500 //计数动画总的持续时间。
  198. });
  199. }
  200. if($('#wxb_num').text() != parseInt(res[0][key] % 1000 / 100)) {
  201. $('#wxb_num').text(parseInt(res[0][key] % 1000 / 100))
  202. $('#wxb_num').counterUp({
  203. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  204. time: 500 //计数动画总的持续时间。
  205. });
  206. }
  207. if($('#wxs_num').text() != parseInt((res[0][key] % 100) / 10)) {
  208. $('#wxs_num').text(parseInt((res[0][key] % 100) / 10))
  209. $('#wxs_num').counterUp({
  210. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  211. time: 500 //计数动画总的持续时间。
  212. });
  213. }
  214. if($('#wxg_num').text() != parseInt(res[0][key] % 10)) {
  215. $('#wxg_num').text(parseInt(res[0][key] % 10))
  216. $('#wxg_num').counterUp({
  217. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  218. time: 500 //计数动画总的持续时间。
  219. });
  220. }
  221. } else if(n == 2) {
  222. if($('#xxw_num').text() != parseInt(res[0][key] % 100000 / 10000)) {
  223. $('#xxw_num').text(parseInt(res[0][key] % 100000 / 10000))
  224. $('#xxw_num').counterUp({
  225. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  226. time: 500 //计数动画总的持续时间。
  227. });
  228. }
  229. if($('#xxq_num').text() != parseInt(res[0][key] % 10000 / 1000)) {
  230. $('#xxq_num').text(parseInt(res[0][key] % 10000 / 1000))
  231. $('#xxq_num').counterUp({
  232. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  233. time: 500 //计数动画总的持续时间。
  234. });
  235. }
  236. if($('#xxb_num').text() != parseInt(res[0][key] % 1000 / 100)) {
  237. $('#xxb_num').text(parseInt(res[0][key] % 1000 / 100))
  238. $('#xxb_num').counterUp({
  239. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  240. time: 500 //计数动画总的持续时间。
  241. });
  242. }
  243. if($('#xxs_num').text() != parseInt((res[0][key] % 100) / 10)) {
  244. $('#xxs_num').text(parseInt((res[0][key] % 100) / 10))
  245. $('#xxs_num').counterUp({
  246. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  247. time: 500 //计数动画总的持续时间。
  248. });
  249. }
  250. if($('#xxg_num').text() != parseInt(res[0][key] % 10)) {
  251. $('#xxg_num').text(parseInt(res[0][key] % 10))
  252. $('#xxg_num').counterUp({
  253. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  254. time: 500 //计数动画总的持续时间。
  255. });
  256. }
  257. } else if(n == 4) {
  258. if($('#zww_num').text() != parseInt(res[0][key] % 100000 / 10000)) {
  259. $('#zww_num').text(parseInt(res[0][key] % 100000 / 10000))
  260. $('#zww_num').counterUp({
  261. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  262. time: 500 //计数动画总的持续时间。
  263. });
  264. }
  265. if($('#zwq_num').text() != parseInt(res[0][key] % 10000 / 1000)) {
  266. $('#zwq_num').text(parseInt(res[0][key] % 10000 / 1000))
  267. $('#zwq_num').counterUp({
  268. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  269. time: 500 //计数动画总的持续时间。
  270. });
  271. }
  272. if($('#zwb_num').text() != parseInt(res[0][key] % 1000 / 100)) {
  273. $('#zwb_num').text(parseInt(res[0][key] % 1000 / 100))
  274. $('#zwb_num').counterUp({
  275. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  276. time: 500 //计数动画总的持续时间。
  277. });
  278. }
  279. if($('#zws_num').text() != parseInt((res[0][key] % 100) / 10)) {
  280. $('#zws_num').text(parseInt((res[0][key] % 100) / 10))
  281. $('#zws_num').counterUp({
  282. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  283. time: 500 //计数动画总的持续时间。
  284. });
  285. }
  286. if($('#zwg_num').text() != parseInt(res[0][key] % 10)) {
  287. $('#zwg_num').text(parseInt(res[0][key] % 10))
  288. $('#zwg_num').counterUp({
  289. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  290. time: 500 //计数动画总的持续时间。
  291. });
  292. }
  293. }
  294. })
  295. },
  296. })
  297. new doAjax({
  298. url: huayi.config.callcenter_url + "/InfoNew/GetVisitCount",
  299. data: {
  300. token: $.cookie("token"),
  301. },
  302. callBack: function(res) {
  303. if(res.state === "notoken") {
  304. window.location.href = "login.html";
  305. }
  306. let visitCount = [];
  307. let str = ''
  308. Object.keys(res[0]).forEach((key, n) => {
  309. if(key == 'DHCOUNT') {
  310. visitCount.push({
  311. name: '电话回访',
  312. value: res[0][key]
  313. })
  314. } else if(key == 'DXCOUNT') {
  315. visitCount.push({
  316. name: '短信回访',
  317. value: res[0][key]
  318. })
  319. } else {
  320. visitCount.unshift({
  321. name: '回访总数',
  322. value: res[0][key]
  323. })
  324. }
  325. })
  326. visitCount.forEach(function(v, n) {
  327. if(n == 0) {
  328. if(parseInt(v.value % 100000 / 10000) != $('#zsw_num').text()) {
  329. $('#zsw_num').text(parseInt(v.value % 100000 / 10000))
  330. $('#zsw_num').counterUp({
  331. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  332. time: 500 //计数动画总的持续时间。
  333. });
  334. }
  335. if(parseInt(v.value % 10000 / 1000) != $('#zsq_num').text()) {
  336. $('#zsq_num').text(parseInt(v.value % 10000 / 1000))
  337. $('#zsq_num').counterUp({
  338. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  339. time: 500 //计数动画总的持续时间。
  340. });
  341. }
  342. if(parseInt(v.value % 1000 / 100) != $('#zsb_num').text()) {
  343. $('#zsb_num').text(parseInt(v.value % 1000 / 100))
  344. $('#zsb_num').counterUp({
  345. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  346. time: 500 //计数动画总的持续时间。
  347. });
  348. }
  349. if(parseInt((v.value % 100) / 10) != $('#zss_num').text()) {
  350. $('#zss_num').text(parseInt((v.value % 100) / 10))
  351. $('#zss_num').counterUp({
  352. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  353. time: 500 //计数动画总的持续时间。
  354. });
  355. }
  356. if(parseInt(v.value % 10) != $('#zsg_num').text()) {
  357. $('#zsg_num').text(parseInt(v.value % 10))
  358. $('#zsg_num').counterUp({
  359. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  360. time: 500 //计数动画总的持续时间。
  361. });
  362. }
  363. } else if(n == 1) {
  364. if(parseInt(v.value % 100000 / 10000) != $('#hfw_num').text()) {
  365. $('#hfw_num').text(parseInt(v.value % 100000 / 10000))
  366. $('#hfw_num').counterUp({
  367. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  368. time: 500 //计数动画总的持续时间。
  369. });
  370. }
  371. if(parseInt(v.value % 10000 / 1000) != $('#hfq_num').text()) {
  372. $('#hfq_num').text(parseInt(v.value % 10000 / 1000))
  373. $('#hfq_num').counterUp({
  374. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  375. time: 500 //计数动画总的持续时间。
  376. });
  377. }
  378. if(parseInt(v.value % 1000 / 100) != $('#hfb_num').text()) {
  379. $('#hfb_num').text(parseInt(v.value % 1000 / 100))
  380. $('#hfb_num').counterUp({
  381. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  382. time: 500 //计数动画总的持续时间。
  383. });
  384. }
  385. if(parseInt((v.value % 100) / 10) != $('#hfs_num').text()) {
  386. $('#hfs_num').text(parseInt((v.value % 100) / 10))
  387. $('#hfs_num').counterUp({
  388. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  389. time: 500 //计数动画总的持续时间。
  390. });
  391. }
  392. if(parseInt(v.value % 10) != $('#hfg_num').text()) {
  393. $('#hfg_num').text(parseInt(v.value % 10))
  394. $('#hfg_num').counterUp({
  395. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  396. time: 500 //计数动画总的持续时间。
  397. });
  398. }
  399. } else if(n == 2) {
  400. if(parseInt(v.value % 100000 / 10000) != $('#dhw_num').text()) {
  401. $('#dhw_num').text(parseInt(v.value % 100000 / 10000))
  402. $('#dhw_num').counterUp({
  403. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  404. time: 500 //计数动画总的持续时间。
  405. });
  406. }
  407. if(parseInt(v.value % 10000 / 1000) != $('#dhq_num').text()) {
  408. $('#dhq_num').text(parseInt(v.value % 10000 / 1000))
  409. $('#dhq_num').counterUp({
  410. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  411. time: 500 //计数动画总的持续时间。
  412. });
  413. }
  414. if(parseInt(v.value % 1000 / 100) != $('#dhb_num').text()) {
  415. $('#dhb_num').text(parseInt(v.value % 1000 / 100))
  416. $('#dhb_num').counterUp({
  417. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  418. time: 500 //计数动画总的持续时间。
  419. });
  420. }
  421. if(parseInt((v.value % 100) / 10) != $('#dhs_num').text()) {
  422. $('#dhs_num').text(parseInt((v.value % 100) / 10))
  423. $('#dhs_num').counterUp({
  424. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  425. time: 500 //计数动画总的持续时间。
  426. });
  427. }
  428. if(parseInt(v.value % 10) != $('#dhg_num').text()) {
  429. $('#dhg_num').text(parseInt(v.value % 10))
  430. $('#dhg_num').counterUp({
  431. delay: 50, //每个数字动画的延迟时间,单位毫秒。
  432. time: 500 //计数动画总的持续时间。
  433. });
  434. }
  435. }
  436. })
  437. }
  438. });
  439. }
  440. function getHotThings() {
  441. var nameData = [];
  442. var conNum = [];
  443. var maxNum = []
  444. var secData = [];
  445. new doAjax({
  446. url: huayi.config.callcenter_url + "/InfoNew/Majorevents",
  447. Type: 'get',
  448. data: {
  449. token: $.cookie("token"),
  450. stime: '',
  451. etime: '',
  452. timetype: MajoreventsDataType
  453. },
  454. callBack: function(res) {
  455. if(res.state === "notoken") {
  456. window.location.href = "login.html";
  457. }
  458. res.forEach(function(v, n) {
  459. // if(v.name!='中毒'&&v.name!='地震'){ str.replace(/[0-9]+/g,"")
  460. nameData.push(v.name.replace(/[0-9]+/g, ""));
  461. conNum.push(v.count)
  462. secData.push({
  463. level: v.name,
  464. landArea: v.count
  465. })
  466. // }
  467. })
  468. for(var i = 0; i < secData.length; i++) {
  469. maxNum.push(Math.max.apply(null, conNum) + 200);
  470. }
  471. hotThingsChart('hotThings', nameData, conNum, maxNum, -30)
  472. }
  473. });
  474. }
  475. function gettraffic() {
  476. $('.btn_time').click(function(e) {
  477. if(!e.isPropagationStopped()) { //确定stopPropagation是否被调用过
  478. if(e.target.tagName == 'SPAN') {
  479. if($(e.target).attr('data-state') == '0') {
  480. $(".hwsjtj").show()
  481. $('.timeTraffic').css('display', 'none')
  482. $('.daySeat').css('display', 'inline-block')
  483. $('#traffic').css('display', 'block')
  484. $('#timeTraffic').css('display', 'none')
  485. $('.call_situation h2').text('话务数据统计')
  486. $(this).siblings(".act").children("label").attr("indexTitle", "话务数据统计2")
  487. new doAjax({
  488. url: huayi.config.callcenter_url + "InfoNew/GetHWCount24ByNow",
  489. data: {
  490. token: $.cookie("token"),
  491. },
  492. callBack: function(res) {
  493. if(res.state === "notoken") {
  494. window.location.href = "login.html";
  495. }
  496. trafficChart(res.data.hours, res.data.hwcount[0], res.data.jtcount[0])
  497. }
  498. });
  499. }
  500. }
  501. }
  502. e.stopPropagation();
  503. })
  504. }
  505. function getHotline() {
  506. let arr = [];
  507. let newArr = []
  508. new doAjax({
  509. url: huayi.config.callcenter_url + "/InfoNew/GetHotline",
  510. data: {
  511. token: $.cookie("token"),
  512. timetype: hotlineDataType
  513. },
  514. callBack: function(res) {
  515. if(res.state === "notoken") {
  516. window.location.href = "login.html";
  517. }
  518. let str = '';
  519. res.data.forEach(function(v, n) {
  520. // arr.push(v.count)
  521. arr.push({
  522. name: v.value,
  523. count: v.count
  524. })
  525. })
  526. function compare(a, b) {
  527. return a.count - b.count; //如果a>b,返回值大于0,交换a b,升序排列
  528. }
  529. newArr = arr.sort(compare);
  530. newArr.reverse()
  531. res.data.forEach(function(val, num) {
  532. arr.forEach(function(v, n) {
  533. if(n === 0 && v.name === val.value) {
  534. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  535. } else if(n === 1 && v.name === val.value) {
  536. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  537. } else if(n === 2 && v.name === val.value) {
  538. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  539. } else if(n === 3 && v.name === val.value) {
  540. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  541. } else if(n === 4 && v.name === val.value) {
  542. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  543. } else if(n === 5 && v.name === val.value) {
  544. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  545. } else if(n === 6 && v.name === val.value) {
  546. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  547. } else if(n === 7 && v.name === val.value) {
  548. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  549. } else if(n === 8 && v.name === val.value) {
  550. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  551. } else if(n === 9 && v.name === val.value) {
  552. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  553. } else if(n === 10 && v.name === val.value) {
  554. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  555. } else if(n === 11 && v.name === val.value) {
  556. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  557. } else if(n === 12 && v.name === val.value) {
  558. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  559. } else if(n === 13 && v.name === val.value) {
  560. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  561. } else if(n === 14 && v.name === val.value) {
  562. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  563. } else if(n === 15 && v.name === val.value) {
  564. str += '<li onmouseover="getHotLineInfo(\'' + val.name + '\',\'' + val.bili + '\',\'' + n + '\')" style="background-image: url(./image/line/line' + n + '.png);"><div class="number">' + val.count + '</div><div class="hotCall">' + val.value + '</div></li>'
  565. }
  566. })
  567. })
  568. $('.hotline').html(str)
  569. }
  570. });
  571. }
  572. function getHotLineInfo(strName, bili, n) {
  573. $('.lineB').text(strName + ':' + bili);
  574. if(n == 8) {
  575. $('.lineB').css({
  576. 'display': 'block',
  577. 'top': '60px',
  578. 'left': '-24px'
  579. })
  580. } else if(n == 11) {
  581. $('.lineB').css({
  582. 'display': 'block',
  583. 'top': '-24px',
  584. 'left': '305px'
  585. })
  586. } else if(n == 4) {
  587. $('.lineB').css({
  588. 'display': 'block',
  589. 'top': '60px',
  590. 'left': '380px'
  591. })
  592. } else if(n == 10) {
  593. $('.lineB').css({
  594. 'display': 'block',
  595. 'top': '-24px',
  596. 'left': '380px'
  597. })
  598. } else if(n == 5) {
  599. $('.lineB').css({
  600. 'display': 'block',
  601. 'top': '144px',
  602. 'left': '60px'
  603. })
  604. } else if(n == 3) {
  605. $('.lineB').css({
  606. 'display': 'block',
  607. 'top': '57px',
  608. 'left': '306px'
  609. })
  610. } else if(n == 0) {
  611. $('.lineB').css({
  612. 'display': 'block',
  613. 'top': '57px',
  614. 'left': '146px'
  615. })
  616. } else if(n == 2) {
  617. $('.lineB').css({
  618. 'display': 'block',
  619. 'top': '60px',
  620. 'left': '60px'
  621. })
  622. } else if(n == 1) {
  623. $('.lineB').css({
  624. 'display': 'block',
  625. 'top': '57px',
  626. 'left': '226px'
  627. })
  628. } else if(n == 7) {
  629. $('.lineB').css({
  630. 'display': 'block',
  631. 'top': '144px',
  632. 'left': '225px'
  633. })
  634. } else if(n == 12) {
  635. $('.lineB').css({
  636. 'display': 'block',
  637. 'top': '-24px',
  638. 'left': '225px'
  639. })
  640. } else if(n == 6) {
  641. $('.lineB').css({
  642. 'display': 'block',
  643. 'top': '144px',
  644. 'left': '-24px'
  645. })
  646. } else if(n == 9) {
  647. $('.lineB').css({
  648. 'display': 'block',
  649. 'top': '144px',
  650. 'left': '140px'
  651. })
  652. } else if(n == 13) {
  653. $('.lineB').css({
  654. 'display': 'block',
  655. 'top': '-24px',
  656. 'left': '140px'
  657. })
  658. } else if(n == 15) {
  659. $('.lineB').css({
  660. 'display': 'block',
  661. 'top': '-24px',
  662. 'left': '-25px'
  663. })
  664. } else if(n == 14) {
  665. $('.lineB').css({
  666. 'display': 'block',
  667. 'top': '-24px',
  668. 'left': '60px'
  669. })
  670. }
  671. }
  672. function getKeyWord() {
  673. new doAjax({
  674. url: huayi.config.callcenter_url + "/InfoNew/GetKeyCountByNow",
  675. // url: "http://192.168.8.9:1042/InfoNew/GetKeyCountByNow",
  676. data: {
  677. token: $.cookie("token"),
  678. timetype: keyCountDataType
  679. },
  680. callBack: function(res) {
  681. if(res.state === "notoken") {
  682. window.location.href = "login.html";
  683. }
  684. let str = '';
  685. let keyName;
  686. res.data.Date.forEach(function(v, n) {
  687. keyName = v.KeyName.substr(0, v.KeyName.length - 2)
  688. str += '<span onclick="getKeyClass(\'' + v.KeyId + '\',\'' + v.ClassCount + '\',\'' + v.KeyName + '\')" onmouseover="getKeyInfo(\'' + v.KeyId + '\',\'' + n + '\')">' +
  689. keyName + ':<label>' + v.Count + '</label></span>'
  690. })
  691. $('#keyword').html(str);
  692. }
  693. });
  694. }
  695. function getworkOrderType() {
  696. let workOrderData = [];
  697. let workOrderName = []
  698. new doAjax({
  699. url: huayi.config.callcenter_url + "/InfoNew/GetTypeCount",
  700. data: {
  701. token: $.cookie("token"),
  702. timetype: typeCountDataType
  703. },
  704. callBack: function(res) {
  705. if(res.state === "notoken") {
  706. window.location.href = "login.html";
  707. }
  708. res.data.forEach(function(v, n) {
  709. workOrderData.push({
  710. name: v.type,
  711. value: v.count
  712. })
  713. workOrderName.push(v.type);
  714. })
  715. workOrderName.reverse();
  716. workOrderChart(workOrderData, workOrderName)
  717. }
  718. });
  719. }
  720. function hotThingsChart(dom, data, count, count1, rotate = 0) {
  721. let hotThings = echarts.init(document.getElementById(dom));
  722. window.onresize = function() {
  723. hotThings.resize()
  724. }
  725. option = {
  726. textStyle: {
  727. color: "#c0c3cd",
  728. fontSize: 11
  729. },
  730. grid: {
  731. top: '25%',
  732. bottom: '30%'
  733. },
  734. xAxis: {
  735. nameTextStyle: {
  736. color: "#c0c3cd",
  737. padding: [0, 0, -10, 0],
  738. fontSize: 11
  739. },
  740. axisLabel: {
  741. color: "#c0c3cd",
  742. fontSize: 11,
  743. rotate: rotate,
  744. },
  745. axisTick: {
  746. lineStyle: {
  747. color: "#8398c4",
  748. width: 1
  749. },
  750. show: false
  751. },
  752. minorTick: {
  753. length: 8
  754. },
  755. splitLine: {
  756. show: false
  757. },
  758. axisLine: {
  759. lineStyle: {
  760. color: "#8398c4",
  761. width: 1,
  762. type: "solid"
  763. },
  764. show: true
  765. },
  766. data: data,
  767. type: "category"
  768. },
  769. yAxis: {
  770. nameTextStyle: {
  771. color: "#c0c3cd",
  772. padding: [0, 0, 10, -5],
  773. fontSize: 11
  774. },
  775. axisLabel: {
  776. color: "#c0c3cd",
  777. fontSize: 11
  778. },
  779. axisTick: {
  780. lineStyle: {
  781. color: "#8398c4",
  782. width: 1
  783. },
  784. show: true
  785. },
  786. splitLine: {
  787. show: true,
  788. lineStyle: {
  789. color: "#8398c4",
  790. type: "dashed"
  791. }
  792. },
  793. axisLine: {
  794. lineStyle: {
  795. color: "#8398c4",
  796. width: 1,
  797. type: "solid"
  798. },
  799. show: true,
  800. // "symbol":['none', 'arrow'],
  801. symbol: ['none', 'path://M5, 20 L5, 5 L8, 8 L5, 2 L2, 8 L5, 5 L5.3, 6 L5.3, 20'],
  802. symbolOffset: 5,
  803. symbolSize: [35, 38],
  804. },
  805. name: "条"
  806. },
  807. series: [{
  808. data: count,
  809. type: "bar",
  810. barMaxWidth: "auto",
  811. barWidth: 15,
  812. itemStyle: {
  813. color: {
  814. x: 0,
  815. y: 0,
  816. x2: 0,
  817. y2: 1,
  818. type: "linear",
  819. global: false,
  820. colorStops: [{
  821. offset: 0,
  822. color: "#ff4519"
  823. }, {
  824. offset: 1,
  825. color: "#fff500"
  826. }]
  827. },
  828. barBorderRadius: [30, 30, 0, 0]
  829. },
  830. label: {
  831. show: true,
  832. position: "top",
  833. distance: 10,
  834. color: "#fff"
  835. },
  836. emphasis: {
  837. itemStyle: {
  838. color: new echarts.graphic.LinearGradient(
  839. 0, 0, 0, 1, [{
  840. offset: 0,
  841. color: '#fde301'
  842. },
  843. {
  844. offset: 1,
  845. color: '#0a2f3e'
  846. }
  847. ]
  848. )
  849. }
  850. },
  851. }, {
  852. data: [1, 1, 1, 1, 1, 1],
  853. type: "pictorialBar",
  854. barMaxWidth: "20",
  855. symbol: "none",
  856. },
  857. {
  858. // "data": [1500, 1148, 756, 1395, 1750, 1148],
  859. type: "pictorialBar",
  860. barMaxWidth: "20",
  861. symbolPosition: "end",
  862. symbol: "none",
  863. symbolOffset: [0, "-50%"],
  864. symbolSize: [30, 12],
  865. zlevel: 1
  866. },
  867. {
  868. data: count1,
  869. type: "bar",
  870. barMaxWidth: "auto",
  871. barWidth: 15,
  872. barGap: "-100%",
  873. itemStyle: {
  874. color: '#234caf'
  875. },
  876. zlevel: -1
  877. }, {
  878. data: [1, 1, 1, 1, 1, 1],
  879. type: "pictorialBar",
  880. barMaxWidth: "20",
  881. symbol: "none",
  882. symbolOffset: [0, "50%"],
  883. symbolSize: [30, 15],
  884. zlevel: -2
  885. }, {
  886. data: count1,
  887. type: "pictorialBar",
  888. barMaxWidth: "20",
  889. symbolPosition: "end",
  890. symbol: "circle",
  891. symbolOffset: [0, "-60%"],
  892. symbolSize: [15, 12],
  893. itemStyle: {
  894. color: '#234caf'
  895. },
  896. zlevel: -1
  897. },
  898. ]
  899. }
  900. hotThings.setOption(option);
  901. }
  902. function getKeyInfo(keyid, n) {
  903. $('.keyInfo').html('');
  904. new doAjax({
  905. url: huayi.config.callcenter_url + "/InfoNew/GetKeyArea",
  906. data: {
  907. token: $.cookie("token"),
  908. pid: keyid,
  909. timetype: keyCountDataType
  910. },
  911. callBack: function(res) {
  912. if(res.state === "notoken") {
  913. window.location.href = "login.html";
  914. }
  915. let str = ''
  916. res.forEach(function(v, n) {
  917. if(n > 0) {
  918. str += '<li><label>' + v.area + '</label><span>' + v.count + '</span></li>'
  919. }
  920. })
  921. $('.keyInfo').html(str);
  922. }
  923. });
  924. if(n == 0) {
  925. $('.keyWrap').css({
  926. 'display': 'block',
  927. 'top': '95px',
  928. 'left': '-80px'
  929. })
  930. $('.bar').css('margin', '0 auto')
  931. } else if(n == 1) {
  932. $('.keyWrap').css({
  933. 'display': 'block',
  934. 'top': '95px',
  935. 'left': '100px'
  936. })
  937. $('.bar').css('margin', '0 auto')
  938. } else if(n == 2) {
  939. $('.keyWrap').css({
  940. 'display': 'block',
  941. 'top': '95px',
  942. 'left': '185px'
  943. })
  944. $('.bar').css('margin', '0 0 0 250px')
  945. } else if(n == 5) {
  946. $('.keyWrap').css({
  947. 'display': 'block',
  948. 'top': '130px',
  949. 'left': '185px'
  950. })
  951. $('.bar').css('margin', '0 0 0 250px')
  952. } else if(n == 4) {
  953. $('.keyWrap').css({
  954. 'display': 'block',
  955. 'top': '130px',
  956. 'left': '100px'
  957. })
  958. $('.bar').css('margin', '0 auto')
  959. } else if(n == 3) {
  960. $('.keyWrap').css({
  961. 'display': 'block',
  962. 'top': '130px',
  963. 'left': '-80px'
  964. })
  965. $('.bar').css('margin', '0 auto')
  966. } else if(n == 6) {
  967. $('.keyWrap').css({
  968. 'display': 'block',
  969. 'top': '170px',
  970. 'left': '-80px'
  971. })
  972. $('.bar').css('margin', '0 auto')
  973. } else if(n == 7) {
  974. $('.keyWrap').css({
  975. 'display': 'block',
  976. 'top': '170px',
  977. 'left': '100px'
  978. })
  979. $('.bar').css('margin', '0,auto')
  980. } else if(n == 10) {
  981. $('.keyWrap').css({
  982. 'display': 'block',
  983. 'top': '206px',
  984. 'left': '100px'
  985. })
  986. $('.bar').css('margin', '0 auto')
  987. } else if(n == 12) {
  988. $('.keyWrap').css({
  989. 'display': 'block',
  990. 'top': '243px',
  991. 'left': '-80px'
  992. })
  993. $('.bar').css('margin', '0 auto')
  994. } else if(n == 15) {
  995. $('.keyWrap').css({
  996. 'display': 'block',
  997. 'top': '278px',
  998. 'left': '-110px'
  999. })
  1000. $('.bar').css('margin', '0 auto')
  1001. } else if(n == 8) {
  1002. $('.keyWrap').css({
  1003. 'display': 'block',
  1004. 'top': '170px',
  1005. 'left': '185px'
  1006. })
  1007. $('.bar').css('margin', '0 0 0 250px')
  1008. } else if(n == 9) {
  1009. $('.keyWrap').css({
  1010. 'display': 'block',
  1011. 'top': '206px',
  1012. 'left': '-80px'
  1013. })
  1014. $('.bar').css('margin', '0 auto')
  1015. } else if(n == 14) {
  1016. $('.keyWrap').css({
  1017. 'display': 'block',
  1018. 'top': '243px',
  1019. 'left': '185px'
  1020. })
  1021. $('.bar').css('margin', '0 0 0 250px')
  1022. } else if(n == 13) {
  1023. $('.keyWrap').css({
  1024. 'display': 'block',
  1025. 'top': '243px',
  1026. 'left': '100px'
  1027. })
  1028. $('.bar').css('margin', '0 auto')
  1029. } else if(n == 11) {
  1030. $('.keyWrap').css({
  1031. 'display': 'block',
  1032. 'top': '206px',
  1033. 'left': '185px'
  1034. })
  1035. $('.bar').css('margin', '0 0 0 250px')
  1036. } else if(n == 16) {
  1037. $('.keyWrap').css({
  1038. 'display': 'block',
  1039. 'top': '279px',
  1040. 'left': '100px'
  1041. })
  1042. $('.bar').css('margin', '0 auto')
  1043. }
  1044. }
  1045. function hotlineChart(datas) {
  1046. console.log(datas)
  1047. let hotline = echarts.init(document.getElementById('hotline'));
  1048. let colors = ['#ffe000', '#ff8a00', '#3cff9c', '#03d844', '#ff69c8', '#d668ff', '#43b2ff', '#05c9d1'];
  1049. let legendData = []
  1050. for(var j = 0; j < datas.length; j++) {
  1051. var data = {
  1052. name: datas[j].name,
  1053. icon: 'circle',
  1054. textStyle: {
  1055. fontSize: 18,
  1056. color: colors[j]
  1057. }
  1058. }
  1059. legendData.push(data)
  1060. }
  1061. let objData = array2obj(datas, 'name')
  1062. option = {
  1063. color: colors,
  1064. tooltip: {
  1065. trigger: 'item',
  1066. textStyle: {
  1067. color: '#fff',
  1068. fontSize: '18',
  1069. fontWeight: '500'
  1070. },
  1071. // itemStyle: {
  1072. // color: '#ffe400'
  1073. // },
  1074. position: 'top',
  1075. backgroundColor: 'rgba(250,250,250,0)',
  1076. transitionDuration: 0.4,
  1077. formatter: function(params) {
  1078. console.log(params.data)
  1079. console.log(params.data.name)
  1080. if(params.data.name2.length > 9) {
  1081. return '<div class="frame" style="background: url(image/hotline_pie.png) no-repeat;width:230px;height:100px;background-size: 100% 100%;text-align:center;top:20px;"><div class="frameC">' +
  1082. params.data.name2.substr(0, 10) + '<br>' + params.data.name.substr(10, params.data.name2
  1083. .length) + ':' + params.data.percent + '</div></div>';
  1084. } else {
  1085. return '<div class="frame" style="background: url(image/hotline_pie.png) no-repeat;width:220px;height:100px;background-size: 100% 100%;text-align:center;top:20px;"><div class="frameC">' +
  1086. params.data.name2 + '<br>' + params.data.percent + '</div></div>';
  1087. }
  1088. }
  1089. },
  1090. series: [{
  1091. name: '访问来源',
  1092. type: 'pie',
  1093. radius: '75%',
  1094. center: ['50%', '50%'],
  1095. label: {
  1096. show: true,
  1097. position: 'outside',
  1098. color: '#ddd',
  1099. fontSize: 16,
  1100. formatter: function(params) {
  1101. // console.log(params)
  1102. return params.name + ':' + params.value
  1103. },
  1104. padding: [0, -70, -20, -67]
  1105. },
  1106. labelLine: {
  1107. length: 13,
  1108. length2: 65,
  1109. show: true
  1110. },
  1111. data: datas,
  1112. // roseType: 'area'
  1113. // animationType: 'expansion',
  1114. // animationEasing: 'elasticOut',
  1115. // animationDelay: function(idx) {
  1116. // return 200
  1117. // }
  1118. }]
  1119. }
  1120. function array2obj(array, key) {
  1121. var resObj = {}
  1122. for(var i = 0; i < array.length; i++) {
  1123. resObj[array[i][key]] = array[i]
  1124. }
  1125. return resObj
  1126. }
  1127. hotline.setOption(option)
  1128. }
  1129. function trafficChart(hours, monthCount, dayCount) {
  1130. let traffic = echarts.init(document.getElementById('traffic'));
  1131. option = {
  1132. tooltip: {
  1133. trigger: 'axis',
  1134. axisPointer: {
  1135. show: true,
  1136. type: 'line',
  1137. lineStyle: {
  1138. type: 'dashed',
  1139. width: 2,
  1140. color: '#fff'
  1141. }
  1142. },
  1143. textStyle: {
  1144. color: '#fff',
  1145. fontSize: 15,
  1146. fontWeight: '600',
  1147. },
  1148. // position: ['75%', '55%'],
  1149. backgroundColor: 'rgba(250,250,250,0)',
  1150. formatter: function(params) {
  1151. let str = '<div style="background-image: url(image/key_frame.png);width:128px;height:90px;line-height:25px;background-size: 100% 100%;padding:7px 8px;">'
  1152. let jtcount = params[1].value / params[0].value;
  1153. if(isNaN(jtcount)) {
  1154. jtcount = 0;
  1155. str +=
  1156. '<div><span style="color:#fff;width:75px;text-align: center;display: inline-block;">接通率:</span><span style:"width:55px;text-align: center;display: inline-block;">' +
  1157. ((jtcount) * 100).toFixed(0) + '%</span></div>'
  1158. } else {
  1159. str +=
  1160. '<div><span style="color:#fff;width:75px;text-align: center;display: inline-block;">接通率:</span><span style:"width:55px;text-align: center;display: inline-block;">' +
  1161. ((jtcount) * 100).toFixed(0) + '%</span></div>'
  1162. }
  1163. params.forEach(function(v, n) {
  1164. // if(v.seriesName!='上部1'){
  1165. str +=
  1166. '<div><span style="color:#fff;width:75px;text-align: center;display: inline-block;">' +
  1167. v.seriesName +
  1168. ':</span><span style:"width:55px;text-align: center;display: inline-block;">' +
  1169. v.value + '</span></div>'
  1170. // }
  1171. })
  1172. return str;
  1173. }
  1174. },
  1175. grid: {
  1176. top: '18%',
  1177. bottom: '12%'
  1178. },
  1179. xAxis: [{
  1180. type: "category",
  1181. boundaryGap: false,
  1182. scale: true,
  1183. axisLabel: {
  1184. formatter: '{value}',
  1185. fontSize: 13,
  1186. margin: 10,
  1187. textStyle: {
  1188. color: "#f4f4f8"
  1189. }
  1190. },
  1191. axisLine: {
  1192. show: true,
  1193. lineStyle: {
  1194. color: "#525fa6"
  1195. }
  1196. },
  1197. splitLine: {
  1198. show: false,
  1199. lineStyle: {
  1200. color: "#243753"
  1201. }
  1202. },
  1203. axisTick: {
  1204. show: false
  1205. },
  1206. data: hours
  1207. }],
  1208. yAxis: [{
  1209. boundaryGap: false,
  1210. type: "value",
  1211. // scale:true,
  1212. axisLabel: {
  1213. textStyle: {
  1214. color: "#f4f4f8"
  1215. }
  1216. },
  1217. nameTextStyle: {
  1218. color: "#fff",
  1219. fontSize: 12,
  1220. lineHeight: 40
  1221. },
  1222. splitLine: {
  1223. show: true,
  1224. lineStyle: {
  1225. color: "#516cb8",
  1226. type: "dashed"
  1227. }
  1228. },
  1229. axisLine: {
  1230. lineStyle: {
  1231. color: "#8393c8",
  1232. width: 1,
  1233. type: "solid"
  1234. },
  1235. show: true,
  1236. // "symbol":['none', 'arrow'],
  1237. symbol: ['none',
  1238. 'path://M5, 20 L5, 5 L8, 8 L5, 2 L2, 8 L5, 5 L5.3, 6 L5.3, 20'
  1239. ],
  1240. symbolOffset: 5,
  1241. symbolSize: [35, 38],
  1242. },
  1243. name: "条"
  1244. }],
  1245. series: [{
  1246. name: "话务量",
  1247. type: "line",
  1248. smooth: true,
  1249. showSymbol: false,
  1250. symbol: 'circle',
  1251. symbolSize: 4,
  1252. zlevel: 3,
  1253. itemStyle: {
  1254. color: '#06eff8'
  1255. },
  1256. lineStyle: {
  1257. normal: {
  1258. width: 2,
  1259. color: "#06eff8",
  1260. }
  1261. },
  1262. // label: {
  1263. // show: true,
  1264. // position: 'top',
  1265. // color: '#fff',
  1266. // fontSize: 14,
  1267. // fontWeight: '600',
  1268. // formatter: function (params) {
  1269. // return params.seriesName + ':' + params.value
  1270. // }
  1271. // },
  1272. areaStyle: {
  1273. normal: {
  1274. color: new echarts.graphic.LinearGradient(
  1275. 0,
  1276. 0,
  1277. 0,
  1278. 1, [{
  1279. offset: 0,
  1280. color: "#35b1bb"
  1281. },
  1282. {
  1283. offset: 0.8,
  1284. color: "#073492"
  1285. }
  1286. ],
  1287. false
  1288. ),
  1289. }
  1290. },
  1291. emphasis: {
  1292. itemStyle: {
  1293. color: '#fff',
  1294. shadowBlur: 10,
  1295. shadowOffsetX: 1,
  1296. shadowOffsetY: 1,
  1297. shadowColor: 'rgb(250,250, 250)'
  1298. }
  1299. },
  1300. data: monthCount
  1301. }, {
  1302. name: "接通量",
  1303. type: "line",
  1304. smooth: true,
  1305. showSymbol: false,
  1306. symbol: 'circle',
  1307. symbolSize: 4,
  1308. zlevel: 3,
  1309. itemStyle: {
  1310. color: '#38a4fa'
  1311. },
  1312. // label: {
  1313. // show: true,
  1314. // position: 'top',
  1315. // color: '#fff',
  1316. // fontSize: 14,
  1317. // fontWeight: '600',
  1318. // formatter: function (params) {
  1319. // return params.seriesName + ':' + params.value
  1320. // }
  1321. // },
  1322. lineStyle: {
  1323. normal: {
  1324. width: 2,
  1325. color: "#38a4fa",
  1326. }
  1327. },
  1328. areaStyle: {
  1329. normal: {
  1330. color: new echarts.graphic.LinearGradient(
  1331. 0,
  1332. 0,
  1333. 0,
  1334. 1, [{
  1335. offset: 0,
  1336. color: "#1682c4"
  1337. },
  1338. {
  1339. offset: 0.8,
  1340. color: "#1276aa"
  1341. }
  1342. ],
  1343. false
  1344. ),
  1345. }
  1346. },
  1347. emphasis: {
  1348. itemStyle: {
  1349. color: '#fff',
  1350. shadowBlur: 10,
  1351. shadowOffsetX: 1,
  1352. shadowOffsetY: 1,
  1353. shadowColor: 'rgb(250,250, 250)'
  1354. }
  1355. },
  1356. data: dayCount
  1357. }]
  1358. };
  1359. traffic.setOption(option);
  1360. }
  1361. function workOrderChart(workOrderData, workOrderName) {
  1362. let workOrder = echarts.init(document.getElementById('workOrder'));
  1363. option = {
  1364. color: ['#00f0ff', '#ff5a00', '#ffe000', '#fff59e', '#00ff78', '#ff00ff', '#ff97ff'],
  1365. tooltip: {
  1366. show: false
  1367. },
  1368. legend: {
  1369. icon: "rect",
  1370. orient: 'horizontal',
  1371. width: 150,
  1372. height: 15,
  1373. itemWidth: 15,
  1374. itemGap: 20,
  1375. data: workOrderName,
  1376. right: 70,
  1377. top: 50,
  1378. align: 'left',
  1379. textStyle: {
  1380. color: "#fff"
  1381. },
  1382. // itemGap: 10
  1383. },
  1384. toolbox: {
  1385. show: false
  1386. },
  1387. polar: {
  1388. radius: '65%'
  1389. },
  1390. angleAxis: {
  1391. interval: 5,
  1392. type: 'category',
  1393. data: [],
  1394. z: 20,
  1395. axisLine: {
  1396. show: true,
  1397. lineStyle: {
  1398. color: "#0556b8",
  1399. width: 5,
  1400. type: "solid"
  1401. },
  1402. },
  1403. axisLabel: {
  1404. interval: 0,
  1405. show: true,
  1406. color: "#0556b8",
  1407. margin: 8,
  1408. fontSize: 16
  1409. },
  1410. },
  1411. radiusAxis: {
  1412. min: 20,
  1413. max: 100,
  1414. interval: 20,
  1415. axisLine: {
  1416. show: false,
  1417. lineStyle: {
  1418. color: "#0B3E5E",
  1419. width: 1,
  1420. type: "solid"
  1421. },
  1422. },
  1423. axisLabel: {
  1424. formatter: '{value} %',
  1425. show: false,
  1426. padding: [0, 0, 20, 0],
  1427. color: "#0B3E5E",
  1428. fontSize: 16
  1429. },
  1430. splitLine: {
  1431. lineStyle: {
  1432. color: "#0556b8",
  1433. width: 2,
  1434. type: "solid"
  1435. }
  1436. }
  1437. },
  1438. calculable: true,
  1439. series: [{
  1440. type: 'pie',
  1441. radius: ["0", "5%"],
  1442. hoverAnimation: false,
  1443. labelLine: {
  1444. normal: {
  1445. show: false,
  1446. length: 30,
  1447. length2: 55
  1448. },
  1449. emphasis: {
  1450. show: false
  1451. }
  1452. },
  1453. data: [{
  1454. name: '',
  1455. value: 0,
  1456. itemStyle: {
  1457. normal: {
  1458. color: "#0B4A6B"
  1459. }
  1460. }
  1461. }]
  1462. }, {
  1463. stack: 'a',
  1464. type: 'pie',
  1465. radius: '55%',
  1466. roseType: 'area',
  1467. zlevel: 10,
  1468. itemStyle: {
  1469. normal: {
  1470. label: {
  1471. show: true,
  1472. position: 'outside',
  1473. color: '#ddd',
  1474. fontSize: 15,
  1475. formatter: function(params) {
  1476. var percent = 0;
  1477. var total = 0;
  1478. for(var i = 0; i < workOrderData.length; i++) {
  1479. total += workOrderData[i].value;
  1480. }
  1481. percent = ((params.value / total) * 100).toFixed(2);
  1482. if(params.name !== '') {
  1483. return params.name + ':' + percent + '%';
  1484. } else {
  1485. return '';
  1486. }
  1487. },
  1488. },
  1489. labelLine: {
  1490. // smooth:true,
  1491. length: 15,
  1492. length2: 25,
  1493. show: true,
  1494. color: '#00ffff'
  1495. }
  1496. }
  1497. },
  1498. data: workOrderData
  1499. }]
  1500. }
  1501. workOrder.setOption(option)
  1502. }
  1503. function timeTable() {
  1504. //绩效和平均时长来回切换
  1505. $('.btn_rank').unbind("click").click(function(e) {
  1506. if(e.target.tagName == 'SPAN') {
  1507. if($(e.target).attr('data-state') == '0') {
  1508. $('.topRank_List .maquee ul').each(function(index, dom) {
  1509. //将每个 的所有子级都复制一遍
  1510. var rows = $(dom).children().clone();
  1511. //再将新的到的加入原来的
  1512. $(dom).append(rows);
  1513. });
  1514. $('.topRec_List').css('display', 'none')
  1515. $('.topRank_List').css('display', 'block')
  1516. $('.rank').css('display', 'none')
  1517. $('.timeLength').css('display', 'inline-block')
  1518. $('.responseLength').css('display', 'none')
  1519. $('.test_rank h2').text('绩效考核排名')
  1520. timeState = 1;
  1521. getRankSwitch()
  1522. e.stopPropagation()
  1523. } else if($(e.target).attr('data-state') == '1') {
  1524. timeState = 2;
  1525. $('.test_rank h2').text('平均响应时长')
  1526. $('.topRec_List .qh').text('平均响应时长')
  1527. $('.topRec_List').css('display', 'block')
  1528. $('.topRank_List').css('display', 'none')
  1529. $('.responseLength').css('display', 'inline-block')
  1530. $('.rank').css('display', 'none')
  1531. $('.timeLength').css('display', 'none')
  1532. getTimeSwitch(1)
  1533. e.stopPropagation()
  1534. } else {
  1535. //数据获取
  1536. timeState = 0;
  1537. $('.test_rank h2').text('平均办理时长')
  1538. $('.topRec_List .qh').text('平均办理时长')
  1539. $('.topRec_List').css('display', 'block')
  1540. $('.topRank_List').css('display', 'none')
  1541. $('.rank').css('display', 'inline-block')
  1542. $('.timeLength').css('display', 'none')
  1543. $('.responseLength').css('display', 'none')
  1544. getTimeSwitch(0)
  1545. e.stopPropagation()
  1546. }
  1547. }
  1548. e.stopPropagation()
  1549. })
  1550. getRankSwitch()
  1551. // getTimeSwitch(0)
  1552. function getTimeSwitch(type) {
  1553. //表格滚动
  1554. $('.topRec_List .maquee ul').each(function(index, dom) {
  1555. //将每个 的所有子级都复制一遍
  1556. var rows = $(dom).children().clone();
  1557. //再将新的到的加入原来的
  1558. $(dom).append(rows);
  1559. });
  1560. new doAjax({
  1561. url: huayi.config.callcenter_url + "/InfoNew/GetDeptDayTime",
  1562. data: {
  1563. token: $.cookie("token"),
  1564. type: type
  1565. },
  1566. callBack: function(res) {
  1567. if(res.state === "notoken") {
  1568. window.location.href = "login.html";
  1569. }
  1570. // res.reverse();
  1571. let testStr = ''
  1572. let num;
  1573. res.forEach(function(v, n) {
  1574. num = 1 + n
  1575. if(n == 0) {
  1576. testStr += '<li><div><img src="./image/No1.png" alt=""></div><div>' + v.deptname +
  1577. '</div><div>' + v.maxtime + '</div><div>' + v.mintime + '</div><div>' + v.timeday + 'h</div></li>'
  1578. } else if(n == 1) {
  1579. testStr += '<li><div><img src="./image/No2.png" alt=""></div><div>' + v.deptname +
  1580. '</div><div>' + v.maxtime + '</div><div>' + v.mintime + '</div><div>' + v.timeday + 'h</div></li>'
  1581. } else if(n == 2) {
  1582. testStr += '<li><div><img src="./image/No3.png" alt=""></div><div>' + v.deptname +
  1583. '</div><div>' + v.maxtime + '</div><div>' + v.mintime + '</div><div>' + v.timeday + 'h</div></li>'
  1584. } else {
  1585. testStr += '<li><div>' + num + '</div><div>' + v.deptname + '</div><div>' + v.maxtime + '</div><div>' + v.mintime + '</div><div>' + v
  1586. .timeday + 'h</div></li>'
  1587. }
  1588. })
  1589. $('.test_rank .topRec_List ul').html(testStr);
  1590. }
  1591. });
  1592. }
  1593. function getRankSwitch() {
  1594. new doAjax({
  1595. url: huayi.config.callcenter_url + "/InfoNew/GetDeptDeptAchievements",
  1596. data: {
  1597. token: $.cookie("token"),
  1598. },
  1599. callBack: function(data) {
  1600. if(data.state === "notoken") {
  1601. window.location.href = "login.html";
  1602. }
  1603. var max;
  1604. for(var i = 0; i < data.length; i++) {
  1605. for(var j = i; j < data.length; j++) {
  1606. if(data[i].total < data[j].total) {
  1607. max = data[j];
  1608. data[j] = data[i];
  1609. data[i] = max;
  1610. }
  1611. }
  1612. }
  1613. let rankStr = ''
  1614. let num;
  1615. data.forEach(function(v, n) {
  1616. num = 1 + n
  1617. if(n == 0) {
  1618. rankStr += '<li><div><img src="./image/No1.png" alt=""></div><div>' + v.deptname +
  1619. '</div><div>' + v.total + '</div></li>'
  1620. } else if(n == 1) {
  1621. rankStr += '<li><div><img src="./image/No2.png" alt=""></div><div>' + v.deptname +
  1622. '</div><div>' + v.total + '</div></li>'
  1623. } else if(n == 2) {
  1624. rankStr += '<li><div><img src="./image/No3.png" alt=""></div><div>' + v.deptname +
  1625. '</div><div>' + v.total + '</div></li>'
  1626. } else {
  1627. rankStr += '<li><div>' + num + '</div><div>' + v.deptname + '</div><div>' + v
  1628. .total + '</div></li>'
  1629. }
  1630. })
  1631. $('.test_rank .topRank_List ul').html(rankStr);
  1632. }
  1633. });
  1634. }
  1635. }
  1636. //时间
  1637. function getNowFormatDateMap() {
  1638. var date = new Date();
  1639. var year = date.getFullYear();
  1640. var month = date.getMonth() + 1;
  1641. var strDate = date.getDate();
  1642. var Hour = date.getHours(); // 获取当前小时数(0-23)
  1643. var Minute = date.getMinutes(); // 获取当前分钟数(0-59)
  1644. var Second = date.getSeconds(); // 获取当前秒数(0-59)
  1645. var show_day = new Array('星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六');
  1646. var day = date.getDay();
  1647. if(Hour < 10) {
  1648. Hour = "0" + Hour;
  1649. }
  1650. if(Minute < 10) {
  1651. Minute = "0" + Minute;
  1652. }
  1653. if(Second < 10) {
  1654. Second = "0" + Second;
  1655. }
  1656. if(month >= 1 && month <= 9) {
  1657. month = "0" + month;
  1658. }
  1659. if(strDate >= 0 && strDate <= 9) {
  1660. strDate = "0" + strDate;
  1661. }
  1662. var HMS = Hour + ':' + Minute + ':' + Second;
  1663. var temp_time = year + '-' + month + '-' + strDate + ' ' + HMS;
  1664. $('.dataTime').text(temp_time);
  1665. $('.secondLevel_map .time').text(year + '-' + month + '-' + strDate)
  1666. formatDateParam = setTimeout(function() {
  1667. getNowFormatDateMap()
  1668. },1000);
  1669. }
  1670. function getTimes(dom) {
  1671. function p(s) {
  1672. return s < 10 ? '0' + s : s;
  1673. }
  1674. var currentYear = new Date().getFullYear();
  1675. var currentMonth = new Date().getMonth() + 1;
  1676. var currentDate = new Date().getDate();
  1677. var prevCurrentYear = 0;
  1678. var prevCurrentMonth = 0;
  1679. if(currentMonth == 1) {
  1680. prevCurrentYear = currentYear - 1;
  1681. prevCurrentMonth = 12;
  1682. } else {
  1683. prevCurrentYear = currentYear;
  1684. prevCurrentMonth = currentMonth - 1;
  1685. }
  1686. let hh = new Date().getHours()
  1687. let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
  1688. let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
  1689. var data = currentYear + "-" + p(currentMonth) + "-" + '01';
  1690. var current = currentYear + "-" + p(currentMonth) + "-" + p(currentDate);
  1691. $(dom).text(data + " ~ " + current)
  1692. }
  1693. function getNowTime(dom) {
  1694. function p(s) {
  1695. return s < 10 ? '0' + s : s;
  1696. }
  1697. var currentYear = new Date().getFullYear();
  1698. var currentMonth = new Date().getMonth() + 1;
  1699. var currentDate = new Date().getDate();
  1700. var prevCurrentYear = 0;
  1701. var prevCurrentMonth = 0;
  1702. if(currentMonth == 1) {
  1703. prevCurrentYear = currentYear - 1;
  1704. prevCurrentMonth = 12;
  1705. } else {
  1706. prevCurrentYear = currentYear;
  1707. prevCurrentMonth = currentMonth - 1;
  1708. }
  1709. let hh = new Date().getHours()
  1710. let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
  1711. let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
  1712. var data = currentYear + "-" + p(currentMonth) + "-" + '01' + ' ' + '00' + ':' + '00' + ':' + '00';
  1713. var current = currentYear + "-" + p(currentMonth) + "-" + p(currentDate) + ' ' + hh + ':' + mf + ':' + ss;
  1714. $(dom).val(data + " ~ " + current)
  1715. $('#keyDate').val(current);
  1716. }
  1717. // getNowTime('.time')
  1718. //二级页面点击
  1719. //二级办理时长统计
  1720. $('.test_rank .count-share').click(function(e) {
  1721. $('.bulletFrame').show();
  1722. if($('.bulletFrame').css('display') == 'block') {
  1723. $('.body').css('opacity', '0.4')
  1724. }
  1725. getNowTime('#rankDate')
  1726. laydate.render({
  1727. elem: '#rankDate',
  1728. range: '~',
  1729. type: 'datetime',
  1730. done: function(value) {
  1731. testSecTable('#orderlist2', 0, 8, value);
  1732. testSecTable('#orderlist4', 1, 0, value);
  1733. testSecTable('#orderlist5', 1, 1, value);
  1734. testSecTable('#orderlist6', 2, 8, value);
  1735. }
  1736. });
  1737. if(timeState == 0) {
  1738. $('#rankDate').hide()
  1739. $('.timeSta_wrap').show();
  1740. $('.timeSta_wrap').siblings().hide()
  1741. timeSecTable('#timeSecList', 0);
  1742. } else if(timeState == 1) {
  1743. $('#rankDate').show()
  1744. $('.rank_wrap').show();
  1745. $('.rank_wrap').siblings().hide()
  1746. testSecTable('#orderlist2', 0, 8, $('#rankDate').val());
  1747. testSecTable('#orderlist4', 1, 0, $('#rankDate').val());
  1748. testSecTable('#orderlist5', 1, 1, $('#rankDate').val());
  1749. testSecTable('#orderlist6', 2, 8, $('#rankDate').val());
  1750. } else {
  1751. $('#rankDate').hide()
  1752. $('.timeSta1_wrap').show();
  1753. $('.timeSta1_wrap').siblings().hide()
  1754. timeSecTable('#timeSecList1', 1);
  1755. }
  1756. e.stopPropagation()
  1757. })
  1758. $('.accept_statistics ul').click(function(e) {
  1759. $('.bulletFrame').show();
  1760. $('.hotline_wrap').show();
  1761. $('.hotline_wrap').siblings().hide()
  1762. if($('.bulletFrame').css('display') == 'block') {
  1763. $('.body').css('opacity', '0.4')
  1764. }
  1765. getNowTime('#date')
  1766. initHoneline($('#date').val())
  1767. laydate.render({
  1768. elem: '#date',
  1769. range: '~',
  1770. type: 'datetime',
  1771. done: function(value) {
  1772. initHoneline(value)
  1773. }
  1774. });
  1775. function initHoneline(value) {
  1776. var secData = [];
  1777. new doAjax({
  1778. url: huayi.config.callcenter_url + '/InfoNew/GetHotline',
  1779. Type: 'get',
  1780. data: {
  1781. token: $.cookie("token"),
  1782. stime: value && value.split(' ~ ')[0],
  1783. etime: value && value.split(' ~ ')[1],
  1784. timetype: hotlineDataType
  1785. },
  1786. callBack: function(res) {
  1787. if(res.state === "notoken") {
  1788. window.location.href = "login.html";
  1789. }
  1790. res.data.forEach(function(v, n) {
  1791. var obj = {}
  1792. obj.level = v.value
  1793. obj.landArea = v.count
  1794. console.log(obj)
  1795. secData.push(obj)
  1796. })
  1797. console.log(secData)
  1798. getHonelineChart2(secData, 'hotline2')
  1799. }
  1800. });
  1801. }
  1802. e.stopPropagation()
  1803. })
  1804. //重大事件
  1805. $('.accept_channel #hotThings').click(function(e) {
  1806. $('.bulletFrame').show();
  1807. $('.events_wrap').show();
  1808. $('.events_wrap').siblings().hide()
  1809. if($('.bulletFrame').css('display') == 'block') {
  1810. $('.body').css('opacity', '0.4')
  1811. }
  1812. getNowTime('#date2')
  1813. laydate.render({
  1814. elem: '#date2',
  1815. range: '~',
  1816. type: 'datetime',
  1817. done: function(value) {
  1818. new doAjax({
  1819. url: huayi.config.callcenter_url + "/InfoNew/Majorevents",
  1820. Type: 'get',
  1821. data: {
  1822. token: $.cookie("token"),
  1823. stime: value && value.split(' ~ ')[0],
  1824. etime: value && value.split(' ~ ')[1],
  1825. timetype: MajoreventsDataType
  1826. },
  1827. callBack: function(res) {
  1828. if(res.state === "notoken") {
  1829. window.location.href = "login.html";
  1830. }
  1831. channelData = [];
  1832. res.data.forEach(function(v, n) {
  1833. channelData.push({
  1834. level: v.TypeName,
  1835. landArea: v.Count
  1836. })
  1837. // }
  1838. })
  1839. getHonelineChart2(channelData, 'channel')
  1840. }
  1841. });
  1842. }
  1843. });
  1844. new doAjax({
  1845. url: huayi.config.callcenter_url + "/InfoNew/Majorevents",
  1846. Type: 'get',
  1847. data: {
  1848. token: $.cookie("token"),
  1849. stime: $('#date2').val() && $('#date2').val().split(' ~ ')[0],
  1850. etime: $('#date2').val() && $('#date2').val().split(' ~ ')[1]
  1851. },
  1852. callBack: function(res) {
  1853. if(res.state === "notoken") {
  1854. window.location.href = "login.html";
  1855. }
  1856. let eventsData = []
  1857. res.forEach(function(v, n) {
  1858. eventsData.push({
  1859. level: v.name.replace(/[0-9]+/g, ""),
  1860. key: v.F_Key,
  1861. landArea: v.count
  1862. })
  1863. })
  1864. getHonelineChart2(eventsData, 'events')
  1865. }
  1866. });
  1867. e.stopPropagation()
  1868. })
  1869. //受理工单类型
  1870. $('.time_statistics #workOrder').click(function(e) {
  1871. $('.bulletFrame').show();
  1872. $('.acceptanceType_wrap').show();
  1873. $('.acceptanceType_wrap').siblings().hide()
  1874. if($('.bulletFrame').css('display') == 'block') {
  1875. $('.body').css('opacity', '0.4')
  1876. }
  1877. getAcceptanceType()
  1878. e.stopPropagation()
  1879. })
  1880. //受理渠道
  1881. $('.hotlineAccept').click(function(e) {
  1882. let channelData = []
  1883. $('.bulletFrame').show();
  1884. $('.channel_wrap').show();
  1885. $('.channel_wrap').siblings().hide()
  1886. if($('.bulletFrame').css('display') == 'block') {
  1887. $('.body').css('opacity', '0.4')
  1888. }
  1889. getNowTime('#date3')
  1890. laydate.render({
  1891. elem: '#date3',
  1892. range: '~',
  1893. type: 'datetime',
  1894. done: function(value) {
  1895. new doAjax({
  1896. url: huayi.config.callcenter_url + "/InfoNew/GetSourceCountByNow",
  1897. // url: "http://192.168.8.9:1042/InfoNew/GetSourceCountByNow",
  1898. data: {
  1899. token: $.cookie("token"),
  1900. stime: value && value.split(' ~ ')[0],
  1901. etime: value && value.split(' ~ ')[1]
  1902. },
  1903. callBack: function(res) {
  1904. if(res.state === "notoken") {
  1905. window.location.href = "login.html";
  1906. }
  1907. channelData = [];
  1908. res.data.forEach(function(v, n) {
  1909. channelData.push({
  1910. level: v.TypeName,
  1911. landArea: v.Count
  1912. })
  1913. // }
  1914. })
  1915. getHonelineChart2(channelData, 'channel')
  1916. }
  1917. });
  1918. }
  1919. });
  1920. new doAjax({
  1921. url: huayi.config.callcenter_url + "/InfoNew/GetSourceCountByNow",
  1922. // url: "http://192.168.8.9:1042/InfoNew/GetSourceCountByNow",
  1923. data: {
  1924. token: $.cookie("token"),
  1925. stime: $('#date3').val() && $('#date3').val().split(' ~ ')[0],
  1926. etime: $('#date3').val() && $('#date3').val().split(' ~ ')[1]
  1927. },
  1928. callBack: function(res) {
  1929. if(res.state === "notoken") {
  1930. window.location.href = "login.html";
  1931. }
  1932. res.data.forEach(function(v, n) {
  1933. channelData.push({
  1934. level: v.TypeName,
  1935. landArea: v.Count
  1936. })
  1937. sourceCountId.push({
  1938. name: v.TypeName,
  1939. id: v.ValueId
  1940. })
  1941. })
  1942. getHonelineChart2(channelData, 'channel')
  1943. }
  1944. });
  1945. e.stopPropagation()
  1946. })
  1947. //时段话务
  1948. $('#traffic').click(function() {
  1949. $('.bulletFrame').show();
  1950. if($('.bulletFrame').css('display') == 'block') {
  1951. $('.body').css('opacity', '0.4')
  1952. }
  1953. if(trafficState == 0) {
  1954. let qtphoneName = [];
  1955. let qtldcount = [];
  1956. let qtjtcount = [];
  1957. let qtwjcount = [];
  1958. let qtfqcount = [];
  1959. let sphoneName = [];
  1960. let sldcount = [];
  1961. let sjtcount = [];
  1962. let swjcount = [];
  1963. let sfqcount = [];
  1964. $('.traffic2_wrap').show();
  1965. $('.traffic2_wrap').siblings().hide()
  1966. new doAjax({
  1967. url: huayi.config.callcenter_url + "/InfoNew/GetDayparting",
  1968. // url: "http://192.168.8.9:1042/InfoNew/GetDayparting",
  1969. data: {
  1970. token: $.cookie("token"),
  1971. },
  1972. callBack: function(res) {
  1973. if(res.state === "notoken") {
  1974. window.location.href = "login.html";
  1975. }
  1976. res.splice(7, 0, res[1]);
  1977. res.splice(1, 1)
  1978. res.forEach(function(v, n) {
  1979. if(v.name != '12345' && v.name != "归并热线小计") {
  1980. qtphoneName.push(v.name)
  1981. qtldcount.push(v.ldcount)
  1982. qtjtcount.push(v.jtcount)
  1983. qtwjcount.push(v.wjtcount)
  1984. qtfqcount.push(v.zdfqcount);
  1985. } else {
  1986. sphoneName.push(v.name)
  1987. sldcount.push(v.ldcount)
  1988. sjtcount.push(v.jtcount)
  1989. swjcount.push(v.wjtcount)
  1990. sfqcount.push(v.zdfqcount);
  1991. }
  1992. })
  1993. const trafficDayArr = {
  1994. xdata: qtphoneName,
  1995. result: [{
  1996. name: '未接通',
  1997. data: qtwjcount
  1998. },
  1999. {
  2000. name: '接通量',
  2001. data: qtjtcount
  2002. },
  2003. {
  2004. name: '主动放弃',
  2005. data: qtfqcount
  2006. },
  2007. {
  2008. name: '来电量',
  2009. data: qtldcount
  2010. }
  2011. ]
  2012. }
  2013. const dataArr = {
  2014. xdata: sphoneName,
  2015. result: [{
  2016. name: '未接通',
  2017. data: swjcount
  2018. },
  2019. {
  2020. name: '接通量',
  2021. data: sjtcount
  2022. },
  2023. {
  2024. name: '主动放弃',
  2025. data: sfqcount
  2026. },
  2027. {
  2028. name: '来电量',
  2029. data: sldcount
  2030. },
  2031. ]
  2032. }
  2033. trafficDayChart(trafficDayArr);
  2034. getS(dataArr)
  2035. }
  2036. });
  2037. } else if(trafficState == 1) {
  2038. $('.traffic_wrap').show();
  2039. $('.traffic_wrap').siblings().hide()
  2040. new doAjax({
  2041. url: huayi.config.callcenter_url + "InfoNew/GetHWCountMonthByNow",
  2042. data: {
  2043. token: $.cookie("token"),
  2044. },
  2045. callBack: function(res) {
  2046. if(res.state === "notoken") {
  2047. window.location.href = "login.html";
  2048. }
  2049. trafficMonthChart(res.data.days, res.data.hwcount[0], res.data.jtcount[0])
  2050. }
  2051. });
  2052. }
  2053. })