screen.html 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>安全警报管理模块可视化数据</title>
  8. <link rel="stylesheet" href="/static/bootstrap-3.3.7/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="/static/hplus/css/style.css?v=4.1.0">
  10. <script src="/static/jquery-1.11.3.min.js"></script>
  11. <script src="/static/layer3.2.0/layer.js"></script>
  12. <script src="/static/elementui2.15.5/vue-2.6.14.js"></script>
  13. <script src="/static/elementui2.15.5/datav.map.vue.js"></script>
  14. <script src="/static/echarts.js"></script>
  15. <script src="/static/hplus/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
  16. <style>
  17. body{
  18. position: relative;
  19. width: 1920px;
  20. height: 1080px;
  21. background-image: url("/admin/img/security/bg.jpg");
  22. background-repeat:repeat;
  23. background-size:100% 100%;
  24. -moz-background-size:100% 100%;
  25. margin: 0 auto;
  26. /*border: 1px solid red;*/
  27. }
  28. .col-xs-3{
  29. padding-right: 5px;
  30. padding-left: 5px;
  31. }
  32. .line1 {
  33. overflow: hidden;
  34. text-overflow: ellipsis;
  35. display: box;
  36. display: -webkit-box;
  37. line-clamp: 1;
  38. box-orient: vertical;
  39. -webkit-line-clamp: 1;
  40. -webkit-box-orient: vertical;
  41. word-break: break-all;
  42. }
  43. .line2 {
  44. overflow: hidden;
  45. text-overflow: ellipsis;
  46. display: box;
  47. display: -webkit-box;
  48. line-clamp: 2;
  49. box-orient: vertical;
  50. -webkit-line-clamp: 2;
  51. -webkit-box-orient: vertical;
  52. word-break: break-all;
  53. }
  54. .nnav-header{
  55. width: 100%;
  56. height: 130px;
  57. position: relative;
  58. text-align: center;
  59. color: #ffffff;
  60. }
  61. .nnav-header .nav-bg{
  62. width: 1143px;
  63. height: 64px;
  64. margin-top: 38px;
  65. }
  66. .nnav-header .nav-title{
  67. position: absolute;
  68. z-index: 10;
  69. top: 20px;
  70. left: 0;
  71. width: 100%;
  72. height: 50px;
  73. font-size: 38px;
  74. text-align: center;
  75. }
  76. .nnav-header .nav-desc{
  77. position: absolute;
  78. z-index: 10;
  79. top: 80px;
  80. left: 0;
  81. width: 100%;
  82. height: 40px;
  83. font-size: 19px;
  84. text-align: center;
  85. }
  86. .main{
  87. /*border: 1px solid #ffffff;*/
  88. overflow: hidden;
  89. overflow-y: auto;
  90. }
  91. .main1{
  92. position: absolute;
  93. z-index: 10;
  94. width: 1230px;
  95. top: 120px;
  96. left: 20px;
  97. bottom: 0;
  98. padding-bottom: 15px;
  99. }
  100. .main2{
  101. position: absolute;
  102. z-index: 10;
  103. width: 625px;
  104. height: 320px;
  105. top: 120px;
  106. left: 1270px;
  107. }
  108. .main3{
  109. position: absolute;
  110. z-index: 10;
  111. width: 625px;
  112. height: 320px;
  113. top: 440px;
  114. left: 1270px;
  115. }
  116. .main4{
  117. position: absolute;
  118. z-index: 10;
  119. width: 625px;
  120. height: 320px;
  121. top: 760px;
  122. left: 1270px;
  123. }
  124. .addrbox{
  125. width: 100%;
  126. height: auto;
  127. background-repeat:repeat;
  128. background-size:100% 100%;
  129. -moz-background-size:100% 100%;
  130. padding: 15px 25px;
  131. }
  132. .addrbox.cur1{
  133. background-image: url("/admin/img/security/lsit.png");
  134. }
  135. .addrbox.cur2{
  136. background-image: url("/admin/img/security/lsit2.png");
  137. }
  138. .addrbox .addrbox-top,.addrbox .addrbox-desc{
  139. width: 100%;
  140. line-height: 34px;
  141. color: #88B1D0;
  142. }
  143. .addrbox .addrbox-title{
  144. width: 100%;
  145. height: 80px;
  146. line-height: 40px;
  147. color: #E6EEEA;
  148. font-size: 26px;
  149. /*margin-top: 10px;*/
  150. vertical-align: middle;
  151. }
  152. .addrbox .addrbox-title table{
  153. width: 100%;
  154. }
  155. .addrbox .addrbox-title td{
  156. height: 80px;
  157. text-align: center;
  158. }
  159. .status-color1{
  160. color: #00FF95;
  161. }
  162. .status-color2{
  163. color: #FF3455;
  164. }
  165. .status-color3{
  166. color: #FFCC00;
  167. }
  168. .status-color4{
  169. color: #00FCFF;
  170. }
  171. .status-color5{
  172. color: #00C0FF;
  173. }
  174. .status-color6{
  175. color: #FD7D44;
  176. }
  177. .header{
  178. position: relative;
  179. color: #FFFFFF;
  180. font-size: 18px;
  181. font-weight: bold;
  182. line-height: 40px;
  183. padding-left: 8px;
  184. margin-bottom: 10px;
  185. }
  186. .header .header-bg{
  187. display: block;
  188. width: 299px;
  189. height: 33px;
  190. position: absolute;
  191. left: 7px;
  192. top: 20px;
  193. }
  194. .hzbox{
  195. position: relative;
  196. width: 100%;
  197. height: 100%;
  198. }
  199. .hzbox .hzbg{
  200. width: 422px;
  201. height: 100%;
  202. }
  203. .hzbox .hzbox-count{
  204. position: absolute;
  205. z-index: 10;
  206. width: 100%;
  207. line-height: 40px;
  208. height: 40px;
  209. top: 30px;
  210. left: 0;
  211. text-align: center;
  212. color: #F5AB3D;
  213. font-size: 45px;
  214. font-weight: bold;
  215. }
  216. .hzbox .hzbox-year{
  217. position: absolute;
  218. z-index: 10;
  219. width: 100%;
  220. line-height: 30px;
  221. height: 30px;
  222. bottom: 0px;
  223. left: 0;
  224. text-align: center;
  225. color: #FFFFFF;
  226. font-size: 14px;
  227. }
  228. .echartbox{
  229. width: 100%;
  230. height: 260px;
  231. }
  232. .tablebox{
  233. width: 100%;
  234. height: 260px;
  235. color: #88B1D0!important;
  236. }
  237. .tbmask{
  238. width: 100%;
  239. height: 100%;
  240. background-color: rgba(0,0,0,0.6);
  241. position: absolute;
  242. top: 0;
  243. left: 0;
  244. z-index: 98;
  245. }
  246. .tcbox{
  247. width: 1762px;
  248. height: 942px;
  249. position: absolute;
  250. top: 77px;
  251. left: 84px;
  252. z-index: 100;
  253. }
  254. .tcbox.tbbg{
  255. z-index: 99;
  256. background-image: url("/admin/img/security/tcbg.png");
  257. background-repeat:no-repeat;
  258. background-size:100% 100%;
  259. -moz-background-size:100% 100%;
  260. }
  261. .jbbox{
  262. position: relative;
  263. width: 100%;
  264. height: 100%;
  265. }
  266. .jbbox .jbbox-body{
  267. width: 100%;
  268. height: 100%;
  269. padding-left: 1108px;
  270. padding-right: 150px;
  271. padding-top: 342px;
  272. color: #ffffff;
  273. }
  274. .jbbox .jbbox-body h3{
  275. font-size: 46px;
  276. font-weight: bold;
  277. margin-bottom: 20px;
  278. }
  279. .jbbox .jbbox-body .jbbox-body-desc{
  280. font-size: 28px;
  281. line-height: 44px;
  282. }
  283. .jbbox .jbboximg1{
  284. display: block;
  285. position: absolute;
  286. width: 840px;
  287. height: 720px;
  288. border-radius: 40px;
  289. z-index: 10;
  290. top: 114px;
  291. left: 83px;
  292. }
  293. .jbbox .jbboximg2{
  294. display: block;
  295. position: absolute;
  296. width: 390px;
  297. height: 147px;
  298. z-index: 11;
  299. top: 252px;
  300. left: 784px;
  301. }
  302. .jbbox .jbbox-btn{
  303. width: 100%;
  304. height: 64px;
  305. line-height: 64px;
  306. font-size: 41px;
  307. font-weight: bold;
  308. background-color: #00FFCC;
  309. border-radius: 10px;
  310. cursor: pointer;
  311. text-align: center;
  312. margin-top: 20px;
  313. }
  314. ::-webkit-scrollbar-track {
  315. background-color: transparent!important;
  316. }
  317. ::-webkit-scrollbar {
  318. width: 6px;
  319. background-color: transparent!important;
  320. }
  321. ::-webkit-scrollbar-thumb {
  322. background-color: transparent!important;
  323. }
  324. </style>
  325. </head>
  326. <body>
  327. <div id="app">
  328. <div class="nnav-header">
  329. <img class="nav-bg" src="/admin/img/security/nav-title.png" alt="">
  330. <div class="nav-title">安全警报管理模块可视化数据</div>
  331. <div class="nav-desc">Visualization data of grid management module</div>
  332. </div>
  333. <div class="main main1">
  334. <div class="row">
  335. <div class="col-xs-12">
  336. <div class="header">
  337. 设备布防网格化管理
  338. <img class="header-bg" src="/admin/img/security/titbg.png" alt="">
  339. </div>
  340. </div>
  341. <div class="col-xs-3" v-for="(item,index) in addrs" :key="index">
  342. <div v-if="item.class == 'status-color6'" class="addrbox cur2">
  343. <div class="addrbox-top">
  344. 运行状态:<span v-if="item.fault == 0" class="status-color1">正常</span><span v-if="item.fault == 1" class="status-color2">故障</span>
  345. <span class="pull-right">报警次数:<span :class="item.class">{{item.count}}</span></span>
  346. </div>
  347. <div class="addrbox-title line2 text-center">
  348. <table>
  349. <tr>
  350. <td>{{item.title}}</td>
  351. </tr>
  352. </table>
  353. </div>
  354. <div class="addrbox-desc text-center">
  355. 设备编号:{{item.sn}}
  356. </div>
  357. </div>
  358. <div v-if="item.class != 'status-color6'" class="addrbox cur1">
  359. <div class="addrbox-top">
  360. 运行状态:<span v-if="item.fault == 0" class="status-color1">正常</span><span v-if="item.fault == 1" class="status-color2">故障</span>
  361. <span class="pull-right">报警次数:<span :class="item.class">{{item.count}}</span></span>
  362. </div>
  363. <div class="addrbox-title line2 text-center">
  364. <table>
  365. <tr>
  366. <td>{{item.title}}</td>
  367. </tr>
  368. </table>
  369. </div>
  370. <div class="addrbox-desc text-center">
  371. 设备编号:{{item.sn}}
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. <div class="main main2 text-center">
  378. <div class="hzbox">
  379. <img class="hzbg" src="/admin/img/security/hzbg.png" alt="">
  380. <div class="hzbox-count">{{yearCount}}</div>
  381. <div class="hzbox-year">{{year}}年度汇总</div>
  382. </div>
  383. </div>
  384. <div class="main main3">
  385. <div class="header">
  386. 月度报警回馈效率概览
  387. <img class="header-bg" src="/admin/img/security/titbg.png" alt="">
  388. </div>
  389. <div class="echartbox" id="echartdata"></div>
  390. </div>
  391. <div class="main main4">
  392. <div class="header">
  393. 报警记录
  394. <img class="header-bg" src="/admin/img/security/titbg.png" alt="">
  395. </div>
  396. <div class="tablebox">
  397. <dv-scroll-board :config="tableData" style="width:100%;height:100%;" />
  398. </div>
  399. </div>
  400. <div class="tbmask" style="display: none;"></div>
  401. <div class="tcbox tbbg" style="display: none;"></div>
  402. <div class="tcbox" style="display: none;">
  403. <div class="jbbox">
  404. <img class="jbboximg1" id="jb-img" src="/admin/img/security/zwt.png" alt="">
  405. <img class="jbboximg2" src="/admin/img/security/zxbj.png" alt="">
  406. <div class="jbbox-body">
  407. <h3 id="jb-title"></h3>
  408. <div class="jbbox-body-desc">设备编号:<span id="jb-sn"></span></div>
  409. <div class="jbbox-body-desc">
  410. 运行状态:
  411. <span class="status-color1" id="jb-fault" style="display: none">正常</span>
  412. <span class="status-color2" id="jb-fault1" style="display: none">故障</span>
  413. </div>
  414. <div class="jbbox-body-desc">报警次数:<span id="jb-count"></span></div>
  415. <div class="jbbox-body-desc">报警时间:<span id="jb-time"></span></div>
  416. <div class="jbbox-btn" onclick="getCfData()">撤 防</div>
  417. </div>
  418. </div>
  419. </div>
  420. </div>
  421. <audio id="dingdantixing" src="/static/security.mp3" controls="controls" loop style="display: none;"></audio>
  422. <script>
  423. var audio = document.getElementById('dingdantixing');
  424. var text = document.title;
  425. var timer;
  426. var id = 0;
  427. var app;
  428. var timer2;
  429. var opacity = 1;
  430. var open = 0;
  431. $(window).resize(function(){
  432. location.reload()
  433. });
  434. $(function () {
  435. loadingTitle();
  436. changeZoom();
  437. // showOpen();
  438. app = new Vue({
  439. el: '#app',
  440. data: function() {
  441. return {
  442. tableData: null,
  443. addrs: [],
  444. year: '',
  445. yearCount: 0,
  446. }
  447. },
  448. created(){
  449. this.getData();
  450. setInterval(function () {
  451. this.getData();
  452. },60000);
  453. },
  454. methods: {
  455. getData() {
  456. var url = '{:url("screen")}';
  457. let that = this;
  458. $.post(url, {}, function (res) {
  459. if (res.code == 1) {
  460. that.tableData = null;
  461. that.addrs = [];
  462. that.$nextTick(() => {
  463. that.tableData = {
  464. header: ['报警地点', '报警时间', '撤防时间', '撤防人员'],
  465. data: res.data.records,
  466. rowNum: 5,
  467. align: ['center', 'center', 'center', 'center'],
  468. headerBGC: 'rgba(6, 29, 78, 0.5)',
  469. oddRowBGC: 'rgba(34, 54, 97, 0.5)',
  470. evenRowBGC: 'rgba(6, 29, 78, 0.5)',
  471. };
  472. that.addrs = res.data.addrs;
  473. that.year = res.data.year;
  474. that.yearCount = res.data.year_count;
  475. that.initEcharts(res.data.x,res.data.y,res.data.y2);
  476. console.log('ssdsdsdsd',that.addrs)
  477. });
  478. }
  479. });
  480. },
  481. initEcharts(x,y,y2){
  482. let option = {
  483. color: ['#FEC006','#20A3F7'],
  484. legend: {
  485. right:'5',
  486. data:['平均撤防时长','报警总数'],
  487. textStyle:{
  488. color:'#fff',
  489. fontSize: 12,
  490. },
  491. },
  492. dataZoom: {
  493. show: false,
  494. // start: 0,
  495. // end: 100
  496. },
  497. xAxis: [
  498. {
  499. axisLabel: {
  500. show: true,
  501. textStyle: {
  502. color: '#fff'
  503. },
  504. rotate:30
  505. },
  506. axisLine: {
  507. lineStyle: {
  508. color: '#7D9AFB',//左边线的颜色
  509. width:'3'//坐标线的宽度
  510. }
  511. },
  512. type: 'category',
  513. boundaryGap: true,
  514. data: x,
  515. },
  516. {
  517. type: 'category',
  518. boundaryGap: true,
  519. data: []
  520. }
  521. ],
  522. yAxis: [
  523. {
  524. splitLine:{
  525. show:false, //去掉网格线
  526. },
  527. // 去掉背景的网格线
  528. axisLabel: {
  529. show: true,
  530. textStyle: {
  531. color:'#ffffff' //这里用参数代替了
  532. }
  533. },
  534. axisLine:{
  535. lineStyle:{
  536. color:'#FFFFFF',
  537. width:1,//这里是为了突出显示加上的
  538. }
  539. }
  540. },
  541. {
  542. type: 'value',
  543. name:'分钟',
  544. scale: true,
  545. // 去掉背景的网格线
  546. axisLabel: {
  547. show: true,
  548. textStyle: {
  549. color:'#ffffff' //这里用参数代替了
  550. }
  551. },
  552. axisLine:{
  553. lineStyle:{
  554. color:'#FFFFFF',
  555. width:1,//这里是为了突出显示加上的
  556. }
  557. }
  558. },
  559. {
  560. type: 'value',
  561. scale: true,
  562. main:0,
  563. // name:'分钟',
  564. // boundaryGap: [0.2, 0.2],
  565. axisLabel: {
  566. textStyle: {
  567. color: '#fff'
  568. },
  569. },
  570. },
  571. ],
  572. series: [
  573. {
  574. name: '平均撤防时长',
  575. type: 'line',
  576. data: y,
  577. barWidth :20,
  578. },
  579. {
  580. name: '报警总数',
  581. type: 'bar',
  582. xAxisIndex: 1,
  583. yAxisIndex: 1,
  584. data: y2,
  585. barWidth :20,
  586. }
  587. ]
  588. };
  589. var myChart = echarts.init(document.getElementById('echartdata'));
  590. myChart.setOption(option);
  591. }
  592. }
  593. });
  594. setInterval(function () {
  595. getBjData();
  596. },2000);
  597. });
  598. function changeZoom() {
  599. var wb = $(window).width()/1920;
  600. var hb = $(window).height()/1080;
  601. if(wb >= hb){
  602. $('body').css({
  603. 'zoom': hb,
  604. });
  605. }else{
  606. $('body').css({
  607. 'zoom': wb,
  608. });
  609. }
  610. }
  611. function showOpen() {
  612. open = 1;
  613. opacity = 1;
  614. $('.tbbg').css('opacity',opacity);
  615. clearInterval(timer2);
  616. $('.tbmask').show();
  617. $('.tcbox').show();
  618. audio.play();
  619. timer2 = setInterval(function () {
  620. if(opacity <= 0){
  621. opacity = 1;
  622. }else{
  623. opacity = opacity - 0.05;
  624. }
  625. $('.tbbg').css('opacity',opacity);
  626. },60)
  627. }
  628. function showClose() {
  629. open = 0;
  630. $('.tbmask').hide();
  631. $('.tcbox').hide();
  632. audio.pause();
  633. clearInterval(timer2);
  634. }
  635. function loadingTitle() {
  636. clearTimeout(timer);
  637. document.title = text.substring(1,text.length) + text.substring(0,1);
  638. text = document.title.substring(0,text.length);
  639. timer = setTimeout("loadingTitle()", 500)
  640. }
  641. // 获取警报数据
  642. function getBjData(){
  643. var url = '{:url("bj")}';
  644. $.post(url,{id:id},function (res) {
  645. if(res.code == 1) {
  646. if(open == 0){
  647. showOpen();
  648. id = res.data.id;
  649. if(res.data.img){
  650. $('#jb-img').attr('src',res.data.img);
  651. }else{
  652. $('#jb-img').attr('src','/admin/img/security/zwt.png');
  653. }
  654. if(res.data.fault == 0){
  655. $('#jb-fault').show();
  656. $('#jb-fault1').hide();
  657. }else{
  658. $('#jb-fault').hide();
  659. $('#jb-fault1').show();
  660. }
  661. $('#jb-title').html(res.data.title);
  662. $('#jb-sn').html(res.data.sn);
  663. $('#jb-count').html(res.data.count);
  664. $('#jb-time').html(res.data.alarm_time);
  665. }
  666. }else{
  667. showClose();
  668. }
  669. });
  670. }
  671. // 撤防
  672. function getCfData(){
  673. var url = '{:url("cf")}';
  674. $.post(url,{id:id},function (res) {
  675. if(res.code == 1) {
  676. showClose();
  677. getBjData();
  678. app.getData();
  679. }
  680. });
  681. }
  682. </script>
  683. </body>
  684. </html>