纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

399 lines
10 KiB

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