Нет описания

index.js 61KB

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