index.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf8">
  6. <link href="__PUBLIC__/B-JUI/themes/css/bootstrap.css" rel="stylesheet">
  7. <!-- ECharts -->
  8. <script src="__PUBLIC__/B-JUI/plugins/echarts/echarts.js"></script>
  9. <script src="__PUBLIC__/B-JUI/js/jquery-1.11.3.min.js"></script>
  10. <script src="__PUBLIC__/B-JUI/plugins/bootstrap.min.js"></script>
  11. <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=4FjGxlxzQrIkl7BxwMPl6da5yMxsXwp4"></script>
  12. <title> 监控中心 </title>
  13. </head>
  14. <body>
  15. <div class="container-fluid">
  16. <div class="row">
  17. <div class="col-md-12 " style="padding:0px;">
  18. <div class="header"> 中泰科技</div>
  19. </div>
  20. </div>
  21. <div class="row">
  22. <div class="col-sm-6 col-md-6 cod-shadow" style="padding-top:10px; padding-bottom:8px; padding-right:8px;" >
  23. <div id="allmap" class="boxping"></div>
  24. </div>
  25. <div class="col-xs-6 col-md-6 cod-shadow" style="padding-top:10px; padding-bottom:8px;">
  26. <div id="mainMap"></div>
  27. </div>
  28. </div>
  29. <div class="row">
  30. <div class="col-xs-6 col-sm-4 col-md-4 cod-shadow">
  31. <div id="main" class="col-height" ></div>
  32. </div>
  33. <div class="col-xs-6 col-sm-4 col-md-4 cod-shadow" >
  34. <div class="col-height" >
  35. <div class="monitoring-title">
  36. <!--<i class="bell" id="bell" title="关闭声音"></i>-->
  37. <p class="waringShow" title="当前报警设备(2个)">当前报警设备(2个)</p>
  38. <span class="monitoring_up">
  39. <img src="__PUBLIC__/images/map/5.png" class="monitoring_up_img" title="列表形式查看报警">
  40. </span>
  41. </div>
  42. <div id="banners"><!-- 轮播部分 -->
  43. <ul class="imgList"><!-- 图片部分 -->
  44. <li> <div class="zt-text">
  45. <p>单位名称:<span>上海市普陀区申汉大厦-c座</span></p>
  46. <p>设备名称:<span> yyyyyy</span></p>
  47. <p>报警类型:<span class="blue">火警</span></p>
  48. <p>序列号码:<span>3300075</span></p>
  49. <p>报警时间:<span>2017/08/23 09:46:50</span></p>
  50. </div>
  51. </li>
  52. <li> <div class="zt-text">
  53. <p>单位名称:<span>上海市人民广场</span></p>
  54. <p>设备名称:<span> xxxxx</span></p>
  55. <p>报警类型:<span class="blue">烟雾</span></p>
  56. <p>序列号码:<span>3300075</span></p>
  57. <p>报警时间:<span>2017/08/23 09:46:50</span></p>
  58. </div>
  59. </li>
  60. </ul>
  61. <div style="display:none;">
  62. <audio id="bgMusic">
  63. <source = src="__PUBLIC__/music/jb.wav" type="audio/mp3">
  64. </audio>
  65. <!--<img src="./img/prev.png" width="20px" height="40px" id="prev">
  66. <img src="./img/next.png" width="20px" height="40px" id="next">--></div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="col-xs-6 col-sm-4 col-md-4 cod-shadow">
  71. <div id="mainline" class="col-height" ></div>
  72. </div>
  73. </div>
  74. <div id="searchResultPanel" style=" position: absolute; border:1px solid #C0C0C0; width:220px; height:auto; display:none;"></div>
  75. </body>
  76. </html>
  77. <style type="text/css">
  78. .boxping{
  79. position: fixed;
  80. left: 0;
  81. top: 0;
  82. right: 0;
  83. bottom: 0;
  84. display: flex;
  85. align-items: center;
  86. justify-content: center;
  87. width: 100%;
  88. height: 100%;
  89. background: #0c1a35;
  90. z-index: 999;
  91. color: #fff;
  92. }
  93. html,body{overflow-y:hidden; margin:0px;padding:0px; font-family:cursive; font-size:14px; background:url('__PUBLIC__/images/map/bg4.png');}
  94. #allmap{width: 100%; display:flex; justify-content: center;align-items: center;}
  95. .optionpanel{margin: 10px auto;}
  96. #r-result{ margin:0 auto; width:500px; position: absolute; bottom:0px;}
  97. .anchorTR,.BMap_stdMpPan,.BMap_stdMpZoom,.anchorBL{display:none;}
  98. img
  99. {
  100. opacity:0.85;
  101. }
  102. .header{
  103. width: 100%;
  104. min-height: 80px;
  105. height: 11%;
  106. display: flex;
  107. letter-spacing:80px;
  108. font-size:45px;
  109. color: aqua;
  110. justify-content: center;
  111. align-items: center;
  112. background-size: contain;
  113. background:url('__PUBLIC__/images/map/header.png') no-repeat center;
  114. }
  115. .cod-shadow{
  116. box-shadow:0 0 23px #50e4fe inset;
  117. -webkit-box-shadow:0 0 23px #50e4fe inset;
  118. -moz-box-shadow:0 0 23px #50e4fe inset;
  119. -o-box-shadow:0 0 23px #50e4fe inset;
  120. }
  121. .cod-shadow2{
  122. box-shadow:0 0 80px #c91527 inset;
  123. -webkit-box-shadow:0 0 80px #c91527 inset;
  124. -moz-box-shadow:0 0 80px #c91527 inset;
  125. -o-box-shadow:0 0 80px #c91527 inset;
  126. }
  127. .col-height{
  128. color: #fff;
  129. min-height:300px;
  130. height:80%;
  131. padding:10px;
  132. }
  133. ul,li{list-style: none; margin:0px;padding:0px;}
  134. a{text-decoration: none;}
  135. #banners{position:relative; width: 400px; margin:0px auto; overflow: hidden;clear: both;}
  136. .imgList{position:relative; width:10000px; z-index: 10; margin:0px; padding:0px;}
  137. .imgList li{
  138. float:left; display: inline;
  139. width:400px;
  140. color: #fff;
  141. padding:10px 30px;
  142. line-height:30px;
  143. }
  144. .zt-text{
  145. }
  146. .waringShow{font-size: 16px;
  147. color: #ff0101;
  148. display: inline-block;
  149. width: 146px;
  150. float: left;
  151. overflow: hidden;
  152. text-overflow: ellipsis;
  153. white-space: nowrap;
  154. padding: 0px;}
  155. .monitoring_up {
  156. float: left;
  157. animation: myAnimation .95s infinite;
  158. -webkit-animation: myAnimation .95s infinite;
  159. cursor: pointer;
  160. position: absolute;
  161. }
  162. #prev,
  163. #next{position: absolute; top:80px; z-index: 20;cursor: pointer;opacity: 0.2;filter:alpha(opacity=20);}
  164. #prev{left: 10px;}
  165. #next{right: 10px;}
  166. #prev:hover,
  167. #next:hover{opacity: 0.5;filter:alpha(opacity=50);}
  168. </style>
  169. <script type="text/javascript">
  170. $(document).ready(function(){
  171. var h=$(window).height();
  172. $('#allmap').css('height',h-410);
  173. $('#mainMap').css('height',h-410);
  174. });
  175. window.onresize = function(){
  176. var h=$(window).height();
  177. $('#allmap').css('height',h-410);
  178. $('#mainMap').css('height',h-410);
  179. }
  180. var map = new BMap.Map("allmap");
  181. window.map = map;
  182. var point = new BMap.Point(121.48,31.22);
  183. map.addControl(new BMap.NavigationControl()); // 添加平移缩放控件
  184. map.addControl(new BMap.ScaleControl()); // 添加比例尺控件
  185. map.addControl(new BMap.OverviewMapControl()); //添加缩略地图控件
  186. map.enableScrollWheelZoom(); //启用滚轮放大缩小
  187. map.addControl(new BMap.MapTypeControl()); //添加地图类型控件
  188. map.disable3DBuilding();
  189. map.centerAndZoom(point, 9);
  190. map.setMapStyle({style:'midnight'});
  191. /*map.addEventListener("click",function(e){
  192. alert(e.point.lng + "," + e.point.lat);
  193. });*/
  194. //创建小狐狸
  195. /*var pt = new BMap.Point(121.37401,31.113346);
  196. var marker2 = new BMap.Marker(pt,{icon:myIcon}); // 创建标注
  197. map.addOverlay(marker2); // 将标注添加到地图中 */
  198. var myIcon = new BMap.Icon("__PUBLIC__/images/map/1.png", new BMap.Size(30,30));
  199. var myIcon1 = new BMap.Icon("__PUBLIC__/images/map/4.png", new BMap.Size(30,30));
  200. var data_info = {$data_info};
  201. /*var data_info2=function(){
  202. return [[121.37401,31.113346,"地址:上海市闵行区莘松六村34栋",0],
  203. [121.37426,31.113455,"地址:上海市闵行区莘松六村33栋",0]
  204. ,[121.481152,31.235372,"地址:上海市人民广场",0]
  205. ,[121.398378,31.237817 ,"地址:上海市普陀区申汉大厦-c座",1]
  206. ,[121.399029,31.240878,"地址:上海市普陀区五芳斋大厦",0]];
  207. }();*/
  208. var opts = {
  209. width : 250, // 信息窗口宽度
  210. height: 80, // 信息窗口高度
  211. title : "信息窗口" , // 信息窗口标题
  212. enableMessage:true//设置允许信息窗发送短息
  213. };
  214. for(var i=0;i<data_info.length;i++){
  215. var marker = new BMap.Marker(new BMap.Point(data_info[i][0],data_info[i][1]),{icon:(data_info[i][3]==1)?myIcon1:myIcon}); // 创建标注
  216. var content = data_info[i][2];
  217. map.addOverlay(marker); // 将标注添加到地图中
  218. if(data_info[i][3]==1){
  219. marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
  220. }
  221. addClickHandler(content,marker);
  222. }
  223. function addClickHandler(content,marker){
  224. marker.addEventListener("click",function(e){
  225. openInfo(content,e)}
  226. );
  227. }
  228. function openInfo(content,e){
  229. var p = e.target;
  230. var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
  231. var infoWindow = new BMap.InfoWindow(content,opts); // 创建信息窗口对象
  232. map.openInfoWindow(infoWindow,point); //开启信息窗口
  233. }
  234. require.config({
  235. paths: {
  236. echarts: '__PUBLIC__/B-JUI/plugins/echarts/'
  237. }
  238. });
  239. // Step:4 require echarts and use it in the callback.
  240. // Step:4 动态加载echarts然后在回调函数中开始使用,注意保持按需加载结构定义图表路径
  241. require([
  242. 'echarts',
  243. 'echarts/chart/bar',
  244. 'echarts/chart/line',
  245. 'echarts/chart/pie',
  246. 'echarts/chart/map'
  247. ],
  248. function (ec) {
  249. //饼图
  250. var myChart = ec.init(document.getElementById('main'));
  251. myChart.setOption({
  252. title : {
  253. text: '',
  254. subtext: '',
  255. x:'center'
  256. },
  257. tooltip : {
  258. trigger: 'item',
  259. formatter: "{a} <br/>{b} : {c} ({d}%)"
  260. },
  261. legend: {
  262. textStyle:{color: '#fff'},
  263. orient : 'vertical',
  264. x : 'left',
  265. data:['接入点位','报警点位','报警次数']
  266. },
  267. toolbox: {
  268. show : false,
  269. feature : {
  270. mark : {show: true},
  271. dataView : {show: true, readOnly: false},
  272. magicType : {
  273. show: true,
  274. type: ['pie', 'funnel'],
  275. option: {
  276. funnel: {
  277. x: '25%',
  278. width: '50%',
  279. funnelAlign: 'left',
  280. max: 1548
  281. }
  282. }
  283. },
  284. restore : {show: true},
  285. saveAsImage : {show: true}
  286. }
  287. },
  288. calculable : true,
  289. series : [
  290. {
  291. name:'访问来源',
  292. type:'pie',
  293. radius : '70%',
  294. center: ['50%', '50%'],
  295. data:[
  296. {value:198, name:'接入点位',itemStyle:{
  297. normal:{color:'#3FDCFD'}
  298. }},
  299. {value:2, name:'报警点位',itemStyle:{
  300. normal:{color:'#F84145'}
  301. }},
  302. {value:300, name:'报警次数',itemStyle:{
  303. normal:{color:'#6495ED'}
  304. }}
  305. ]
  306. }
  307. ]
  308. });
  309. //--- 柱 ---
  310. var myChart1 = ec.init(document.getElementById('mainline'),'dark');
  311. myChart1.setOption({
  312. title : {
  313. text: '2017报警记录',
  314. textStyle:{color: '#50e4fe'},
  315. },
  316. grid :{
  317. x:80,
  318. y:50,
  319. x2:30,
  320. y2:40,
  321. borderWidth:0,
  322. },
  323. tooltip : {
  324. textStyle:{color: '#fff'},
  325. trigger: 'axis',
  326. axisPointer:{type: 'none'}
  327. },
  328. toolbox: {
  329. show : false,
  330. feature : {
  331. mark : {show: true},
  332. dataView : {show: true, readOnly: false},
  333. magicType: {show: true, type: ['line', 'bar']},
  334. restore : {show: true},
  335. saveAsImage : {show: true}
  336. }
  337. },
  338. calculable : true,
  339. xAxis : [
  340. {
  341. type : 'value',
  342. boundaryGap : [0, 0.01],
  343. axisLabel : {
  344. show:true,
  345. length: 10,
  346. textStyle: {
  347. color: '#fff'
  348. }
  349. },
  350. splitLine:{
  351.      show:false
  352.    }
  353. }
  354. ],
  355. yAxis : [
  356. {
  357. type : 'category',
  358. data : ['接入点位','报警点位','报警次数'],
  359. axisLabel : {
  360. show:true,
  361. length: 10,
  362. textStyle: {
  363. color: '#fff'
  364. }
  365. },
  366. splitLine:{
  367.      show:false
  368.    }
  369. }
  370. ],
  371. series : [
  372. {
  373. name:'2017年',
  374. type:'bar',
  375. itemStyle : { normal: {label : {show: true, position: 'right'}}},
  376. data:[{
  377. value:198,
  378. itemStyle:{
  379. normal:{color:'#3FDCFD'}
  380. }
  381. },{
  382. value:2,
  383. itemStyle:{
  384. normal:{color:'#F84145'}
  385. }
  386. },{
  387. value:300,
  388. itemStyle:{
  389. normal:{color:'#6495ED'}
  390. }
  391. }]
  392. }
  393. ]
  394. });
  395. // --- 地图 ---
  396. var myChart2 = ec.init(document.getElementById('mainMap'),'dark');
  397. myChart2.setOption( {
  398. title : {
  399. text: '上海城市设备监控',
  400. subtext: '',
  401. x:'center',
  402. textStyle:{
  403. fontSize: 18,
  404. fontWeight: 'bolder',
  405. color: '#50e4fe'
  406. }
  407. },
  408. tooltip : {
  409. trigger: 'axis',
  410. formatter:{name}
  411. },
  412. color:['red','lightgreen','#11abff','#ffdf33','#968ade'],
  413. legend: {
  414. textStyle:{color: '#fff'},
  415. orient: 'vertical',
  416. x:'left',
  417. data:[{name : '报警',textStyle : {color:'red'}},{name : '正常',textStyle : {color:'lightgreen'}}]
  418. },
  419. dataRange: {
  420. show:false,
  421. min : 0,
  422. max : 300,
  423. calculable : true,
  424. color: ['red','#0974de','#004881','lightgreen']
  425. },
  426. toolbox: {
  427. show : false,
  428. orient : 'vertical',
  429. x: 'right',
  430. y: 'center',
  431. feature : {
  432. mark : {show: true},
  433. dataView : {show: true, readOnly: false},
  434. restore : {show: true},
  435. saveAsImage : {show: true}
  436. }
  437. },
  438. series : [
  439. {
  440. name: 'kkk',
  441. type: 'map',
  442. mapType: '上海',
  443. hoverable: false,
  444. itemStyle:{
  445. normal:{label:{show:true, textStyle: {
  446. color: '#fff'
  447. }}}
  448. },
  449. data : {$dataall}
  450. },
  451. {
  452. name: '正常',
  453. type: 'map',
  454. mapType: '上海',
  455. hoverable: false,
  456. roam:true,
  457. data : [ ],
  458. markPoint : {
  459. symbolSize: 5, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
  460. itemStyle: {
  461. normal: {
  462. borderColor: '#000',
  463. borderWidth: 1, // 标注边线线宽,单位px,默认为1
  464. label: {
  465. show: false
  466. }
  467. },
  468. emphasis: {
  469. borderColor: '#1e90ff',
  470. borderWidth: 5,
  471. label: {
  472. show: false
  473. }
  474. }
  475. },
  476. data : {$rdatatrue1}
  477. /*[
  478. {name:"上海市闵行区莘松六村34栋",value:0},
  479. {name: "上海市普陀区五芳斋大厦", value: 0},
  480. {name: "上海市普陀区五芳斋大厦", value: 0},
  481. {name: "上海市人民广场", value:0}]*/
  482. },
  483. geoCoord: {$rdatatrue2}
  484. /*{
  485. "上海市闵行区莘松六村34栋":[121.37401,31.113346],
  486. "上海市闵行区莘松六村33栋":[121.37426,31.113455],
  487. "上海市人民广场":[121.481152,31.235372],
  488. "上海市普陀区五芳斋大厦":[121.399029,31.240878]
  489. }*/
  490. },
  491. {
  492. name: '报警',
  493. type: 'map',
  494. mapType: '上海',
  495. data:[],
  496. markPoint : {
  497. symbol:'emptyCircle',
  498. symbolSize : function (v){
  499. return 10 + v/100
  500. },
  501. effect : {
  502. show: true,
  503. color :'red'
  504. },
  505. itemStyle:{
  506. normal:{
  507. label:{show:false}
  508. }
  509. },
  510. data : {$rdataerr3}
  511. /*[
  512. // {name: "上海市人民广场", value:300},
  513. {name: "上海市普陀区申汉大厦-c座", value:300 }
  514. // {name: "上海市普陀区五芳斋大厦", value: 300},
  515. //{name: "上海市闵行区莘松六村33栋", value: 300}
  516. ]*/
  517. },
  518. geoCoord: {$rdataerr4}
  519. /*{
  520. //"上海市闵行区莘松六村33栋":[121.37426,31.113455],
  521. //"上海市人民广场":[121.481152,31.235372],
  522. "上海市普陀区申汉大厦-c座":[121.398378,31.237817]
  523. // "上海市普陀区五芳斋大厦":[121.399029,31.240878],
  524. }*/
  525. }
  526. ]
  527. });
  528. }
  529. );
  530. var curIndex = 0, //当前index
  531. imgLen = $(".imgList li").length; //图片总数
  532. // 定时器自动变换2.5秒每次
  533. var autoChange = setInterval(function(){
  534. if(curIndex < imgLen-1){
  535. curIndex ++;
  536. }else{
  537. curIndex = 0;
  538. }
  539. //调用变换处理函数
  540. changeTo(curIndex);
  541. },5500);
  542. //左箭头滑入滑出事件处理
  543. $("#prev").hover(function(){
  544. //滑入清除定时器
  545. clearInterval(autoChange);
  546. },function(){
  547. //滑出则重置定时器
  548. autoChangeAgain();
  549. });
  550. //左箭头点击处理
  551. $("#prev").click(function(){
  552. //根据curIndex进行上一个图片处理
  553. curIndex = (curIndex > 0) ? (--curIndex) : (imgLen - 1);
  554. changeTo(curIndex);
  555. });
  556. //右箭头滑入滑出事件处理
  557. $("#banners").hover(function(){
  558. //滑入清除定时器
  559. clearInterval(autoChange);
  560. },function(){
  561. //滑出则重置定时器
  562. autoChangeAgain();
  563. });
  564. //右箭头点击处理
  565. $("#next").click(function(){
  566. curIndex = (curIndex < imgLen - 1) ? (++curIndex) : 0;
  567. changeTo(curIndex);
  568. });
  569. //清除定时器时候的重置定时器--封装
  570. function autoChangeAgain(){
  571. autoChange = setInterval(function(){
  572. if(curIndex < imgLen-1){
  573. curIndex ++;
  574. }else{
  575. curIndex = 0;
  576. }
  577. //调用变换处理函数
  578. changeTo(curIndex);
  579. },5500);
  580. }
  581. function changeTo(num){
  582. var goLeft = num * 400;
  583. console.log(goLeft);
  584. var audio = document.getElementById("bgMusic");
  585. //播放(继续播放)
  586. //audio.play();
  587. $(".imgList").animate({left: "-" + goLeft + "px"},500);
  588. $(".cod-shadow").addClass("cod-shadow2");
  589. $(".cod-shadow").removeClass("cod-shadow");
  590. setTimeout(function(){$(".cod-shadow2").addClass("cod-shadow");$(".cod-shadow").removeClass("cod-shadow2");},1000);
  591. }
  592. </script>