env_info.html 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Aisky-Sixth</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. <!-- 新 Bootstrap4 核心 CSS 文件 -->
  8. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
  9. <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  10. <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  11. <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
  12. <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
  13. <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
  14. <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
  15. <!-- 引入 echarts.js -->
  16. <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
  17. <!--可用來建立使用者小圖示-->
  18. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  19. <style>
  20. body {
  21. margin:0;
  22. }
  23. .navbar-dark .navbar-nav .nav-link {
  24. color: white;
  25. cursor: pointer;
  26. text-decoration:none;
  27. width: 110px;
  28. height: 46px;
  29. }
  30. .nav-top {
  31. line-height:40px;
  32. background-color: #C4C4C4;
  33. }
  34. .website_title{
  35. font-family: Roboto;
  36. font-style: normal;
  37. font-weight: normal;
  38. font-size: 30px;
  39. color: #000000;
  40. }
  41. .navbar-nav > li{
  42. float: none;
  43. display: inline-block;
  44. width: 110px;
  45. margin: 0 auto;
  46. text-align: center;
  47. }
  48. .navbar-nav > li a{
  49. font-size: 20px;
  50. }
  51. .main-page {
  52. margin-top: 150px;
  53. }
  54. .div-title {
  55. font-family: Roboto;
  56. font-style: normal;
  57. font-weight: bold;
  58. font-size: 36px;
  59. }
  60. .sensor {
  61. margin-top: 50px;
  62. }
  63. .flex {
  64. display: flex;
  65. flex-direction: row;
  66. flex-wrap: wrap;
  67. justify-content: center;
  68. }
  69. .set-link {
  70. display: inline-block;
  71. width: 350px;
  72. height: 100px;
  73. line-height: 100px;
  74. background: #008CBA;
  75. border: 1px solid #CFCFCF;
  76. box-sizing: border-box;
  77. color: #FFFFFF;
  78. border-radius: 10px;
  79. font-size: 36px;
  80. }
  81. .td_in {
  82. margin-top:10%;
  83. border-radius: 15px;
  84. text-align: center;
  85. background-color:#C4C4C4;
  86. width:150px;
  87. height: 100px;
  88. margin:auto;
  89. }
  90. .td_in:hover {
  91. cursor:pointer;
  92. }
  93. .sensor_status {
  94. width: 200px;
  95. height: 170px;
  96. background: #FFFFFF;
  97. border: 1px solid #CFCFCF;
  98. box-sizing: border-box;
  99. color: #000000;
  100. border-radius: 5px;
  101. font-size: 24px;
  102. margin:auto;
  103. }
  104. .show-info{
  105. position: absolute;
  106. background-color: #FFFFFF;
  107. border: 1px solid #949494;
  108. box-sizing: border-box;
  109. z-index: 3;
  110. left: 8%;
  111. }
  112. .show-info > h1 {
  113. text-align: center;
  114. }
  115. .show-chart {
  116. height: 500px;
  117. border: 2px solid #FFF;
  118. background: #C4C4C4;
  119. }
  120. .btn-input input{
  121. background: #008CBA;
  122. border: 1px solid #CFCFCF;
  123. box-sizing: border-box;
  124. border-radius: 5px;
  125. width: 120px;
  126. height: 58px;
  127. text-align: center;
  128. line-height: 58px;
  129. font-size: 20px;
  130. margin-top: 50px;
  131. color: #FFFFFF;
  132. }
  133. .fa{
  134. display: inline-block;
  135. font: normal normal normal 14px/1 FontAwesome;
  136. font-size: inherit;
  137. text-rendering: auto;
  138. -webkit-font-smoothing: antialiased;
  139. }
  140. .fa-user-o:before{
  141. content: "\f2c0";
  142. }
  143. button {
  144. cursor: pointer;
  145. }
  146. @media(max-width:373px){
  147. .card {
  148. margin-right: 0px;
  149. }
  150. }
  151. @media(max-width:577px){
  152. }
  153. @media(min-width:576px){
  154. }
  155. @media(min-width:768px){
  156. .navbar-nav > li {
  157. margin-left: 0px;
  158. }
  159. .navbar-nav .li-block {
  160. display:none;
  161. }
  162. }
  163. @media(min-width:991px){
  164. .navbar-nav > li {
  165. margin-left: 20px;
  166. }
  167. .navbar-nav .li-block {
  168. display:none;
  169. }
  170. .sensor {
  171. margin-right: 0px;
  172. }
  173. .btn-input input:last-child{
  174. margin-left:100px;
  175. }
  176. }
  177. @media(min-width:1200px){
  178. .navbar-nav > li {
  179. margin-left: 35px;
  180. }
  181. .navbar-nav .li-block {
  182. display: inline-block;
  183. width: 100px;
  184. }
  185. .sensor {
  186. margin-right: 0px;
  187. }
  188. .btn-input input:last-child{
  189. margin-left:100px;
  190. }
  191. }
  192. @media(min-width:1400px){
  193. .navbar-nav .li-block {
  194. display: inline-block;
  195. width: 200px;
  196. }
  197. .sensor {
  198. margin-right: 0px;
  199. }
  200. .btn-input input:last-child{
  201. margin-left:100px;
  202. }
  203. }
  204. @media(min-width:1689px) {
  205. .navbar-nav > li {
  206. margin-left: 50px;
  207. }
  208. .navbar-nav .li-block {
  209. display: inline-block;
  210. width: 500px;
  211. }
  212. .sensor {
  213. margin-right: 0px;
  214. }
  215. .btn-input input:last-child{
  216. margin-left:100px;
  217. }
  218. }
  219. </style>
  220. <script>
  221. function Echart(evt){
  222. <!--$("#" + evt + "-div").css('display','block');-->
  223. //基於準備好的dom,初始化echarts例項
  224. var myChart = echarts.init(document.getElementsByClassName('show-chart')[0]);
  225. //指定圖表的配置項和資料
  226. var option = {
  227. xAxis: {
  228. type: 'category',
  229. data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021']
  230. },
  231. yAxis: {
  232. type: 'value'
  233. },
  234. series: [{
  235. data: [820, 932, 901, 934, 1290, 1330, 1320],
  236. type: 'line'
  237. }]
  238. };
  239. //使用剛指定的配置項和資料顯示圖表
  240. myChart.setOption(option);
  241. };
  242. //下載檔案函數
  243. function downloadFile() {
  244. //藉型別陣列建構的 blob 來建立 URL
  245. let fileName = "fileName.csv";
  246. const data = getRandomData();
  247. let blob = new Blob([data], {
  248. type: "application/octet-stream"
  249. });
  250. var href = URL.createObjectURL(blob);
  251. // 從 Blob 取出資料
  252. var link = document.createElement("a");
  253. document.body.appendChild(link);
  254. link.href = href;
  255. link.download = fileName;
  256. link.click();
  257. };
  258. //假資料函數
  259. function getRandomData() {
  260. var header = "RandomHeader";
  261. var data = "";
  262. for (let i = 0; i < 5; i++) {
  263. for (var j = 0; j < 2; j++) {
  264. if (j > 0) {
  265. data = data + ",";
  266. }
  267. data = data + "Item" + i + "_" + j;
  268. }
  269. }
  270. return header + data;
  271. };
  272. function ShowInfoHTML(){
  273. var html = '';
  274. html += '<div id="" class="show-info col-xl-10 col-lg-10 col-md-10 col-sm-10 col-xs-10" style="display: none;">';
  275. html += '<br>';
  276. html += '<h1></h1>';
  277. html += '<center>';
  278. html += '<select name="date" class="text-right">';
  279. html += '<option value="year">year</option>';
  280. html += '<option value="month">month</option>';
  281. html += '<option value="day">day</option>';
  282. html += '</select>';
  283. html += '<span>從</span>';
  284. html += '<label for="start"></label><input id="start" type="date">';
  285. html += '<span>到</span>';
  286. html += '<label for="end"></label><input id="end" type="date">';
  287. html += '<span>為止</span>';
  288. html += '<input type="button" value="查詢" onclick="Echart(\'\');">';
  289. html += '</center>';
  290. html += '<div class="row">';
  291. html += '<div class="col-1"></div>';
  292. html += '<div class="col-10 show-chart" style="margin-top: 10px;text-align:center;"></div>';
  293. html += '<div class="col-1"></div>';
  294. html += '</div>';
  295. html += '<div class="btn-input" style="text-align:center;">';
  296. html += '<input type="button" value="關閉" style="margin-left:0px;" onclick="CloseInfo()">';
  297. html += '<input class="" type="button" value="匯出">';
  298. html += '</div>';
  299. html += '</div>';
  300. return html;
  301. };
  302. function Module(module, obj){
  303. var sensor_html = '';
  304. sensor_html += '<div class="sensor col-xl-3 col-lg-3 col-md-3 col-sm-8 col-xs-8" style="text-align:center;">';
  305. sensor_html += '<div class="div-title text-center">';
  306. sensor_html += '<div class="sensor_status">';
  307. sensor_html += '<div class="sensor_title" style="">';
  308. sensor_html += '<label>' + module + '</label>';
  309. sensor_html += '</div>';
  310. sensor_html += '<div id="' + obj + '" class="td_in" onclick="ShowInfo(' + '\'' + module + '\',\'' + obj + '\');"></div>';
  311. sensor_html += '</div>';
  312. sensor_html += '</div>';
  313. sensor_html += '</div>';
  314. return sensor_html;
  315. };
  316. var sensor_list = "";
  317. $.each({{params.sensor_list|tojson}},function(index, obj){
  318. sensor_list += "if(obj == '" + obj.en_name + "'){html += Module('" + obj.ch_name + obj.version + "',obj);};";
  319. });
  320. function Monitor(arr){
  321. var html = '';
  322. $.each(arr, function(index, obj){
  323. <!--if(obj == 'airTem'){-->
  324. <!--html += Module('空氣溫度', obj);-->
  325. <!--}else if(obj == 'airHum'){-->
  326. <!--html += Module('空氣濕度', obj);-->
  327. <!--}else if(obj == 'dewPoint'){-->
  328. <!--html += Module('露點', obj);-->
  329. <!--}else if(obj == 'sun'){-->
  330. <!--html += Module('日照', obj);-->
  331. <!--}else if(obj == 'soilHum'){-->
  332. <!--html += Module('土壤含水率', obj);-->
  333. <!--}else if(obj == 'soilTem'){-->
  334. <!--html += Module('土壤溫度', obj);-->
  335. <!--}else if(obj == 'soilEC'){-->
  336. <!--html += Module('土壤EC值', obj);-->
  337. <!--}else if(obj == 'windSpd'){-->
  338. <!--html += Module('風速', obj);-->
  339. <!--}else if(obj == 'windDin'){-->
  340. <!--html += Module('風向', obj);-->
  341. <!--}else if(obj == 'rain'){-->
  342. <!--html += Module('降雨量', obj);-->
  343. <!--}else if(obj == 'atmosphere'){-->
  344. <!--html += Module('大氣壓', obj);-->
  345. <!--};-->
  346. eval(sensor_list);
  347. });
  348. return html;
  349. };
  350. //改變監控功能後端抓取資料函數
  351. function MonitorChange(){
  352. var monitor = $("#monitor").val();
  353. var json = {"monitor":monitor};
  354. var sensor = document.getElementById('sensor_list');
  355. sensor.innerHTML = '';
  356. var sensor_html = '';
  357. $.get("/monitor/" + {{params.tid}}, json, function(resText){
  358. var module_list = resText;
  359. sensor_html += Monitor(module_list);
  360. sensor_html += ShowInfoHTML();
  361. sensor.innerHTML += sensor_html;
  362. }, 'json');
  363. };
  364. $(function(){
  365. //監聽可嘗試用eval函數做,循環便歷每個感測器
  366. <!--//監聽airTem匯出-->
  367. <!--let airTemDownloadBtn = document.querySelector(".airTemDownloadBtn");-->
  368. <!--airTemDownloadBtn.addEventListener("click", downloadFile);-->
  369. <!--//監聽airHum匯出-->
  370. <!--let airHumDownloadBtn = document.querySelector(".airHumDownloadBtn");-->
  371. <!--airHumDownloadBtn.addEventListener("click", downloadFile);-->
  372. {% if params.monitor_num %}
  373. var node_list = document.getElementById('node_list');
  374. var html = '';
  375. for(var i=1; i<={{params.monitor_num}}; i++){
  376. html += '<a href="/env_info/' + i + '"><button class="btn btn-primary btn-lg" style="margin-top:5px;margin-bottom:5px">' + i + '</button></a> ';
  377. };
  378. node_list.innerHTML = html;
  379. {% endif %}
  380. {% if params.first_monitor %}
  381. var first_monitor = JSON.parse({{params.first_monitor|tojson}});
  382. var monitor = document.getElementById('monitor');
  383. var monitor_html = '';
  384. var sensor = document.getElementById('sensor_list');
  385. var sensor_html = '';
  386. if(first_monitor.weather){
  387. monitor_html += '<option value="weather">氣象站</option>';
  388. sensor_html += Monitor(first_monitor.weather);
  389. };
  390. if(first_monitor.irrigation){
  391. monitor_html += '<option value="irrigation">灌溉</option>';
  392. if(!first_monitor.weather){
  393. sensor_html += Monitor(first_monitor.irrigation);
  394. };
  395. };
  396. if(first_monitor.water){
  397. monitor_html += '<option value="water">水質</option>';
  398. if(!first_monitor.irrigation && !first_monitor.weather){
  399. sensor_html += Monitor(first_monitor.water);
  400. };
  401. };
  402. monitor.innerHTML = monitor_html;
  403. sensor.innerHTML += sensor_html;
  404. {% endif %}
  405. });
  406. </script>
  407. </head>
  408. <body>
  409. <nav class="fixed-top">
  410. <nav class="navbar navbar-expand-md nav-top justify-content-center">
  411. <div>
  412. <span class="website_title">環境資訊</span>
  413. </div>
  414. </nav>
  415. <nav class="navbar navbar-expand-md bg-dark navbar-dark nav-bottom">
  416. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
  417. <span class="navbar-toggler-icon"></span>
  418. </button>
  419. <div class="collapse navbar-collapse" id="collapsibleNavbar">
  420. <ul class="navbar-nav">
  421. <li class="nav-item">
  422. <a class="nav-link" href="/">首頁</a>
  423. </li>
  424. <li class="nav-item">
  425. <a class="nav-link" href="/env_info/1">環境資訊</a>
  426. </li>
  427. <li class="nav-item">
  428. <a class="nav-link" href="#">報表輸出</a>
  429. </li>
  430. <li class="nav-item">
  431. <a class="nav-link" href="#">RMA</a>
  432. </li>
  433. <li class="nav-item">
  434. <a class="nav-link" href="/map">故障紀錄</a>
  435. </li>
  436. <li class="nav-item">
  437. <a class="nav-link" href="/system_status">求助</a>
  438. </li>
  439. <li class="li-block"></li>
  440. <li class="nav-item">
  441. <a class="nav-link" href="#"><i class="fa fa-user-o"></i> {{params.username}}</a>
  442. </li>
  443. <li class="nav-item">
  444. <a class="nav-link" href="/logout">Logout</a>
  445. </li>
  446. </ul>
  447. </div>
  448. </nav>
  449. </nav>
  450. <div class="main-page">
  451. <div class="container">
  452. <div class="row">
  453. <div class="col flex">
  454. <div class="col-12 text-center">
  455. <h1 style="">節點{{params.tid}}</h1>
  456. </div>
  457. <div id="node_list" class="col-12 text-center" style="margin-top:20px;">
  458. </div>
  459. <div class="col-12 text-center" style="margin-top:20px;">
  460. 監控功能 :
  461. <select id="monitor" name="monitor">
  462. <option value="weather">氣象站</option>
  463. <option value="irrigation">灌溉</option>
  464. <option value="water">水質</option>
  465. </select>
  466. <button type="button" onclick="MonitorChange();">查詢</button>
  467. </div>
  468. <div id="sensor_list" class="col-12 row text-center">
  469. <form action="" method="">
  470. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  471. <!--<div class="div-title text-center">-->
  472. <!--<div class="sensor_status">-->
  473. <!--<div class="sensor_title" style="">-->
  474. <!--<label>空氣溫度</label>-->
  475. <!--</div>-->
  476. <!--<div id="airTem" class="td_in" style=""></div>-->
  477. <!--</div>-->
  478. <!--</div>-->
  479. <!--</div>-->
  480. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  481. <!--<div class="div-title text-center">-->
  482. <!--<div class="sensor_status">-->
  483. <!--<div class="sensor_title" style="">-->
  484. <!--<label>空氣濕度</label>-->
  485. <!--</div>-->
  486. <!--<div id="airHum" class="td_in" style=""></div>-->
  487. <!--</div>-->
  488. <!--</div>-->
  489. <!--</div>-->
  490. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  491. <!--<div class="div-title text-center">-->
  492. <!--<div class="sensor_status">-->
  493. <!--<div class="sensor_title" style="">-->
  494. <!--<label>露點</label>-->
  495. <!--</div>-->
  496. <!--<div id="dewPoint" class="td_in" style=""></div>-->
  497. <!--</div>-->
  498. <!--</div>-->
  499. <!--</div>-->
  500. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  501. <!--<div class="div-title text-center">-->
  502. <!--<div class="sensor_status">-->
  503. <!--<div class="sensor_title" style="">-->
  504. <!--<label>日照</label>-->
  505. <!--</div>-->
  506. <!--<div id="sun" class="td_in" style=""></div>-->
  507. <!--</div>-->
  508. <!--</div>-->
  509. <!--</div>-->
  510. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  511. <!--<div class="div-title text-center">-->
  512. <!--<div class="sensor_status">-->
  513. <!--<div class="sensor_title" style="">-->
  514. <!--<label>土壤含水率</label>-->
  515. <!--</div>-->
  516. <!--<div id="soilHum" class="td_in" style=""></div>-->
  517. <!--</div>-->
  518. <!--</div>-->
  519. <!--</div>-->
  520. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  521. <!--<div class="div-title text-center">-->
  522. <!--<div class="sensor_status">-->
  523. <!--<div class="sensor_title" style="">-->
  524. <!--<label>土壤溫度</label>-->
  525. <!--</div>-->
  526. <!--<div id="soilTem" class="td_in" style=""></div>-->
  527. <!--</div>-->
  528. <!--</div>-->
  529. <!--</div>-->
  530. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  531. <!--<div class="div-title text-center">-->
  532. <!--<div class="sensor_status">-->
  533. <!--<div class="sensor_title" style="">-->
  534. <!--<label>土壤EC值</label>-->
  535. <!--</div>-->
  536. <!--<div id="soilEC" class="td_in" style=""></div>-->
  537. <!--</div>-->
  538. <!--</div>-->
  539. <!--</div>-->
  540. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  541. <!--<div class="div-title text-center">-->
  542. <!--<div class="sensor_status">-->
  543. <!--<div class="sensor_title" style="">-->
  544. <!--<label>風速</label>-->
  545. <!--</div>-->
  546. <!--<div id="windSpd" class="td_in" style=""></div>-->
  547. <!--</div>-->
  548. <!--</div>-->
  549. <!--</div>-->
  550. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  551. <!--<div class="div-title text-center">-->
  552. <!--<div class="sensor_status">-->
  553. <!--<div class="sensor_title" style="">-->
  554. <!--<label>風向</label>-->
  555. <!--</div>-->
  556. <!--<div id="windDin" class="td_in" style=""></div>-->
  557. <!--</div>-->
  558. <!--</div>-->
  559. <!--</div>-->
  560. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  561. <!--<div class="div-title text-center">-->
  562. <!--<div class="sensor_status">-->
  563. <!--<div class="sensor_title" style="">-->
  564. <!--<label>降雨量</label>-->
  565. <!--</div>-->
  566. <!--<div id="rain" class="td_in" style=""></div>-->
  567. <!--</div>-->
  568. <!--</div>-->
  569. <!--</div>-->
  570. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  571. <!--<div class="div-title text-center">-->
  572. <!--<div class="sensor_status">-->
  573. <!--<div class="sensor_title" style="">-->
  574. <!--<label>大氣壓</label>-->
  575. <!--</div>-->
  576. <!--<div id="atmosphere" class="td_in" style=""></div>-->
  577. <!--</div>-->
  578. <!--</div>-->
  579. <!--</div>-->
  580. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  581. <!--<div class="div-title text-center">-->
  582. <!--<div class="sensor_status">-->
  583. <!--<div class="sensor_title" style="">-->
  584. <!--<label>RF</label>-->
  585. <!--</div>-->
  586. <!--<div class="td_in" style=""></div>-->
  587. <!--</div>-->
  588. <!--</div>-->
  589. <!--</div>-->
  590. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;">-->
  591. <!--<div class="div-title text-center">-->
  592. <!--<div class="sensor_status">-->
  593. <!--<div class="sensor_title" style="">-->
  594. <!--<label><img src="../static/img/battery.png" style="width:40px;"></label>-->
  595. <!--</div>-->
  596. <!--<div class="td_in" style=""></div>-->
  597. <!--</div>-->
  598. <!--</div>-->
  599. <!--</div>-->
  600. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;"></div>-->
  601. <!--<div class="sensor col-xl-2 col-lg-2 col-md-2 col-sm-8 col-xs-8" style="text-align:center;"></div>-->
  602. <div id="" class="show-info col-xl-10 col-lg-10 col-md-10 col-sm-10 col-xs-10" style="display: none;">
  603. <br>
  604. <h1></h1>
  605. <center>
  606. <select name="date" class="text-right">
  607. <option value="year">year</option>
  608. <option value="month">month</option>
  609. <option value="day">day</option>
  610. </select>
  611. <span>從</span>
  612. <label for="start"></label><input id="start" type="date">
  613. <span>到</span>
  614. <label for="end"></label><input id="end" type="date">
  615. <span>為止</span>
  616. <input type="button" value="查詢" onclick="Echart('');">
  617. </center>
  618. <div class="row">
  619. <div class="col-1"></div>
  620. <div class="col-10 show-chart" style="margin-top: 10px;text-align:center;"></div>
  621. <div class="col-1"></div>
  622. </div>
  623. <div class="btn-input" style="text-align:center;">
  624. <input type="button" value="關閉" style="margin-left:0px;" onclick="CloseInfo()">
  625. <input class="" type="button" value="匯出">
  626. </div>
  627. </div>
  628. <!--<div id="airTem-div" class="show-info col-xl-10 col-lg-10 col-md-10 col-sm-10 col-xs-10" style="display: none;">-->
  629. <!--<br>-->
  630. <!--<h1>空氣溫度</h1>-->
  631. <!--<center>-->
  632. <!--<select name="airTem-day" class="text-right">-->
  633. <!--<option value="year">year</option>-->
  634. <!--<option value="month">month</option>-->
  635. <!--<option value="day">day</option>-->
  636. <!--</select>-->
  637. <!--<span>從</span>-->
  638. <!--<label for="airTem-start"></label><input id="airTem-start" type="date">-->
  639. <!--<span>到</span>-->
  640. <!--<label for="airTem-end"></label><input id="airTem-end" type="date">-->
  641. <!--<span>為止</span>-->
  642. <!--<input type="button" value="查詢" onclick="Echart('airTem');">-->
  643. <!--</center>-->
  644. <!--<div class="row">-->
  645. <!--<div class="col-1"></div>-->
  646. <!--<div class="col-10 airTem show-chart" style="margin-top: 10px;text-align:center;"></div>-->
  647. <!--<div class="col-1"></div>-->
  648. <!--</div>-->
  649. <!--<div class="btn-input" style="text-align:center;">-->
  650. <!--<input type="button" value="關閉" style="margin-left:0px;" class="airTem-cancel">-->
  651. <!--<input class="airTemdownloadBtn" type="button" value="匯出">-->
  652. <!--</div>-->
  653. <!--</div>-->
  654. <!--<div id="airHum-div" class="show-info col-xl-10 col-lg-10 col-md-10 col-sm-10 col-xs-10" style="display: none;">-->
  655. <!--<br>-->
  656. <!--<h1>空氣濕度</h1>-->
  657. <!--<center>-->
  658. <!--<select name="airHum-day" class="text-right">-->
  659. <!--<option value="year">year</option>-->
  660. <!--<option value="month">month</option>-->
  661. <!--<option value="day">day</option>-->
  662. <!--</select>-->
  663. <!--<span>從</span>-->
  664. <!--<label for="airHum-start"></label><input id="airHum-start" type="date">-->
  665. <!--<span>到</span>-->
  666. <!--<label for="airHum-end"></label><input id="airHum-end" type="date">-->
  667. <!--<span>為止</span>-->
  668. <!--<input type="button" value="查詢" onclick="Echart('airHum');">-->
  669. <!--</center>-->
  670. <!--<div class="row">-->
  671. <!--<div class="col-1"></div>-->
  672. <!--<div class="col-10 airHum show-chart" style="margin-top: 10px;text-align:center;"></div>-->
  673. <!--<div class="col-1"></div>-->
  674. <!--</div>-->
  675. <!--<div class="btn-input" style="text-align:center;">-->
  676. <!--<input type="button" value="關閉" style="margin-left:0px;" class="airHum-cancel">-->
  677. <!--<input class="airHumdownloadBtn" type="button" value="匯出">-->
  678. <!--</div>-->
  679. <!--</div>-->
  680. </form>
  681. </div>
  682. </div>
  683. </div>
  684. </div>
  685. </div>
  686. </body>
  687. <script>
  688. function ShowInfo(module, obj){
  689. $(".show-info").css('display','block');
  690. $(".show-info h1").text(module);
  691. $("input[value=查詢]").attr('onclick', 'Echart(\'node' + {{params.tid}} + '-' + obj + '\')');
  692. $("input[value=匯出]").attr('class', obj + 'DownloadBtn');
  693. let DownloadBtn = document.querySelector("." + obj + "DownloadBtn");
  694. DownloadBtn.addEventListener("click", downloadFile);
  695. };
  696. function CloseInfo(){
  697. $(".show-info").css('display','none');
  698. };
  699. </script>
  700. </html>