optim.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. {% extends "index.html" %}
  2. {% block title %}智能最佳化{% endblock %}
  3. {% block head %}
  4. {{ super() }}
  5. {% endblock %}
  6. {% block body %}
  7. <div id="select_histories">
  8. <div id="select_histories_1">
  9. <select>
  10. <option></option>
  11. </select>
  12. <button id="search">搜尋</button>
  13. </div>
  14. </div>
  15. <div id="tower_temperature">
  16. <div id="tower_temperature">
  17. <div scr="hot_water" style="width: 300px;height:300px;color: #26b72b;float:left">熱水溫度</div>
  18. <font size="1">Hot temp: {{ temp }}</font><br>
  19. <div id="cold_water" style="width: 300px;height:300px;color: #8600FF;float:left">冷水溫度</div>
  20. <font size="1">Cold temp: {{ temp2 }}</font><br>
  21. <div id="wet_water" style="width: 300px;height:300px;color: #737300;float:left">濕球溫度</div>
  22. <font size="1">Wet temp: {{ temp3 }}</font><br>
  23. </div>
  24. <style>
  25. table {
  26. font-family: arial, sans-serif;
  27. border-collapse: collapse;
  28. width: 50%;
  29. }
  30. td, th {
  31. border: 1px solid #dddddd;
  32. text-align: left;
  33. padding: 8px;
  34. }
  35. tr:nth-child(even) {
  36. background-color: #dddddd;
  37. }
  38. </style>
  39. <body>
  40. <table>
  41. <tr>
  42. <th>當前狀態</th>
  43. <th></th>
  44. </tr>
  45. <tr>
  46. <td>水流量</td>
  47. <td>M*3/H</td>
  48. </tr>
  49. <tr>
  50. <td>風扇數</td>
  51. <td>台</td>
  52. </tr>
  53. </table>
  54. <table>
  55. <tr>
  56. <th>效能最佳化</th>
  57. <th></th>
  58. </tr>
  59. <tr>
  60. <th>目前溫度</th>
  61. <th>度C</th>
  62. </tr>
  63. <tr>
  64. <td>流量建議調整為</td>
  65. <td>M*3/H</td>
  66. </tr>
  67. <tr>
  68. <td>可節省水費</td>
  69. <td>元/天</td>
  70. </tr>
  71. <tr>
  72. <td>風扇建議調整為</td>
  73. <td>台</td>
  74. </tr>
  75. <tr>
  76. <td>可節省電費</td>
  77. <td>元/天</td>
  78. </tr>
  79. <tr>
  80. <td>總節省費用</td>
  81. <td>元/天</td>
  82. </tr>
  83. </table>
  84. <script type="text/javascript">
  85. var hot_water = echarts.init(document.getElementById("hot_water"));
  86. var cold_water = echarts.init(document.getElementById("cold_water"));
  87. var wet_water = echarts.init(document.getElementById("wet_water"));
  88. let date = transform_time_to_string(new Date());
  89. fetch(`/temperature/date=${date}`)
  90. .then(function(response) {
  91. return response.json();
  92. })
  93. .then(function(myJson) {
  94. // 配置圖表資訊
  95. console.log(myJson);
  96. option = {
  97. series: [{
  98. type: 'liquidFill',
  99. data: myJson['hot_water']
  100. }]
  101. };
  102. hot_water.setOption(option);
  103. option = {
  104. series: [{
  105. type: 'liquidFill',
  106. data: myJson['cold_water']
  107. }]
  108. };
  109. cold_water.setOption(option);
  110. option = {
  111. series: [{
  112. type: 'liquidFill',
  113. data: myJson['wet_water']
  114. }]
  115. };
  116. wet_water.setOption(option);
  117. });
  118. </script>
  119. <script>$(function() {
  120. $('.progress-fill span').each(function(){
  121. var percent = $(this).html();
  122. $(this).parent().css('width', percent);
  123. });
  124. });</script>
  125. <style>
  126. .container {
  127. width: 500px;
  128. margin: 20px;
  129. background: #fff;
  130. padding: 20px;
  131. overflow: hidden;
  132. float: left;
  133. }
  134. .horizontal .progress-bar {
  135. float: left;
  136. height: 18px;
  137. width: 100%;
  138. padding: 3px 0;
  139. }
  140. .horizontal .progress-track {
  141. position: relative;
  142. width: 100%;
  143. height: 20px;
  144. background: #ebebeb;
  145. }
  146. .horizontal .progress-fill {
  147. position: relative;
  148. background: #666;
  149. height: 20px;
  150. width: 50%;
  151. color: #fff;
  152. text-align: center;
  153. font-family: "Lato","Verdana",sans-serif;
  154. font-size: 12px;
  155. line-height: 20px;
  156. }
  157. .progress-group {
  158. display: flex;
  159. }
  160. .progress-label {
  161. width: 170px;
  162. text-align: right;
  163. padding-right: 10px;
  164. }
  165. .progress-label::after {
  166. content: ":";
  167. }
  168. </style>>
  169. <div class="container horizontal flat">
  170. <h2>測試驗證</h2>
  171. <div class="progress-group">
  172. <div class="progress-label">測試</div>
  173. <div class="progress-bar horizontal">
  174. <div class="progress-track">
  175. <div class="progress-fill">
  176. <span>100%</span>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="progress-group">
  182. <div class="progress-label">水流量</div>
  183. <div class="progress-bar horizontal">
  184. <div class="progress-track">
  185. <div class="progress-fill">
  186. <span>75%</span>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. <div class="progress-group">
  192. <div class="progress-label">風扇數</div>
  193. <div class="progress-bar horizontal">
  194. <div class="progress-track">
  195. <div class="progress-fill">
  196. <span>60%</span>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <div class="progress-group">
  202. <div class="progress-label">濕求溫度</div>
  203. <div class="progress-bar horizontal">
  204. <div class="progress-track">
  205. <div class="progress-fill">
  206. <span>20%</span>
  207. </div>
  208. </div>
  209. </div>
  210. </div>
  211. <div class="progress-group">
  212. <div class="progress-label">熱水溫度</div>
  213. <div class="progress-bar horizontal">
  214. <div class="progress-track">
  215. <div class="progress-fill">
  216. <span>34%</span>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. {% endblock %}