fq.js 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. !function(window, document, $, undefined) {
  2. var data = [{
  3. time: '2018/12/11 12:01',
  4. name: '杨久量',
  5. task: '上门理发',
  6. tissue: '义工联合会',
  7. state: '已上线'
  8. },{
  9. time: '2018/12/11 12:01',
  10. name: '杨久量',
  11. task: '上门理发',
  12. tissue: '义工联合会asasasasasasasasasasasasasasasasasasasasasasasasasasas',
  13. state: '已上线'
  14. },{
  15. time: '2018/12/11 12:01',
  16. name: '杨久量',
  17. task: '上门理发',
  18. tissue: '义工联合会',
  19. state: '已上线'
  20. },{
  21. time: '2018/12/11 12:01',
  22. name: '杨久量',
  23. task: '上门理发',
  24. tissue: '义工联合会',
  25. state: '已上线'
  26. },{
  27. time: '2018/12/11 12:01',
  28. name: '杨久量',
  29. task: '上门理发',
  30. tissue: '义工联合会',
  31. state: '已上线'
  32. },{
  33. time: '2018/12/11 12:01',
  34. name: '杨久量',
  35. task: '上门理发',
  36. tissue: '义工联合会',
  37. state: '已上线'
  38. },{
  39. time: '2018/12/11 12:01',
  40. name: '杨久量',
  41. task: '上门理发',
  42. tissue: '义工联合会',
  43. state: '已上线'
  44. },{
  45. time: '2018/12/11 12:01',
  46. name: '杨久量',
  47. task: '上门理发',
  48. tissue: '义工联合会',
  49. state: '已上线'
  50. },{
  51. time: '2018/12/11 12:01',
  52. name: '杨久量',
  53. task: '上门理发',
  54. tissue: '义工联合会',
  55. state: '已上线'
  56. },{
  57. time: '2018/12/11 12:01',
  58. name: '杨久量',
  59. task: '上门理发',
  60. tissue: '义工联合会',
  61. state: '已上线'
  62. },{
  63. time: '2018/12/11 12:01',
  64. name: '杨久量',
  65. task: '上门理发',
  66. tissue: '义工联合会',
  67. state: '已上线'
  68. },{
  69. time: '2018/12/11 12:01',
  70. name: '杨久量',
  71. task: '上门理发',
  72. tissue: '义工联合会',
  73. state: '已上线'
  74. },{
  75. time: '2018/12/11 12:01',
  76. name: '杨久量',
  77. task: '上门理发',
  78. tissue: '义工联合会',
  79. state: '已上线'
  80. },{
  81. time: '2018/12/11 12:01',
  82. name: '杨久量',
  83. task: '上门理发',
  84. tissue: '义工联合会',
  85. state: '已上线'
  86. },{
  87. time: '2018/12/11 12:01',
  88. name: '杨久量',
  89. task: '上门理发',
  90. tissue: '义工联合会assssssssssssssssssssssssssssssssssssssssssssssssssssssss',
  91. state: '已上线'
  92. },{
  93. time: '2018/12/11 12:01',
  94. name: '杨久量',
  95. task: '上门理发',
  96. tissue: '义工联合会',
  97. state: '已上线'
  98. },{
  99. time: '2018/12/11 12:01',
  100. name: '杨久量',
  101. task: '上门理发',
  102. tissue: '义工联合会',
  103. state: '已上线'
  104. },{
  105. time: '2018/12/11 12:01',
  106. name: '杨久量',
  107. task: '上门理发',
  108. tissue: '义工联合会',
  109. state: '已上线'
  110. }]
  111. var init = {
  112. eventList: function(){
  113. var $pathList = $('#implantation').contents().find('#pathList').find('path');
  114. $('body').on('click', '#close', this.closeOnClick);
  115. $pathList.on('mouseover', this.pathListMouseover);
  116. $pathList.on('mouseout', this.pathListMouseout);
  117. },
  118. pathListMouseover: function() {
  119. var $this = $(this);
  120. var uid = $this.attr('id');
  121. $.ajax({
  122. url:'./data.json',
  123. type: 'get',
  124. dataType: 'json',
  125. success: function(response) {
  126. if(!response) return;
  127. var callNum = response.callInfoRecordNumBigScreenSXs;
  128. $.each(callNum, function(ind, key) {
  129. $('#'+key.name).append(
  130. '<span class="tips">今日呼入次数 '+key.num+'次</span>'
  131. )
  132. })
  133. }
  134. })
  135. $('#'+uid).find('.tips').show();
  136. },
  137. pathListMouseout: function() {
  138. var $this = $(this);
  139. var uid = $this.attr('id');
  140. $('#'+uid).find('.tips').hide();
  141. },
  142. closeOnClick: function() { // 关闭弹窗
  143. var $this = $(this);
  144. $this.parents('.sosInfor').hide();
  145. },
  146. fillList: function() {
  147. var $orderItems = $('#orderItems');
  148. var orderItemsArr = [];
  149. $.each(data, function(ind, key) {
  150. orderItemsArr.push(
  151. '<ul class="rolling rolStyle">',
  152. '<li>',key.time,'</li>',
  153. '<li>',key.name,'</li>',
  154. '<li>',key.task,'</li>',
  155. '<li>',key.tissue,'</li>',
  156. '<li>',key.state,'</li>',
  157. '</ul>'
  158. )
  159. })
  160. $orderItems.html(orderItemsArr.join(''));
  161. },
  162. phoneChart: function() { // 电话呼入饼状图
  163. var phoneNum = echarts.init(document.getElementById('phoneNum'));
  164. option = {
  165. tooltip: {
  166. trigger: 'item',
  167. formatter: "{a} <br/>{b}: {c} ({d}%)"
  168. },
  169. legend: {
  170. orient: 'vertical',
  171. x: 'left',
  172. selectedMode:false,//取消图例上的点击事件
  173. data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎'],
  174. padding: [20, 0, 0, 0],
  175. textStyle: {color: '#fff'}
  176. },
  177. series: [
  178. {
  179. name:'访问来源',
  180. type:'pie',
  181. radius: ['50%', '70%'],
  182. avoidLabelOverlap: false,
  183. animation: false,
  184. hoverAnimation: false,
  185. itemStyle: {
  186. labelLine : {
  187. show : true //隐藏标示线
  188. }
  189. },
  190. label: {
  191. show: false,
  192. normal: {
  193. show: true
  194. },
  195. emphasis: {
  196. show: true
  197. },
  198. legend: {
  199. itemStyle: {
  200. color: '#fff'
  201. }
  202. }
  203. },
  204. labelLine: { // 饼状图周围标注的线
  205. normal: {
  206. show: true
  207. }
  208. },
  209. data:[
  210. {value:335, name:'直接访问'},
  211. {value:310, name:'邮件营销'},
  212. {value:234, name:'联盟广告'},
  213. {value:135, name:'视频广告'},
  214. {value:1548, name:'搜索引擎'}
  215. ]
  216. }
  217. ]
  218. };
  219. phoneNum.setOption(option);
  220. },
  221. phoneBroken: function() { // 电话呼入折线图
  222. var phonebrokenLine = echarts.init(document.getElementById('brokenLine'));
  223. option = {
  224. xAxis: {
  225. type: 'category',
  226. boundaryGap: false,
  227. data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
  228. axisLabel: {
  229. show: true,
  230. textStyle: {
  231. color: '#75bcff'
  232. }
  233. },
  234. axisLine:{
  235. lineStyle:{
  236. color:'#5b7b80'
  237. }
  238. },
  239. splitLine:{ // 显示垂直网格线
  240. show: true,
  241. lineStyle:{
  242. color:'#75bcff'
  243. }
  244. }
  245. },
  246. yAxis: {
  247. type: 'value',
  248. axisLabel: {
  249. show: true,
  250. textStyle: {
  251. color: '#75bcff'
  252. }
  253. },
  254. axisLine:{
  255. lineStyle:{
  256. color:'#5b7b80'
  257. }
  258. },
  259. splitLine:{
  260. show: false
  261. }
  262. },
  263. series: [{
  264. data: [820, 932, 901, 934, 1290, 1330, 1320],
  265. type: 'line',
  266. areaStyle: {
  267. color: '#135877'
  268. },
  269. itemStyle : {
  270. normal : {
  271. lineStyle:{
  272. color:'#58b0f0'
  273. }
  274. }
  275. }
  276. }]
  277. };
  278. phonebrokenLine.setOption(option);
  279. },
  280. mapAddDot: function() { // 地图标点
  281. var circleList = $('.sumDot').find('span');
  282. var source;
  283. $.ajax({
  284. url: 'data.json',
  285. type: 'get',
  286. dataType: 'json',
  287. success: function(response) {
  288. var callInfo = response.callInfoRecordBigScreenSXs;
  289. var resideCommunity;
  290. var $salvorInfo = $('#salvorInfo');
  291. var salvorArr = [];
  292. $.each(callInfo, function(ind, key) {
  293. source = key.source;
  294. // 判断红点和绿点
  295. if(source == 1) { // 1是红色 2是绿色
  296. resideCommunity = $('#'+key.resideCommunity)
  297. salvorArr.push(
  298. '<div class="sosInfor">',
  299. '<p class="sosTitle">sos呼入信息</p>',
  300. '<ul id="salvorInfo">',
  301. '<li>紧急救助人:',key.callName,'</li>',
  302. '<li>呼入号码: ',key.callPhone,'</li>',
  303. '<li>年龄:',key.age,'</li>',
  304. '<li>类型:',key.categoryDictName,'</li>',
  305. '<li>当前位置:',key.resideAddress,'</li>',
  306. '</ul>',
  307. '<img id="close" class="close" src="img/cloce.png" alt="" />',
  308. '</div>'
  309. )
  310. resideCommunity.addClass('redClass');
  311. resideCommunity.append(salvorArr.join(''))
  312. } else if(source == 2) {
  313. resideCommunity = $('#'+key.resideCommunity)
  314. resideCommunity.addClass('greenClass')
  315. }
  316. // 判断是否闪烁
  317. if(key.isFlashing == 1) {
  318. resideCommunity = $('#'+key.resideCommunity);
  319. if(source == 1) {
  320. resideCommunity.append(
  321. '<div class="container"><div class="dot borColor-1"></div><div class="pulse borColor-3"></div></div>'
  322. )
  323. } else {
  324. resideCommunity.append(
  325. '<div class="container"><div class="dot borColor-2"></div><div class="pulse borColor-4"></div></div>'
  326. )
  327. }
  328. }
  329. })
  330. }
  331. })
  332. }
  333. }
  334. init.fillList();
  335. init.phoneChart();
  336. init.phoneBroken();
  337. init.mapAddDot();
  338. init.eventList();
  339. }(window, document, jQuery)
  340. //
  341. //
  342. //