optim.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. {% extends "index.html" %}
  2. {% block title %}智能最佳化{% endblock %}
  3. {% block head %}
  4. {{ super() }}
  5. {% endblock %}
  6. {% block body %}
  7. <script type="text/javascript" src="/static/tower.js"></script>
  8. <div id='select_boxes'>
  9. <select class="select-item" id="company-list" onChange="onChangeColumn1();">
  10. <option value=0>公司</option>
  11. </select>
  12. <select class="select-item" id="factory-list" onChange="onChangeColumn2();">
  13. <option value=0>工廠</option>
  14. </select>
  15. <select class="select-item" id="department-list" onChange="onChangeColumn3();">
  16. <option value=0>廠區</option>
  17. </select>
  18. <select class="select-item" id="towerGroup-list">
  19. <option value=0>機組</option>
  20. </select>
  21. <button id="tower_btn" onclick="click_button();"><i class="fas fa-search me-2"></i>搜尋</button>
  22. </div>
  23. <body>
  24. <div id="tower_temperature">
  25. <div id="tower_temperature">
  26. <div class="row px-0 mx-0">
  27. <div class="col-lg-4">
  28. <div scr="hot_water" class="fw-bold">
  29. <h1><i style="color:#FF0000;" class="fas fa-thermometer-half me-2"></i>熱水溫度(°C)</h1>
  30. <div id="hot_water_data">
  31. <font size="1">{{ x }}</font><br>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="col-lg-4 text-center">
  36. <div id="cold_water" class="fw-bold">
  37. <h1><i style="color:#0174c7;" class="fas fa-thermometer-half me-2"></i>冷水溫度(°C)</h1>
  38. <font size="1">{{ y }}</font><br>
  39. </div>
  40. </div>
  41. <div class="col-lg-4 text-end">
  42. <div id="wet_water" class="fw-bold">
  43. <h1><i style="color:#3dba1e;" class="fas fa-thermometer-half me-2"></i>濕球溫度(°C)</h1>
  44. <font size="1">{{ z }}</font><br>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <script>
  50. const chart = echarts.init(document.getElementById("hot_water_data"));
  51. chart.setOption({
  52. series: [
  53. {
  54. type: "liquidFill",
  55. data: [0.6, 0.5, 0.4, 0.3]
  56. }
  57. ]
  58. });
  59. </script>
  60. <script>
  61. const chart2 = echarts.init(document.getElementById("cold_water_data"));
  62. chart2.setOption({
  63. series: [
  64. {
  65. type: "liquidFill",
  66. data: [0.6, 0.5, 0.4, 0.3]
  67. }
  68. ]
  69. });
  70. </script>
  71. <script>
  72. const chart3 = echarts.init(document.getElementById("wet_water_data"));
  73. chart3.setOption({
  74. series: [
  75. {
  76. type: "liquidFill",
  77. data: [0.6, 0.5, 0.4, 0.3]
  78. }
  79. ]
  80. });
  81. </script>
  82. <!-- css -->
  83. <!-- <style>
  84. table {
  85. font-family: arial, sans-serif;
  86. border-collapse: collapse;
  87. width: 50%;
  88. }
  89. td,
  90. th {
  91. border: 1px solid #dddddd;
  92. text-align: left;
  93. padding: 8px;
  94. }
  95. tr:nth-child(even) {
  96. background-color: #dddddd;
  97. }
  98. </style> -->
  99. <section class="tower_data my-3">
  100. <div class="card">
  101. <div class="row px-0 mx-0">
  102. <div class="col-lg-6">
  103. <h1 class="ps-0">當前狀態</h1>
  104. </div>
  105. <div class="col-lg-6">
  106. <h1 class="ps-0">校能最佳化</h1>
  107. </div>
  108. </div>
  109. <div class="row px-0 mx-0">
  110. <div class="col-lg-6">
  111. <table class="table">
  112. <tr>
  113. <td>水流量</td>
  114. <td>{{ x }} M*3/H</td>
  115. </tr>
  116. <tr>
  117. <td>風扇數</td>
  118. <td>{{ x }} 台</td>
  119. </tr>
  120. </table>
  121. </div>
  122. <div class="col-lg-6">
  123. <table class="table">
  124. <tr>
  125. <th>目前溫度</th>
  126. <th>{{ x }} 度C</th>
  127. </tr>
  128. <tr>
  129. <td>流量建議調整為</td>
  130. <td>{{ x }} M*3/H</td>
  131. </tr>
  132. <tr>
  133. <td>可節省水費</td>
  134. <td>{{ x }} 元/天</td>
  135. </tr>
  136. <tr>
  137. <td>風扇建議調整為</td>
  138. <td>{{ x }} 台</td>
  139. </tr>
  140. <tr>
  141. <td>可節省電費</td>
  142. <td>{{ x }} 元/天</td>
  143. </tr>
  144. <tr>
  145. <td>總節省費用</td>
  146. <td>{{ x }} 元/天</td>
  147. </tr>
  148. </table>
  149. </div>
  150. </div>
  151. </div>
  152. </section>
  153. <!-- <script src="/static/echarts.min.js"></script>
  154. <script src="/static/echarts-liquidfill.js"></script>
  155. <script>
  156. // const chart = echarts.init(document.getElementById("app"));
  157. var hot_water = echarts.init(document.getElementById("app"));
  158. var cold_water = echarts.init(document.getElementById("app2"));
  159. var wet_water = echarts.init(document.getElementById("app3"));
  160. let date = transform_time_to_string(new Date());
  161. fetch(`/temperature/date=${date}`)
  162. .then(function (response) {
  163. return response.json();
  164. })
  165. .then(function (myJson) {
  166. console.log(myJson);
  167. console.log(1);
  168. hot_water.setOption({
  169. series: [
  170. {
  171. type: "liquidFill",
  172. data: [0.6, 0.5, 0.4, 0.3]
  173. }
  174. ]
  175. });
  176. cold_water.setOption({
  177. series: [
  178. {
  179. type: "liquidFill",
  180. data: [0.6, 0.5, 0.4, 0.3]
  181. }
  182. ]
  183. });
  184. wet_water.setOption({
  185. series: [
  186. {
  187. type: "liquidFill",
  188. data: [0.6, 0.5, 0.4, 0.3]
  189. }
  190. ]
  191. });
  192. });
  193. </script> -->
  194. <!-- <script type="text/javascript">
  195. var hot_water = echarts.init(document.getElementById("hot_water"));
  196. var cold_water = echarts.init(document.getElementById("cold_water"));
  197. var wet_water = echarts.init(document.getElementById("wet_water"));
  198. let date = transform_time_to_string(new Date());
  199. fetch(`/temperature/date=${date}`)
  200. .then(function (response) {
  201. return response.json();
  202. })
  203. .then(function (myJson) {
  204. // 配置圖表資訊
  205. console.log(myJson);
  206. option = {
  207. series: [{
  208. type: 'liquidFill',
  209. data: myJson['hot_water']
  210. }]
  211. };
  212. hot_water.setOption(option);
  213. option = {
  214. series: [{
  215. type: 'liquidFill',
  216. data: myJson['cold_water']
  217. }]
  218. };
  219. cold_water.setOption(option);
  220. option = {
  221. series: [{
  222. type: 'liquidFill',
  223. data: myJson['wet_water']
  224. }]
  225. };
  226. wet_water.setOption(option);
  227. });
  228. </script> -->
  229. <!-- css -->
  230. <!-- <style>
  231. .horizontal .progress-bar {
  232. float: left;
  233. height: 50px;
  234. width: 100%;
  235. padding: 3px 0;
  236. }
  237. .horizontal .progress-track {
  238. position: relative;
  239. width: 100%;
  240. height: 50px;
  241. background: #ebebeb;
  242. }
  243. .horizontal .progress-fill {
  244. position: relative;
  245. background: #2883fa;
  246. height: 50px;
  247. width: 50%;
  248. color: #080707;
  249. text-align: center;
  250. font-family: "Lato", "Verdana", sans-serif;
  251. font-size: 16px;
  252. line-height: 20px;
  253. }
  254. .horizontal .progress-fill2 {
  255. position: relative;
  256. background: #ba711e;
  257. height: 50px;
  258. width: 50%;
  259. color: #080707;
  260. text-align: center;
  261. font-family: "Lato", "Verdana", sans-serif;
  262. font-size: 16px;
  263. line-height: 20px;
  264. }
  265. .horizontal .progress-fill3 {
  266. position: relative;
  267. background: #3dba1e;
  268. height: 50px;
  269. width: 50%;
  270. color: #080707;
  271. text-align: center;
  272. font-family: "Lato", "Verdana", sans-serif;
  273. font-size: 16px;
  274. line-height: 20px;
  275. }
  276. .horizontal .progress-fill4 {
  277. position: relative;
  278. background: #f0ff1f;
  279. height: 50px;
  280. width: 50%;
  281. color: #080707;
  282. text-align: center;
  283. font-family: "Lato", "Verdana", sans-serif;
  284. font-size: 16px;
  285. line-height: 20px;
  286. }
  287. .progress-label {
  288. width: 170px;
  289. text-align: right;
  290. padding-right: 10px;
  291. font-size: 16px;
  292. }
  293. .progress-group {
  294. display: flex;
  295. }
  296. .progress-label::after {
  297. content: ":";
  298. }
  299. </style> -->
  300. <div class="card mt-5">
  301. <div class="horizontal flat">
  302. <h1><i style="color:#0174c7;" class="far fa-chart-bar me-1"></i>測試驗證</h1>
  303. <div class="progress-group">
  304. <div class="progress-label d-flex align-items-center justify-content-end">水流量</div>
  305. <div class="progress-bar horizontal my-2">
  306. <div class="progress-track">
  307. <div class="progress-fill d-flex align-items-center justify-content-center">
  308. <span>100%</span>
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. <div class="progress-group">
  314. <div class="progress-label d-flex align-items-center justify-content-end">風扇數</div>
  315. <div class="progress-bar horizontal my-2">
  316. <div class="progress-track">
  317. <div class="progress-fill2 d-flex align-items-center justify-content-center">
  318. <span>75%</span>
  319. </div>
  320. </div>
  321. </div>
  322. </div>
  323. <div class="progress-group">
  324. <div class="progress-label d-flex align-items-center justify-content-end">濕求溫度</div>
  325. <div class="progress-bar horizontal my-2">
  326. <div class="progress-track">
  327. <div class="progress-fill3 d-flex align-items-center justify-content-center">
  328. <span>60%</span>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. <div class="progress-group">
  334. <div class="progress-label d-flex align-items-center justify-content-end">熱水溫度</div>
  335. <div class="progress-bar horizontal my-2">
  336. <div class="progress-track">
  337. <div class="progress-fill4 d-flex align-items-center justify-content-center">
  338. <span>20%</span>
  339. </div>
  340. </div>
  341. </div>
  342. </div>
  343. </div>
  344. <script>$(function () {
  345. $('.progress-fill span').each(function () {
  346. var percent = $(this).html();
  347. $(this).parent().css('width', percent);
  348. });
  349. $('.progress-fill2 span').each(function () {
  350. var percent = $(this).html();
  351. $(this).parent().css('width', percent);
  352. });
  353. $('.progress-fill3 span').each(function () {
  354. var percent = $(this).html();
  355. $(this).parent().css('width', percent);
  356. });
  357. $('.progress-fill4 span').each(function () {
  358. var percent = $(this).html();
  359. $(this).parent().css('width', percent);
  360. });
  361. });</script>
  362. {% endblock %}