manhole.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <link rel="stylesheet" href="style/reset.css" />
  8. <link rel="stylesheet" href="style/public.css" />
  9. <link rel="stylesheet" href="style/manhole.css" />
  10. <link rel="stylesheet" href="font/iconfont.css" />
  11. <title>Document</title>
  12. </head>
  13. <body>
  14. <section class="s1">
  15. <div class="s-title">
  16. <h2>设备概况</h2>
  17. <span class="tag">万达广场</span>
  18. </div>
  19. <div class="s1-title">总计设备数量 <span>200台</span></div>
  20. <div class="e-con">
  21. <div>
  22. <div id="con1"></div>
  23. <div class="con-txt">掀翻</div>
  24. </div>
  25. <div>
  26. <div id="con2"></div>
  27. <div class="con-txt">抬起</div>
  28. </div>
  29. <div>
  30. <div id="con3"></div>
  31. <div class="con-txt">水浸</div>
  32. </div>
  33. <div>
  34. <div id="con4"></div>
  35. <div class="con-txt">正常</div>
  36. </div>
  37. </div>
  38. </section>
  39. <div class="line"></div>
  40. <section class="s2">
  41. <div class="s-title">
  42. <h2>设备趋势</h2>
  43. <span class="tag">万达广场</span>
  44. </div>
  45. <div class="s2-con">
  46. <div class="s2-left">
  47. <div class="sl-title">设备报警时间</div>
  48. <div class="sl-sub" style="color:#fe2a2a">1分钟前</div>
  49. <div class="sl-title">区域负责人值班电话</div>
  50. <div class="sl-sub">1341779846</div>
  51. <div class="sl-title">蓬江区消防大队值班电话</div>
  52. <div class="sl-sub">0750-8699139</div>
  53. </div>
  54. <div class="s2-right" id="s2-e"</div>
  55. </div>
  56. </section>
  57. <div class="line"></div>
  58. <section class="s3">
  59. <div class="s-title">
  60. <h2>设备列表</h2>
  61. <span class="tag">丰乐社区</span>
  62. </div>
  63. <div class="s3-select">
  64. <div>烟雾探测器</div>
  65. <div>
  66. <select value="0" name="全部" id="select">
  67. <option value="0">全部</option>
  68. <option value="1">掀翻</option>
  69. <option value="2">抬起</option>
  70. <option value="3">水浸</option>
  71. <option value="4">正常</option>
  72. </select>
  73. </div>
  74. </div>
  75. <div class="jiaotong">
  76. <div class="jiaotong-table">
  77. <div class="t-header">
  78. <span>更新时间</span>
  79. <span>状态</span>
  80. <span>温度</span>
  81. <span>电量</span>
  82. <span>详情</span>
  83. </div>
  84. <div class="t-main">
  85. </div>
  86. </div>
  87. </div>
  88. </section>
  89. <div class="line"></div>
  90. <section class="s4">
  91. <div class="s-title">
  92. <h2>设备详情</h2>
  93. <span class="tag">AGE67ioj-49</span>
  94. </div>
  95. <div class="s4-con">
  96. <div class="s4-left" id="map"></div>
  97. <div class="s4-right">
  98. </div>
  99. </div>
  100. </section>
  101. <script src="js/jquery-3.2.1.min.js"></script>
  102. <script src="js/echarts.min.js"></script>
  103. <script src="https://webapi.amap.com/maps?v=1.4.10&key=e661b00bdf2c44cccf71ef6070ef41b8"></script>
  104. <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.6&key=e661b00bdf2c44cccf71ef6070ef41b8"></script>
  105. <script type="text/javascript" src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
  106. <script>
  107. let equipment = [{
  108. time:"19.03.27 21.23.27",
  109. status:'正常',
  110. temperature:"15℃",
  111. quantity:'99%',
  112. id:0,
  113. detail:{
  114. name:"AGE67ioj-49",
  115. lanlat:[113.0842709541, 22.5944937320],
  116. xinghao:"AllRange1",
  117. status:"正常",
  118. update:"1分钟前",
  119. xinhao:"强",
  120. quantity:'99%',
  121. position:"丰乐社区沂水街南段东城街路口"
  122. }
  123. },{
  124. time:"19.03.27 21.23.27",
  125. status:'掀翻',
  126. temperature:"15℃",
  127. quantity:'99%',
  128. id:1,
  129. detail:{
  130. name:"AGE67ioj-49",
  131. lanlat:[113.0842709541, 22.5944937320],
  132. xinghao:"AllRange1",
  133. status:"掀翻",
  134. update:"1分钟前",
  135. xinhao:"强",
  136. quantity:'99%',
  137. position:"丰乐社区沂水街南段东城街路口"
  138. }
  139. },{
  140. time:"19.03.27 21.23.27",
  141. status:'抬起',
  142. temperature:"15℃",
  143. quantity:'99%',
  144. id:2,
  145. detail:{
  146. name:"AGE67ioj-49",
  147. lanlat:[113.0842709541, 22.5944937320],
  148. xinghao:"AllRange1",
  149. status:"抬起",
  150. update:"1分钟前",
  151. xinhao:"强",
  152. quantity:'99%',
  153. position:"丰乐社区沂水街南段东城街路口"
  154. }
  155. },{
  156. time:"19.03.27 21.23.27",
  157. status:'水浸',
  158. temperature:"15℃",
  159. quantity:'99%',
  160. id:3,
  161. detail:{
  162. name:"AGE67ioj-49",
  163. lanlat:[113.0842709541, 22.5944937320],
  164. xinghao:"AllRange1",
  165. status:"水浸",
  166. update:"1分钟前",
  167. xinhao:"强",
  168. quantity:'99%',
  169. position:"丰乐社区沂水街南段东城街路口"
  170. }
  171. }];
  172. (function() {
  173. let c1 = "#fe2a2a";
  174. let c2 = "#04cd0d";
  175. let c3 = "#fdca3a";
  176. let c4 = "#479eff";
  177. let con1 = {
  178. color: [c1, "#a3a3a3"],
  179. title: {
  180. text: "25%",
  181. textStyle: {
  182. color: "#fff",
  183. fontSize: 12,
  184. fontWeight: "normal"
  185. },
  186. subtext: "50台",
  187. subtextStyle: {
  188. color: c1,
  189. fontSize: 14
  190. },
  191. x: "center",
  192. y: "30%"
  193. },
  194. series: [
  195. {
  196. name: "50台",
  197. type: "pie",
  198. textStyle: {
  199. color: "#999"
  200. },
  201. radius: ["80%", "65%"],
  202. center: ["50%", "50%"],
  203. avoidLabelOverlap: false,
  204. label: {
  205. normal: {
  206. show: false,
  207. position: "center"
  208. }
  209. },
  210. labelLine: {
  211. normal: {
  212. show: false
  213. }
  214. },
  215. data: [{ value: 25, name: "报警" }, { value: 75, name: "未报警" }]
  216. }
  217. ]
  218. };
  219. let con2 = {
  220. color: [c2, "#a3a3a3"],
  221. title: {
  222. text: "25%",
  223. textStyle: {
  224. color: "#fff",
  225. fontSize: 12,
  226. fontWeight: "normal"
  227. },
  228. subtext: "50台",
  229. subtextStyle: {
  230. color: c2,
  231. fontSize: 14
  232. },
  233. x: "center",
  234. y: "30%"
  235. },
  236. series: [
  237. {
  238. name: "50台",
  239. type: "pie",
  240. textStyle: {
  241. color: "#999"
  242. },
  243. radius: ["80%", "65%"],
  244. center: ["50%", "50%"],
  245. avoidLabelOverlap: false,
  246. label: {
  247. normal: {
  248. show: false,
  249. position: "center"
  250. }
  251. },
  252. labelLine: {
  253. normal: {
  254. show: false
  255. }
  256. },
  257. data: [{ value: 25, name: "报警" }, { value: 75, name: "未报警" }]
  258. }
  259. ]
  260. };
  261. let con3 = {
  262. color: [c3, "#a3a3a3"],
  263. title: {
  264. text: "25%",
  265. textStyle: {
  266. color: "#fff",
  267. fontSize: 12,
  268. fontWeight: "normal"
  269. },
  270. subtext: "50台",
  271. subtextStyle: {
  272. color: c3,
  273. fontSize: 14
  274. },
  275. x: "center",
  276. y: "30%"
  277. },
  278. series: [
  279. {
  280. name: "50台",
  281. type: "pie",
  282. textStyle: {
  283. color: "#999"
  284. },
  285. radius: ["80%", "65%"],
  286. center: ["50%", "50%"],
  287. avoidLabelOverlap: false,
  288. label: {
  289. normal: {
  290. show: false,
  291. position: "center"
  292. }
  293. },
  294. labelLine: {
  295. normal: {
  296. show: false
  297. }
  298. },
  299. data: [{ value: 25, name: "报警" }, { value: 75, name: "未报警" }]
  300. }
  301. ]
  302. };
  303. let con4 = {
  304. color: [c4, "#a3a3a3"],
  305. title: {
  306. text: "25%",
  307. textStyle: {
  308. color: "#fff",
  309. fontSize: 12,
  310. fontWeight: "normal"
  311. },
  312. subtext: "50台",
  313. subtextStyle: {
  314. color: c4,
  315. fontSize: 14
  316. },
  317. x: "center",
  318. y: "30%"
  319. },
  320. series: [
  321. {
  322. name: "50台",
  323. type: "pie",
  324. textStyle: {
  325. color: "#999"
  326. },
  327. radius: ["80%", "65%"],
  328. center: ["50%", "50%"],
  329. avoidLabelOverlap: false,
  330. label: {
  331. normal: {
  332. show: false,
  333. position: "center"
  334. }
  335. },
  336. labelLine: {
  337. normal: {
  338. show: false
  339. }
  340. },
  341. data: [{ value: 25, name: "报警" }, { value: 75, name: "未报警" }]
  342. }
  343. ]
  344. };
  345. let option = {
  346. title: {
  347. textStyle:{
  348. color:'#fff'
  349. }
  350. },
  351. grid: {
  352. left: '3%',
  353. right: '4%',
  354. bottom: '3%',
  355. containLabel: true
  356. },
  357. xAxis: {
  358. type: 'category',
  359. boundaryGap: false,
  360. data: ['周一','周二','周三','周四','周五','周六','周日'],
  361. axisLine: {
  362. lineStyle: {
  363. color: "#ffffff"
  364. }
  365. }
  366. },
  367. yAxis: {
  368. type: 'value',
  369. axisLine: {
  370. lineStyle: {
  371. color: "#ffffff"
  372. }
  373. },
  374. splitLine: {
  375. show: false
  376. },
  377. },
  378. series: [
  379. {
  380. name:'邮件营销',
  381. type:'line',
  382. stack: '总量',
  383. data:[120, 132, 101, 134, 90, 230, 210]
  384. },
  385. {
  386. name:'联盟广告',
  387. type:'line',
  388. stack: '总量',
  389. data:[220, 182, 191, 234, 290, 330, 310]
  390. },
  391. {
  392. name:'视频广告',
  393. type:'line',
  394. stack: '总量',
  395. data:[150, 232, 201, 154, 190, 330, 410]
  396. },
  397. {
  398. name:'直接访问',
  399. type:'line',
  400. stack: '总量',
  401. data:[320, 332, 301, 334, 390, 330, 320]
  402. },
  403. {
  404. name:'搜索引擎',
  405. type:'line',
  406. stack: '总量',
  407. data:[820, 932, 901, 934, 1290, 1330, 1320]
  408. }
  409. ]
  410. };
  411. let optionChart = echarts.init(document.querySelector("#s2-e"));
  412. let con1Chart = echarts.init(document.querySelector("#con1"));
  413. let con2Chart = echarts.init(document.querySelector("#con2"));
  414. let con3Chart = echarts.init(document.querySelector("#con3"));
  415. let con4Chart = echarts.init(document.querySelector("#con4"));
  416. optionChart.setOption(option);
  417. con1Chart.setOption(con1);
  418. con2Chart.setOption(con2);
  419. con3Chart.setOption(con3);
  420. con4Chart.setOption(con4);
  421. var map = new AMap.Map('map', {
  422. resizeEnable: true,
  423. zoom:14,
  424. center: [113.0842709541, 22.5944937320]
  425. });
  426. })();
  427. let htmlTemp = ""
  428. equipment.forEach((item,idx)=>{
  429. htmlTemp+=`<div class="t-body ${idx===0?'active':''}" data-detail="${item.id}">
  430. <span>${item.time}</span>
  431. <span>${item.status}</span>
  432. <span>${item.temperature}</span>
  433. <span>${item.quantity}</span>
  434. <span>...</span>
  435. </div>`
  436. })
  437. let firstItem = equipment[0].detail
  438. let htmlItem = getItemHtml(firstItem)
  439. $('.s4-right').html(htmlItem)
  440. $('.t-main').html(htmlTemp)
  441. $("#select").change(function(e){
  442. htmlTemp = ""
  443. let val = $("#select").find("option:selected").text();
  444. console.log(val);
  445. if (val!=="全部") {
  446. equipment.forEach(item=>{
  447. if (item.status === val) {
  448. htmlTemp+=`<div class="t-body" data-detail="${item.id}">
  449. <span>${item.time}</span>
  450. <span>${item.status}</span>
  451. <span>${item.temperature}</span>
  452. <span>${item.quantity}</span>
  453. <span>...</span>
  454. </div>`
  455. }
  456. })
  457. }
  458. else{
  459. equipment.forEach(item=>{
  460. htmlTemp+=`<div class="t-body" data-detail="${item.id}">
  461. <span>${item.time}</span>
  462. <span>${item.status}</span>
  463. <span>${item.temperature}</span>
  464. <span>${item.quantity}</span>
  465. <span>...</span>
  466. </div>`
  467. })
  468. }
  469. $('.t-main').html(htmlTemp)
  470. });
  471. $('.t-main').on("click",".t-body",function (e) {
  472. let that = $(this)
  473. let id = that.data('detail')
  474. $('.t-main .t-body').removeClass('active')
  475. that.addClass('active')
  476. equipment.forEach(item=>{
  477. if (item.id === id) {
  478. let html = getItemHtml(item.detail)
  479. $('.s4-right').html(html)
  480. }
  481. })
  482. })
  483. function getItemHtml(item) {
  484. return `<div class="s4-item">
  485. <div class="s4i-l">设备型号</div>
  486. <div class="s4i-r">${item.xinghao}</div>
  487. </div>
  488. <div class="s4-item">
  489. <div class="s4i-l">设备状态</div>
  490. <div class="s4i-r" style="color:#fe2a2a;">${item.status}</div>
  491. </div>
  492. <div class="s4-item">
  493. <div class="s4i-l">更新时间</div>
  494. <div class="s4i-r">${item.update}</div>
  495. </div>
  496. <div class="s4-item">
  497. <div class="s4i-l">信号强度</div>
  498. <div class="s4i-r">${item.xinhao}</div>
  499. </div>
  500. <div class="s4-item">
  501. <div class="s4i-l">设备电量</div>
  502. <div class="s4i-r">${item.quantity}</div>
  503. </div>
  504. <div class="s4-item">
  505. <div class="s4i-l">设备位置</div>
  506. <div class="s4i-r">${item.position}</div>
  507. </div>`
  508. }
  509. let arr = Array.from(document.querySelectorAll(".s1 .card")).concat(
  510. Array.from(document.querySelectorAll(".s2 .card"))
  511. );
  512. arr.forEach((dom, index) => {
  513. dom.addEventListener("click", e => {
  514. console.log("equipmentClickHandle", index);
  515. window.equipmentClickHandle && window.equipmentClickHandle(index);
  516. });
  517. });
  518. </script>
  519. </body>
  520. </html>