Nav apraksta

index.js 60KB

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