index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>LabStatistics</title>
  7. <style>
  8. body {
  9. font-family: Arial, sans-serif;
  10. margin: 0;
  11. padding: 0;
  12. display: flex;
  13. align-items: center;
  14. justify-content: center;
  15. min-height: 100vh;
  16. background-color: #f4f4f9;
  17. }
  18. .container {
  19. display: flex;
  20. flex-direction: column;
  21. width: 90%;
  22. max-width: 900px;
  23. background: #fff;
  24. padding: 1.5rem;
  25. border-radius: 8px;
  26. box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  27. }
  28. .tabs {
  29. display: flex;
  30. border-bottom: 1px solid #ddd;
  31. margin-bottom: 1.5rem;
  32. justify-content: space-around;
  33. align-items: center;
  34. }
  35. .tab {
  36. padding: 0.5rem 0.2rem;
  37. cursor: pointer;
  38. border: 1px solid transparent;
  39. border-bottom: none;
  40. border-radius: 4px 4px 0 0;
  41. transition: all 0.3s ease;
  42. text-align: center;
  43. width: 100%;
  44. }
  45. .tab.active {
  46. border-color: #ddd;
  47. border-bottom-color: #fff;
  48. background-color: #fff;
  49. color: #007bff;
  50. font-weight: bold;
  51. }
  52. .tab-content {
  53. display: none;
  54. }
  55. .tab-content.active {
  56. display: block;
  57. }
  58. .content-container {
  59. display: flex;
  60. flex-direction: row;
  61. gap: 2rem;
  62. width: 100%;
  63. }
  64. .input-section,
  65. .results-section {
  66. flex: 1;
  67. display: flex;
  68. flex-direction: column;
  69. justify-content: space-around;
  70. }
  71. h1 {
  72. font-size: 1.5rem;
  73. margin-bottom: 1rem;
  74. }
  75. .input-group {
  76. display: flex;
  77. flex-direction: column;
  78. gap: 1rem;
  79. max-height: 300px;
  80. overflow-y: auto;
  81. }
  82. .input-row {
  83. display: flex;
  84. align-items: center;
  85. }
  86. .input-row span {
  87. width: 80px;
  88. font-size: 0.9rem;
  89. }
  90. .input-row input {
  91. flex: 1;
  92. }
  93. .error-point-header {
  94. font-size: 1.17em;
  95. font-weight: bold;
  96. margin-block-start: 1em;
  97. margin-block-end: 1em;
  98. display: flex;
  99. align-items: center;
  100. }
  101. .error-point-input {
  102. width: 60px;
  103. text-align: right;
  104. font-weight: bold;
  105. font-size: 1.17em;
  106. border: 1px solid #ccc;
  107. border-radius: 4px;
  108. padding: 2px 4px;
  109. margin-right: 2px;
  110. }
  111. .delete-btn {
  112. color: #ff0000;
  113. cursor: pointer;
  114. margin-left: 10px;
  115. font-size: 1.2rem;
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. width: 30px;
  120. }
  121. .add-input-btn {
  122. margin-top: 10px;
  123. padding: 8px 12px;
  124. background-color: #007bff;
  125. color: white;
  126. border-radius: 4px;
  127. cursor: pointer;
  128. text-align: center;
  129. transition: background-color 0.3s;
  130. }
  131. .add-input-btn:hover {
  132. background-color: #0056b3;
  133. }
  134. input[type="number"] {
  135. padding: 0.5rem;
  136. font-size: 1rem;
  137. border: 1px solid #ccc;
  138. border-radius: 4px;
  139. transition: border-color 0.3s;
  140. }
  141. input[type="number"]:focus {
  142. outline: none;
  143. border-color: #007bff;
  144. }
  145. .results {
  146. display: flex;
  147. flex-direction: column;
  148. gap: 0.5rem;
  149. }
  150. .result-item {
  151. font-size: 1rem;
  152. color: #333;
  153. }
  154. .result-item:nth-child(4) {
  155. color: #0f72db;
  156. }
  157. .result-item:nth-child(5) {
  158. color: #11b9b9;
  159. }
  160. #stdDev {
  161. color: #0f72db;
  162. }
  163. #rsd {
  164. color: #11b9b9;
  165. }
  166. .stability-container,
  167. .error-container {
  168. display: flex;
  169. flex-direction: column;
  170. gap: 1rem;
  171. margin-bottom: 1.5rem;
  172. }
  173. .progress-container {
  174. display: inline-flex;
  175. position: relative;
  176. padding: 0.2rem 0.5rem;
  177. border-radius: 4px;
  178. background: linear-gradient(to right, #a9d3ff var(--progress-percent), #e0e0e0 var(--progress-percent));
  179. background-size: 100% 100%;
  180. transition: background-position 0.3s ease;
  181. gap: 0.8rem;
  182. align-items: center;
  183. margin-bottom: 1rem;
  184. justify-content: center;
  185. }
  186. .progress-container.completed {
  187. background: linear-gradient(to right, #ff0000 100%, #e0e0e0 100%);
  188. }
  189. .stability-time-display {
  190. font-size: 0.9rem;
  191. color: #666;
  192. position: relative;
  193. z-index: 1;
  194. }
  195. .stability-time-display.warning {
  196. color: #ff0000;
  197. font-weight: bold;
  198. }
  199. .error-point-container {
  200. border: 1px solid #eee;
  201. border-radius: 4px;
  202. padding: 1rem;
  203. margin-bottom: 1rem;
  204. min-width: 180px;
  205. flex-shrink: 0;
  206. }
  207. .error-inputs {
  208. display: flex;
  209. flex-direction: column;
  210. gap: 0.5rem;
  211. margin: 0.5rem 0;
  212. }
  213. .error-input {
  214. width: 100%;
  215. }
  216. .button-container {
  217. display: flex;
  218. justify-content: space-between;
  219. width: 100%;
  220. gap: 1rem;
  221. }
  222. .export-btn,
  223. .import-btn {
  224. flex: 1;
  225. padding: 1rem;
  226. border: none;
  227. border-radius: 4px;
  228. background-color: #007bff;
  229. color: white;
  230. font-size: 1rem;
  231. cursor: pointer;
  232. transition: background-color 0.3s;
  233. }
  234. .export-btn:hover,
  235. .import-btn:hover {
  236. background-color: #0056b3;
  237. }
  238. .error-result {
  239. margin-top: 0.5rem;
  240. font-weight: bold;
  241. }
  242. .error-container {
  243. display: flex;
  244. flex-direction: row;
  245. gap: 1rem;
  246. overflow-x: auto;
  247. padding-bottom: 1rem;
  248. }
  249. .chart-container {
  250. margin-top: 1.5rem;
  251. position: relative;
  252. border: 1px solid #ddd;
  253. border-radius: 4px;
  254. padding-left: 1%;
  255. }
  256. canvas {
  257. width: 100%;
  258. height: 100%;
  259. }
  260. @media (max-width: 600px) {
  261. .container {
  262. width: 86%;
  263. flex-direction: column;
  264. }
  265. .content-container {
  266. flex-direction: column;
  267. }
  268. .input-section,
  269. .results-section {
  270. width: 100%;
  271. }
  272. h1 {
  273. font-size: 1.2rem;
  274. }
  275. input[type="number"] {
  276. font-size: 0.9rem;
  277. padding: 0.4rem;
  278. }
  279. .error-container {
  280. padding-bottom: 0.5rem;
  281. }
  282. .error-point-container {
  283. min-width: 150px;
  284. }
  285. .error-inputs {
  286. flex-direction: column;
  287. }
  288. .error-input {
  289. width: 92%;
  290. }
  291. }
  292. </style>
  293. </head>
  294. <body>
  295. <audio id="alertSound" src="./alert.mp3" preload="auto" loop></audio>
  296. <!-- 倒计时设置对话框 -->
  297. <div id="timer-dialog"
  298. style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center;">
  299. <div style="background-color: white; padding: 20px; border-radius: 8px; width: 300px;">
  300. <h3 style="margin-top: 0;">倒计时设置</h3>
  301. <div style="margin-bottom: 15px;">
  302. <label for="timer-minutes">分钟:</label>
  303. <input type="number" id="timer-minutes" min="0" max="60" value="10"
  304. style="width: 60px; margin-right: 10px;">
  305. <label for="timer-seconds">秒钟:</label>
  306. <input type="number" id="timer-seconds" min="0" max="59" value="0"
  307. style="width: 60px;">
  308. </div>
  309. <div style="display: flex; justify-content: space-around;">
  310. <button onclick="startTimer()"
  311. style="padding: 8px 12px; background-color: #007bff; color: white; border: none; border-radius: 4px; cursor: pointer;">开始</button>
  312. <button onclick="resetTimer()"
  313. style="padding: 8px 12px; background-color: #dc3545; color: white; border: none; border-radius: 4px; cursor: pointer;">复位</button>
  314. <button onclick="closeTimerDialog()"
  315. style="padding: 8px 12px; background-color: #6c757d; color: white; border: none; border-radius: 4px; cursor: pointer;">关闭</button>
  316. </div>
  317. </div>
  318. </div>
  319. <div id="container" class="container">
  320. <div class="progress-container" onclick="openTimerDialog()" style="cursor: pointer;">
  321. <span id="current-time" class="stability-time-display"></span>
  322. <span class="stability-time-display"> · </span>
  323. <span id="countdown" class="stability-time-display">10:00</span>
  324. </div>
  325. <div class="tabs">
  326. <div class="tab active" data-tab="repeatability">重复性</div>
  327. <div class="tab" data-tab="stability">稳定性</div>
  328. <div class="tab" data-tab="error">示值误差</div>
  329. <div class="tab" data-tab="data">数据</div>
  330. </div>
  331. <!-- 重复性标签页 -->
  332. <!-- <div id="repeatability" class="tab-content active"> </div> -->
  333. <!-- 稳定性标签页 -->
  334. <!-- <div id="stability" class="tab-content"> </div> -->
  335. <!-- 示值误差标签页 -->
  336. <!-- <div id="error" class="tab-content"> </div> -->
  337. <!-- 数据标签页 -->
  338. <!-- <div id="data" class="tab-content"> </div> -->
  339. </div>
  340. <script src="./chart.js"></script>
  341. <script src="./utils.js"></script>
  342. <script src="./pageRepeatability.js"></script>
  343. <script src="./pageStability.js"></script>
  344. <script src="./pageError.js"></script>
  345. <script src="./pageData.js"></script>
  346. <script src="./common.js"></script>
  347. </body>
  348. </html>