Repository navigation
Expand file tree
/
Copy pathtemp.html
More file actions
114 lines (105 loc) · 4.34 KB
/
Copy pathtemp.html
File metadata and controls
114 lines (105 loc) · 4.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>眼轴长度和角膜曲率半径收集</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
.form-container {
max-width: 400px;
margin: 0 auto;
}
.form-group {
margin-bottom: 15px;
}
label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
input {
width: 100%;
padding: 8px;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px 15px;
border: none;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
.output {
margin-top: 10px;
font-size: 16px;
color: #333;
}
</style>
</head>
<body>
<div class="form-container">
<h2>收集左右眼数据</h2>
<form id="eyeDataForm">
<div class="form-group">
<label for="leftEyeAL">左眼眼轴长度 (mm):</label>
<input type="number" id="leftEyeAL" name="leftEyeAL" step="0.01" placeholder="请输入左眼眼轴长度" required>
</div>
<div class="form-group">
<label for="leftEyeCR">左眼角膜曲率半径 (mm):</label>
<input type="number" id="leftEyeCR" name="leftEyeCR" step="0.01" placeholder="请输入左眼角膜曲率半径" required>
</div>
<div class="output" id="leftEyeSEOutput"></div>
<div class="form-group">
<label for="rightEyeAL">右眼眼轴长度 (mm):</label>
<input type="number" id="rightEyeAL" name="rightEyeAL" step="0.01" placeholder="请输入右眼眼轴长度" required>
</div>
<div class="form-group">
<label for="rightEyeCR">右眼角膜曲率半径 (mm):</label>
<input type="number" id="rightEyeCR" name="rightEyeCR" step="0.01" placeholder="请输入右眼角膜曲率半径" required>
</div>
<div class="output" id="rightEyeSEOutput"></div>
<button type="submit">提交</button>
</form>
</div>
<script>
document.getElementById('eyeDataForm').addEventListener('input', function() {
const leftEyeAL = parseFloat(document.getElementById('leftEyeAL').value);
const leftEyeCR = parseFloat(document.getElementById('leftEyeCR').value);
const rightEyeAL = parseFloat(document.getElementById('rightEyeAL').value);
const rightEyeCR = parseFloat(document.getElementById('rightEyeCR').value);
const leftEyeSEOutput = document.getElementById('leftEyeSEOutput');
const rightEyeSEOutput = document.getElementById('rightEyeSEOutput');
if (!isNaN(leftEyeAL) && !isNaN(leftEyeCR)) {
const leftSE = 43.86 - 14.73 * (leftEyeAL / leftEyeCR);
leftEyeSEOutput.textContent = `左眼SE值: ${leftSE.toFixed(2)}`;
} else {
leftEyeSEOutput.textContent = '';
}
if (!isNaN(rightEyeAL) && !isNaN(rightEyeCR)) {
const rightSE = 43.86 - 14.73 * (rightEyeAL / rightEyeCR);
rightEyeSEOutput.textContent = `右眼SE值: ${rightSE.toFixed(2)}`;
} else {
rightEyeSEOutput.textContent = '';
}
});
document.getElementById('eyeDataForm').addEventListener('submit', function(event) {
event.preventDefault();
const leftEyeAL = document.getElementById('leftEyeAL').value;
const leftEyeCR = document.getElementById('leftEyeCR').value;
const rightEyeAL = document.getElementById('rightEyeAL').value;
const rightEyeCR = document.getElementById('rightEyeCR').value;
console.log('左眼眼轴长度:', leftEyeAL, 'mm');
console.log('左眼角膜曲率半径:', leftEyeCR, 'mm');
console.log('右眼眼轴长度:', rightEyeAL, 'mm');
console.log('右眼角膜曲率半径:', rightEyeCR, 'mm');
});
</script>
</body>
</html>