Sailing.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>瑞高船舶智能监控系统</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
  9. <meta http-equiv="pragma" content="no-cache">
  10. <meta http-equiv="Cache" content="no-cache">
  11. <meta http-equiv="cache-control" content="no-cache, must-revalidate">
  12. <meta http-equiv="expires" content="0">
  13. <meta name="viewport"
  14. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  15. <link rel="stylesheet" href="../../css/element.css">
  16. <link rel="stylesheet" href="../../css/style.css">
  17. <link rel="stylesheet" id="linkSource" href="../../css/base.css">
  18. <script src="../../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
  19. <script src="../../js/yz/init.js" type="text/javascript" charset="utf-8"></script>
  20. <script src="../../js/echarts.min.js" type="text/javascript" charset="utf-8"></script>
  21. <script src="../../js/pako.js"></script>
  22. <script type="text/javascript">
  23. document.write('<script src="../../js/yz/shipLi.js?id='+(new Date().getTime())+'" type="text/javascript" charset="utf-8"><\/script>');
  24. document.write('<script src="../../js/yz/defailt.js?id='+(new Date().getTime())+'" type="text/javascript" charset="utf-8"><\/script>');
  25. document.write('<script src="../../js/yz/ajax.js?id='+(new Date().getTime())+'" type="text/javascript" charset="utf-8"><\/script>');
  26. checkLogin();
  27. </script>
  28. </head>
  29. <style type="text/css">
  30. *{
  31. margin: 0;
  32. padding: 0;
  33. }
  34. body {
  35. color: #fff;
  36. height: 100%;
  37. background-color: #103151;
  38. }
  39. div,td {
  40. box-sizing: border-box;
  41. }
  42. .qixiang_box>div>div{
  43. display: flex;
  44. align-items: center;
  45. justify-content: center;
  46. }
  47. .qixiang_box>div>div:nth-child(3){
  48. color:#ffea00;
  49. font-size: 18px;
  50. font-weight: 600;
  51. }
  52. .qixiang_box>div img{
  53. width: 40px;
  54. }
  55. .num_chiShui{
  56. font-size: 18px;
  57. font-weight: bold;
  58. margin-right: 3px;
  59. color:#ffea00;
  60. }
  61. .qixiang_box .num_chiShui{
  62. font-size: 18px;
  63. }
  64. #rgCx{
  65. display: none;
  66. }
  67. </style>
  68. <body>
  69. <div class="topParen">
  70. <div class="topBox">
  71. <div>船舶动态</div>
  72. <i class="iconfont icon-left text-white" onclick="javascript:history.back(-1);"></i>
  73. </div>
  74. <div class="table margin-xs text-grey" style="border:1px solid rgba(255,255,255,0.1);">
  75. <div class="bg-theme-son padding-left padding-tb-sm flex justify-between">
  76. <span class="text-white">AIS信息</span>
  77. </div>
  78. <div>
  79. <div class="br_b flex">
  80. <div class="flex-sub br_r padding-tb-xs padding-left-sm">
  81. 当前位置:<span id="shipGps">113.23568,21.399475</span>
  82. </div>
  83. <div class="flex-sub padding-tb-xs padding-left-sm">
  84. 航速:<span id="shipSpeed">0</span>节
  85. </div>
  86. </div>
  87. <div class="text-center">
  88. <div class="flex br_b">
  89. <div class="padding-tb-xs flex-sub br_r">
  90. <div style="width: 100%;height: 150px;" id="myChart1"></div>
  91. <div class="text-white margin-top-sm" style="font-size:15px;">
  92. 船艏向:<span class="num_chiShui" id="shipCsx">0</span>°
  93. </div>
  94. </div>
  95. <div class="padding-tb-xs flex-sub">
  96. <div style="width: 100%;height: 150px;" id="myChart4"></div>
  97. <div class="text-white margin-top-sm" style="font-size:15px;">
  98. 船迹向:<span class="num_chiShui" id="shipCjx">0</span>°
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="table margin-xs text-grey" style="border:1px solid rgba(255,255,255,0.1);">
  106. <div class="bg-theme-son padding-left padding-tb-sm flex justify-between">
  107. <span class="text-white">吃水信息</span>
  108. </div>
  109. <div class="flex align-center padding-sm">
  110. <div class="flex-sub flex align-center justify-center">
  111. <img src="../../imgs/ship_cs.png" style="width: 40%;max-width:140px;">
  112. <div class="margin-left-xs margin-top">测深:<span class="num_chiShui" id="eatCs">0</span> m</div>
  113. </div>
  114. <div class="flex-sub text-center" id="rgCx">
  115. <div>艏:<span class="valTxt"><span class="num_chiShui" id="eatSs">0</span> m</div>
  116. <div class="flex align-center justify-center">
  117. <div>左中:<br><span class="valTxt"><span class="num_chiShui" id="eatZz">0</span> m</div>
  118. <img src="../../imgs/ship_tblr.png" mode="widthFix" style="width:30px;margin: 10px;">
  119. <div>右中:<br><span class="valTxt"><span class="num_chiShui" id="eatYz">0</span> m</div>
  120. </div>
  121. <div>艉:<span class="valTxt"><span class="num_chiShui" id="eatWx">0</span> m</div>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="table margin-xs text-grey" style="border:1px solid rgba(255,255,255,0.1);">
  126. <div class="bg-theme-son padding-left padding-tb-sm flex justify-between">
  127. <span class="text-white">气象信息</span>
  128. <div class="flex align-center text-grey">
  129. <i class="iconfont icon-left" style="font-size: 14px;" onclick="changeDate(-1);"></i>
  130. <span id="_time" class="margin-lr-sm">2021/12/23 14:00:00</span>
  131. <i class="iconfont icon-right" style="font-size: 18px;" onclick="changeDate(1);"></i>
  132. </div>
  133. </div>
  134. <div class="qixiang_box">
  135. <div class="row flex br_b">
  136. <div class="flex-sub padding-tb-xs">
  137. <img src="../../imgs/fs_icon.png" alt="">
  138. </div>
  139. <div class="flex-sub padding-tb-xs br_r">
  140. 风速
  141. </div>
  142. <div class="flex-sub padding-tb-xs br_r" id="weather1">
  143. 0
  144. </div>
  145. <div class="flex-sub padding-tb-xs flex-direction">
  146. <div>米/秒</div>
  147. <div>(2级风)</div>
  148. </div>
  149. </div>
  150. <div class="row flex br_b">
  151. <div class="flex-sub padding-tb-xs">
  152. <img src="../../imgs/fx_icon.png" alt="">
  153. </div>
  154. <div class="flex-sub padding-tb-xs br_r">
  155. 风向
  156. </div>
  157. <div class="flex-sub padding-tb-xs br_r" id="weather2">
  158. 0
  159. </div>
  160. <div class="flex-sub padding-tb-xs">
  161. </div>
  162. </div>
  163. <div class="row flex br_b">
  164. <div class="flex-sub padding-tb-xs">
  165. <img src="../../imgs/lg_icon.png" alt="">
  166. </div>
  167. <div class="flex-sub padding-tb-xs br_r">
  168. 浪高
  169. </div>
  170. <div class="flex-sub padding-tb-xs br_r" id="weather3">
  171. 0
  172. </div>
  173. <div class="flex-sub padding-tb-xs">
  174. </div>
  175. </div>
  176. <div class="row flex br_b">
  177. <div class="flex-sub padding-tb-xs">
  178. <img src="../../imgs/ls_icon.png" alt="">
  179. </div>
  180. <div class="flex-sub padding-tb-xs br_r">
  181. 流速
  182. </div>
  183. <div class="flex-sub padding-tb-xs br_r" id="weather4">
  184. 0
  185. </div>
  186. <div class="flex-sub padding-tb-xs">
  187. 米/秒
  188. </div>
  189. </div>
  190. <div class="row flex br_b">
  191. <div class="flex-sub padding-tb-xs">
  192. <img src="../../imgs/lx_icon.png" alt="">
  193. </div>
  194. <div class="flex-sub padding-tb-xs br_r">
  195. 流向
  196. </div>
  197. <div class="flex-sub padding-tb-xs br_r" id="weather5">
  198. 0
  199. </div>
  200. <div class="flex-sub padding-tb-xs">
  201. </div>
  202. </div>
  203. <div class="row flex br_b">
  204. <div class="flex-sub padding-tb-xs">
  205. <img src="../../imgs/wd_icon.png" alt="">
  206. </div>
  207. <div class="flex-sub padding-tb-xs br_r">
  208. 温度
  209. </div>
  210. <div class="flex-sub padding-tb-xs br_r" id="weather6">
  211. 0
  212. </div>
  213. <div class="flex-sub padding-tb-xs">
  214. 摄氏度
  215. </div>
  216. </div>
  217. <div class="row flex">
  218. <div class="flex-sub padding-tb-xs">
  219. <img src="../../imgs/qy_icon.png" alt="">
  220. </div>
  221. <div class="flex-sub padding-tb-xs br_r">
  222. 气压
  223. </div>
  224. <div class="flex-sub padding-tb-xs br_r" id="weather7">
  225. 0
  226. </div>
  227. <div class="flex-sub padding-tb-xs">
  228. hPa
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. </div>
  234. <script type="text/javascript">
  235. var _Posi = null,nowSn = localStorage.getItem("shipSn");;
  236. var _Tok = JSON.parse(localStorage.getItem("_yz_TT")).yzTok;
  237. var myChart1 = echarts.init(document.getElementById('myChart1'));
  238. var myChart4 = echarts.init(document.getElementById('myChart4'));
  239. function setoption2(ship_s,txt) {
  240. ship_s = ship_s == undefined?0 : ship_s;
  241. $("#"+txt).text(ship_s);
  242. option = {
  243. series: [
  244. {
  245. name: '实时数据',
  246. min: 0,
  247. max: 360,
  248. splitNumber:12,
  249. type: 'gauge',
  250. fontSize: 0,
  251. center: ['50%', '50%'],
  252. radius: '97%',
  253. startAngle:90,
  254. endAngle: -269.999999,
  255. detail: {show:false
  256. },
  257. axisTick: {
  258. distance: 4,
  259. lineStyle: {
  260. color: '#1890ff',
  261. }
  262. },
  263. data: [{value: ship_s,itemStyle:{color:"#1890ff"}}],
  264. axisLine: {
  265. lineStyle: {
  266. width: 0,
  267. },
  268. },
  269. axisLabel:{
  270. textStyle: {
  271. color: '#fff',
  272. fontSize:9
  273. },
  274. distance: 3,
  275. formatter: function(e) {
  276. switch (e + "") {
  277. case "0":
  278. return "0";
  279. case "30":
  280. return "30";
  281. case "60":
  282. return "60";
  283. case "90":
  284. return "90";
  285. case "120":
  286. return "120";
  287. case "150":
  288. return "150";
  289. case "180":
  290. return "180";
  291. case "210":
  292. return "210";
  293. case "240":
  294. return "240";
  295. case "270":
  296. return "270";
  297. case "300":
  298. return "300";
  299. case "330":
  300. return "330";
  301. default:
  302. return "";
  303. }
  304. }
  305. },
  306. pointer: {
  307. width:2,
  308. length:"60%"
  309. },
  310. splitLine: {
  311. distance: 4,
  312. length: 10,
  313. lineStyle: {
  314. width: 2,
  315. color: '#1890ff',
  316. }
  317. },
  318. title: {
  319. textStyle: {
  320. color: '#1890ff',
  321. }
  322. },
  323. }
  324. ]
  325. };
  326. return option;
  327. }
  328. $(document).ready(function(){
  329. let nowTime = changeDays(0,new Date());
  330. let _day = parseInt(nowTime[3])<9?" 08:00:00":(parseInt(nowTime[3])<15?" 14:00:00":" 20:00:00");
  331. $("#_time").text(nowTime[0].replace(/-/g,"/")+_day);
  332. firstData();
  333. // setInterval(()=>{firstData();},60*1000);
  334. })
  335. function firstData(){
  336. _Posi = null;
  337. deviceList(function(_obj){
  338. let _arr = _obj;
  339. myChart1.setOption(setoption2(_arr["0aA1"]<0?256.4:_arr["0aA1"],"shipCsx"));
  340. myChart4.setOption(setoption2(_arr["0a8"]<0?65:_arr["0a8"],"shipCjx"));
  341. _Posi = _arr["0a5"]<0?[121.453598,30.769552]: [_arr["0a4"], _arr["0a5"]];
  342. $("#shipGps").text(_Posi[0]+","+_Posi[1]);
  343. $("#shipSpeed").text(_arr["0a9"] == undefined?0 : _arr["0a9"]);
  344. if(nowSn == "381001400"){
  345. $("#rgCx").css("display","none");
  346. }else{
  347. $("#rgCx").css("display","block");
  348. }
  349. $("#eatCs").text(_arr["0aS"] == undefined?0 : _arr["0aS"]);
  350. $("#eatSs").text(_arr["0ag"] == undefined?0 : _arr["0ag"]);
  351. $("#eatZz").text(_arr["0ai"] == undefined?0 : _arr["0ai"]);
  352. $("#eatYz").text(_arr["0aj"] == undefined?0 : _arr["0aj"]);
  353. $("#eatWx").text(_arr["0ah"] == undefined?0 : _arr["0ah"]);
  354. getWeat($("#_time").text().replace(/\//g,"-"));
  355. })
  356. }
  357. function getWeat(_time){
  358. if(_Posi != null){
  359. getWeather({
  360. _Tok: _Tok,
  361. nowSn: nowSn,
  362. _time: _time,
  363. posi: _Posi
  364. })
  365. }
  366. }
  367. function changeDate(_num){
  368. let _key = $("#_time").text().split(" ");
  369. let _time = parseInt(_key[1]);
  370. let _year = _key[0].replace(/\//g,"-");
  371. let _newAjax = "";
  372. if(_num == -1){
  373. if(_time < 9){
  374. let _newYW = changeDays(-1,_year);
  375. $("#_time").text(_newYW[0].replace(/-/g,"/")+" 20:00:00");
  376. _newAjax = _newYW[0] + " 20:00:00";
  377. }else if(_time>8&&_time<15){
  378. $("#_time").text(_year.replace(/-/g,"/")+" 08:00:00");
  379. _newAjax = _year + " 08:00:00";
  380. }else if(_time>14){
  381. $("#_time").text(_year.replace(/-/g,"/")+" 14:00:00");
  382. _newAjax = _year + " 14:00:00";
  383. }
  384. }else{
  385. if(_time < 9){
  386. $("#_time").text(_year.replace(/-/g,"/")+" 14:00:00");
  387. _newAjax = _year + " 14:00:00";
  388. }else if(_time>8&&_time<15){
  389. $("#_time").text(_year.replace(/-/g,"/")+" 20:00:00");
  390. _newAjax = _year + " 20:00:00";
  391. }else if(_time>14){
  392. let _newYW = changeDays(1,_year);
  393. $("#_time").text(_newYW[0].replace(/-/g,"/")+" 08:00:00");
  394. _newAjax = _newYW[0] + " 08:00:00";
  395. }
  396. }
  397. getWeat(_newAjax);
  398. }
  399. </script>
  400. </body>
  401. </html>