board.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <!-- 宣告我們要套用模板 -->
  2. {% extends "base.html" %}
  3. {% block title %}{{ title }}{% endblock %}
  4. {% block script %}
  5. <script>
  6. var status = '{{status}}';
  7. var username = '{{username}}';
  8. $(document).ready(function(){
  9. $('#navbarDropdown_user_pc').text(username);
  10. $('#navbarDropdown_user_phone').text(username);
  11. });
  12. </script>
  13. {% endblock %}
  14. {% block style %}
  15. <style>
  16. /* .boardpic_position {
  17. position: absolute;
  18. top: 80px;
  19. left: 25px;
  20. } */
  21. .r5_position {
  22. position: absolute;
  23. top: 160px;
  24. left: 310px;
  25. width: 40px;
  26. height: 150px;
  27. border-style: solid;
  28. border-color: aqua;
  29. }
  30. .div_relay_css {
  31. position: absolute;
  32. border-style: solid;
  33. border-color: aqua;
  34. text-align: center;
  35. font-size: 12px;
  36. }
  37. /* header */
  38. /* 文字輸入框 */
  39. .input-text {
  40. height: 25px;
  41. width: 40px;
  42. text-align: center;
  43. margin-left: 2px;
  44. margin-right: 5px;
  45. }
  46. /* 致動器狀態表格置中 */
  47. .label_ActuatorStatus {
  48. margin: auto;
  49. }
  50. /* 致動器 ON 樣式 */
  51. .input-button-on {
  52. color: #008CBA;
  53. border: 2px rgb(182, 181, 181) solid;
  54. background-color: whitesmoke;
  55. padding: 1px 3px;
  56. width: 45px;
  57. }
  58. /* 致動器 OFF 樣式 */
  59. .input-button-off {
  60. color: #707070;
  61. border: 2px rgb(192, 192, 192) solid;
  62. background-color: whitesmoke;
  63. padding: 1px 3px;
  64. width: 45px;
  65. }
  66. /* 輸入按鈕 */
  67. .input-button {
  68. font-size: 14px;
  69. color: #008CBA;
  70. border: 2px rgb(182, 181, 181) solid;
  71. background-color: whitesmoke;
  72. padding: 1px 3px;
  73. }
  74. /* 大表格樣式 */
  75. .table-all {
  76. font-size:18px;
  77. border:2px #cccccc solid;
  78. margin-left: 10px;
  79. margin-right: 10px;
  80. width: 98%;
  81. }
  82. /* footer */
  83. .footer{
  84. height: 40px;
  85. box-sizing: border-box;
  86. /* 設定footer絕對位置在底部 */
  87. position: absolute;
  88. bottom: 0px;
  89. width: 100%;
  90. background-color: #eee;
  91. text-align: center;
  92. }
  93. html, body {
  94. height: 100%;
  95. /* margin: 0; */
  96. position: relative;
  97. }
  98. #wrapper {
  99. /* 設定高度最小為100%, 如果內容區塊很多, 可以長大 */
  100. /* min-height: 100%; */
  101. /* 位置設為relative, 作為footer區塊位置的參考 */
  102. position: relative;
  103. }
  104. .form-signin {
  105. max-width: 330px;
  106. padding: 15px;
  107. }
  108. .form-signin .form-floating:focus-within {
  109. z-index: 2;
  110. }
  111. .form-signin input[type="email"] {
  112. margin-bottom: -1px;
  113. border-bottom-right-radius: 0;
  114. border-bottom-left-radius: 0;
  115. }
  116. .form-signin input[type="password"] {
  117. margin-bottom: 10px;
  118. border-top-left-radius: 0;
  119. border-top-right-radius: 0;
  120. }
  121. </style>
  122. {% endblock %}
  123. {% block main %}
  124. <div id="wrapper" style="height: 500px;">
  125. <!-- 選擇燒錄桶槽 -->
  126. <div class="form-signin w-100 m-auto">
  127. <img class="mb-4" src="../static/img/ALMIGHTY_RAY.jpg" alt="" >
  128. <img class="mb-4" src="../static/img/SKYAI.jpg" alt="" >
  129. <h1 class="h3 mb-4 fw-normal"style="text-align:center;">選擇燒錄桶槽</h1>
  130. <div class="form-floating">
  131. <center><select id="prog_container" onchange="renew_tank()" class="form-control" ></center>
  132. <option value="CI">清洗入料槽</option>
  133. <option value="C">清洗槽</option>
  134. <option value="R">中水桶</option>
  135. <option value="S">色選機</option>
  136. <option value="SO">色選機出料槽</option>
  137. <option value="P">脫皮機</option>
  138. <option value="PO">脫皮機出料槽</option>
  139. <option value="FI">發酵入料槽</option>
  140. <option value="F">發酵槽</option>
  141. <option value="FO">發酵出料槽</option>
  142. <option value="DI">乾燥入料槽</option>
  143. <option value="D">乾燥槽</option>
  144. <option value="DO">乾燥出料槽</option>
  145. </select>
  146. </div>
  147. <div class="form-floating">
  148. <center><select id="prog_tank" onchange="" class="form-control" ></center>
  149. <option value="CI1">1</option>
  150. <option value="CI2">2</option>
  151. </select>
  152. </div>
  153. <div class="checkbox mb-3">
  154. <label>
  155. </label>
  156. </div>
  157. <center><input type="button" class="w-40 btn btn-lg btn-secondary" value="確認" onclick="GoToBoardLoaderPage()"></center>
  158. </div>
  159. </div>
  160. {% endblock %}
  161. {% block script2 %}
  162. <script>
  163. $("#coffee_title_pc").text('板子燒錄介面');
  164. $("#coffee_title_phone").text('板子燒錄介面');
  165. // 貨櫃-桶槽對應
  166. const containerTOtank = {
  167. 'CI':[{'CI1':'1'}, {'CI2':'2'}],
  168. 'C':[{'C1':'1'}, {'C2':'2'}, {'C3':'3'}, {'C4':'4'}],
  169. 'R':[{'R1':'1'}],
  170. 'S':[{'S1':'1'},{'S2':'2'}],
  171. 'SO':[{'SO1':'1'},{'SO2':'2'}],
  172. 'P':[{'P1':'1'},{'P2':'2'}],
  173. 'PO':[{'PO1':'1'},{'PO2':'2'}],
  174. 'FI':[{'FI1':'1'},{'FI2':'2'}],
  175. 'F':[{'F1':'1'}, {'F2':'2'}, {'F3':'3'}, {'F4':'4'}, {'F5':'5'}, {'F6':'6'},
  176. {'F7':'7'}, {'F8':'8'}, {'F9':'9'}, {'F10':'10'}, {'F11':'11'}, {'F12':'12'}],
  177. 'FO':[{'FO1':'1'}, {'FO2':'2'}],
  178. 'DI':[{'DI1':'1'}, {'DI2':'2'}],
  179. 'D':[{'D1':'1'}, {'D2':'2'}, {'D3':'3'}, {'D4':'4'}, {'D5':'5'}, {'D6':'6'},
  180. {'D7':'7'}, {'D8':'8'}, {'D9':'9'}, {'D10':'10'}, {'D11':'11'}, {'D12':'12'}],
  181. 'DO':[{'DO1':'1'}, {'DO2':'2'}]
  182. }
  183. </script>
  184. <script>
  185. function renew_tank() {
  186. var prog_container_value = $("#prog_container").val();
  187. // console.log("prog_container_value: " + prog_container_value);
  188. Value = '';
  189. try {
  190. for (let i = 0; i < containerTOtank[prog_container_value].length; i++) {
  191. Value += '<option value="' + Object.keys(containerTOtank[prog_container_value][i]) + '">' + Object.values(containerTOtank[prog_container_value][i]) + '</option>';
  192. }
  193. } catch (error) {
  194. if (error.name === 'TypeError') {
  195. Value = '';
  196. }
  197. }
  198. var sectorSelect = document.getElementById("prog_tank");
  199. if (sectorSelect != null) {
  200. sectorSelect.innerHTML = Value;
  201. }
  202. }
  203. function GoToBoardLoaderPage() {
  204. var Tank_ID = $("#prog_container").val();
  205. var target_tank = $("#prog_tank").val();
  206. var confirm_GoToBoardLoaderPage = confirm("目前燒錄桶槽為 " + target_tank + "\n點擊 [確定] 按鈕後, 前往指定燒錄桶槽介面 ");
  207. if (confirm_GoToBoardLoaderPage) {
  208. location.href = "/board_loader_" + target_tank;
  209. }
  210. }
  211. </script>
  212. {% endblock %}