drop_down_list_12094layers.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>{{ title }}</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. <!--可用來建立使用者小圖示-->
  16. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  17. <style>
  18. .newcondition_css {
  19. padding: 10px;
  20. margin-top: 10px;
  21. background-color:honeydew;
  22. }
  23. hr {
  24. margin-top: 5px;
  25. margin-bottom: 5px;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <!--
  31. <script>
  32. // [系統]更新:Array / renew_system function
  33. system_object = new Array();
  34. system_object[0] = [" "];
  35. system_object[1] = [" ", "清洗槽組立"];
  36. system_object[2] = [" ", "發酵桶組立"];
  37. system_object[3] = [" ", "乾燥桶組立"];
  38. function renew_system(index) {
  39. var Value="";
  40. for(var i=0; i<system_object[index].length; i++){
  41. Value = Value + '<option value=' + system_object[index][i] + '> ' + system_object[index][i] + '</option>';
  42. }
  43. var sectorSelect = document.getElementById("system");
  44. sectorSelect.innerHTML = Value;
  45. $('#product_index').text(index)
  46. }
  47. // [模組]更新:Array / renew_system function
  48. module_object = new Array();
  49. module_object[0] = [" "];
  50. module_object[1] = [" ", "c1上蓋組立", "c2內桶槽組立"];
  51. module_object[2] = [" ", "f1上蓋組立", "f2控制盒組立"];
  52. module_object[3] = [" ", "d1上蓋組立", "d2控制盒組立"];
  53. function renew_module(index) {
  54. var Value="";
  55. for(var i=0; i<module_object[index].length; i++){
  56. Value = Value + '<option value=' + module_object[index][i] + '>' + module_object[index][i] + '</option>';
  57. }
  58. var sectorSelect = document.getElementById("module");
  59. sectorSelect.innerHTML = Value;
  60. $('#system_index').text(index)
  61. }
  62. // // [零件]更新:Array / renew_system function
  63. component_object = new Array();
  64. component_object[0] = [" "];
  65. component_object[1][1] = [" ", "c1_M10平墊圈", "c1_M10螺帽"];
  66. component_object[1][2] = [" ", "c2_內桶槽", "c2_內桶槽固定環"];
  67. component_object[2][1] = [" ", "f1_吸料機入料管", "f1_入料斗擋板"];
  68. component_object[2][2] = [" ", "f2_LED指示燈 綠色 TB12LED-G0201", "f2_K3 LED指示燈-主板"];
  69. component_object[3][1] = [" ", "d1_軸心(單邊出軸)", "d1_墊片M18x25x1.5"];
  70. component_object[3][2] = [" ", "d2_M3x5螺絲", "d2_M3x5銅柱 1公1母"];
  71. function renew_component(product_index, index) {
  72. var Value="";
  73. for(var i=0; i<component_object[product_index][index].length; i++){
  74. Value = Value + '<option value=' + component_object[product_index][index] + '>' + component_object[index][i] + '</option>';
  75. }
  76. var sectorSelect = document.getElementById("component");
  77. sectorSelect.innerHTML = Value;
  78. $('#module_index').text(index)
  79. }
  80. // // 輸出零件 index
  81. function renew_item(index) {
  82. $('#component_index').text(index)
  83. }
  84. </script>
  85. -->
  86. <br>
  87. 產品:
  88. <!-- -->
  89. <select id="product" onChange="renew_system(this.selectedIndex);">
  90. </select>
  91. 系統:
  92. <select id="system" onChange="renew_module(this.selectedIndex);">
  93. </select>
  94. 模組:
  95. <select id="module" onChange="renew_component(this.selectedIndex);">
  96. </select>
  97. 零件:
  98. <select id="component" onChange="renew_item(this.selectedIndex);">
  99. </select>
  100. <br>
  101. 產品:<span id="product_index"></span><br>
  102. 系統:<span id="system_index"></span><br>
  103. 模組:<span id="module_index"></span><br>
  104. 零件:<span id="component_index"></span><br>
  105. <script>
  106. // 資料庫中的所有 [產品]
  107. var product_item = ['*', '清洗貨櫃', '發酵貨櫃', '乾燥貨櫃']
  108. var inner = '';
  109. for (let i = 0; i < product_item.length; i++) {
  110. inner += '<option value=' + i + '>' + product_item[i] + '</option>';
  111. }
  112. var sectorSelect = document.getElementById("product");
  113. sectorSelect.innerHTML = inner;
  114. // 系統的 index
  115. var noIndex;
  116. // [系統]更新:Array / renew_system function
  117. system_object = new Array();
  118. system_object[0] = ["*"];
  119. system_object[1] = ["*", "清洗槽組立", "CCC"];
  120. system_object[2] = ["*", "發酵桶組立", "FFF"];
  121. system_object[3] = ["*", "乾燥桶組立", "DDD"];
  122. function renew_system(index) {
  123. noIndex = index
  124. var inner = '';
  125. for (let i = 0; i < system_object[index].length; i++) {
  126. inner += '<option value=' + i + '>' + system_object[index][i] + '</option>';
  127. }
  128. var sectorSelect = document.getElementById("system");
  129. sectorSelect.innerHTML = inner;
  130. }
  131. // 模組的 index
  132. var moIndex;
  133. // [模組]更新:Array / renew_system function
  134. module_object = new Array();
  135. module_object[0] = ["*"];
  136. module_object[1] = ["*", "清洗槽組立", "ccc"];
  137. module_object[2] = ["*", "發酵桶組立", "fff"];
  138. module_object[3] = ["*", "乾燥桶組立", "ddd"];
  139. module_object[0][0] = ["*"];
  140. module_object[1][1] = ["*", "c1上蓋組立", "c2內桶槽組立"];
  141. module_object[2][1] = ["*", "f1上蓋組立", "f2控制盒組立"];
  142. module_object[3][1] = ["*", "d1上蓋組立", "d2控制盒組立"];
  143. function renew_module(index) {
  144. moIndex = index
  145. console.log("renew_module START")
  146. var inner = '';
  147. for (let i = 0; i < module_object[noIndex][index].length; i++) {
  148. inner += '<option value=' + i + '>' + module_object[noIndex][index][i] + '</option>';
  149. }
  150. console.log("module: " + inner)
  151. var sectorSelect = document.getElementById("module");
  152. sectorSelect.innerHTML = inner;
  153. console.log("renew_module END")
  154. }
  155. // 零件
  156. // // [零件]更新:Array / renew_system function
  157. component_object = new Array();
  158. component_object[0] = ["*"];
  159. component_object[1] = ["*", "清洗槽組立", "ccc"];
  160. component_object[2] = ["*", "發酵桶組立", "fff"];
  161. component_object[3] = ["*", "乾燥桶組立", "ddd"];
  162. component_object[0][0] = ["*"];
  163. component_object[1][1] = ["*", "c1上蓋組立", "c2內桶槽組立"];
  164. component_object[2][1] = ["*", "f1上蓋組立", "f2控制盒組立"];
  165. component_object[3][1] = ["*", "d1上蓋組立", "d2控制盒組立"];
  166. component_object[0][0][0] = ["*"];
  167. component_object[1][1][0] = ["*"];
  168. component_object[1][1][1] = ["*", "c1_M10平墊圈", "c1_M10螺帽"];
  169. component_object[1][1][2] = ["*", "c2_內桶槽", "c2_內桶槽固定環"];
  170. component_object[2][1][0] = ["*"];
  171. component_object[2][1][1] = ["*", "f1_吸料機入料管", "f1_入料斗擋板"];
  172. component_object[2][1][2] = ["*", "f2_LED指示燈 綠色 TB12LED-G0201", "f2_K3 LED指示燈-主板"];
  173. component_object[3][1][0] = ["*"];
  174. component_object[3][1][1] = ["*", "d1_軸心(單邊出軸)", "d1_墊片M18x25x1.5"];
  175. component_object[3][1][2] = ["*", "d2_M3x5螺絲", "d2_M3x5銅柱 1公1母"];
  176. function renew_component(index) {
  177. var Value="";
  178. for(var i=0; i<component_object[noIndex][moIndex][index].length; i++){
  179. Value = Value + '<option value=' + i + '>' + component_object[noIndex][moIndex][index][i] + '</option>';
  180. }
  181. var sectorSelect = document.getElementById("component");
  182. sectorSelect.innerHTML = Value;
  183. }
  184. </script>
  185. </body>
  186. </html>