Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Commit cbd7c20

Browse files
authored
Merge pull request #11 from Eromona/main
fix:P0 ERROR
2 parents 9894552 + a0790e3 commit cbd7c20

File tree

5 files changed

+242
-0
lines changed

5 files changed

+242
-0
lines changed

Eromona/test-site/images/R-C.png

239 KB
Loading

Eromona/test-site/index.html

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="zh-CN">
4+
<head>
5+
<link rel="stylesheet" href="styles\style.css"/ type="text/css"/>
6+
<meta charset="utf-8">
7+
<link rel="preconnect" href="https://fonts.googleapis.com">
8+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9+
<link href="https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&family=Zhi+Mang+Xing&display=swap" rel="stylesheet">
10+
<link href="https://fonts.googleapis.com/css2?family=Zhi+Mang+Xing&display=swap" rel="stylesheet">
11+
<link rel="icon" href="web\test-site\images\R-C.png" size="16x16"/>
12+
</head>
13+
<body>
14+
<h1>
15+
学生信息管理系统
16+
</h1>
17+
<div id="one">
18+
<button id="add">
19+
新增
20+
</button>
21+
<button id="delete">
22+
删除
23+
</button>
24+
</div>
25+
<p> </p>
26+
<table>
27+
<thead>
28+
<tr>
29+
<th><input type="checkbox" id="checkAll"/></th>
30+
<th>序号</th>
31+
<th>学号</th>
32+
<th>姓名</th>
33+
<th>学院</th>
34+
<th>专业</th>
35+
<th>年级</th>
36+
<th>班级</th>
37+
<th>年龄</th>
38+
<th>操作</th>
39+
</tr>
40+
</thead>
41+
<tbody>
42+
<tr>
43+
<td><input type="checkbox" name="item"/></td>
44+
<td>1</td>
45+
<td id="num">11111111111</td>
46+
<td>张三</td>
47+
<td>通信学院</td>
48+
<td>电子信息类</td>
49+
<td>2000</td>
50+
<td>6</td>
51+
<td>21</td>
52+
<td>查看 修改</td>
53+
</tr>
54+
<tr>
55+
<td><input type="checkbox" name="item"/></td>
56+
<td id="num">2</td>
57+
<td>2222222222</td>
58+
<td>李四</td>
59+
<td>通信学院</td>
60+
<td>电子信息类</td>
61+
<td>2000</td>
62+
<td>6</td>
63+
<td>21</td>
64+
<td>查看 修改</td>
65+
</tr>
66+
</tbody>
67+
</table>
68+
<p>第1页/共1页</p>
69+
<div id="two">
70+
<button id="last">上一页</button>
71+
<button id="next">下一页</button>
72+
</div>
73+
<script src="scripts\main.js" defer></script>
74+
</body>
75+
</html>

Eromona/test-site/scripts/main.js

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
let num;
2+
let nums;
3+
4+
function numSetting(){
5+
nums=document.querySelectorAll("#num");
6+
num=nums.length;
7+
}
8+
9+
document.getElementById("add").onclick=function(){
10+
numSetting();
11+
num=num+1;
12+
let id=prompt("学号");
13+
let name=prompt("姓名");
14+
let academy=prompt("学院");
15+
let major=prompt("专业");
16+
let year=prompt("年级");
17+
let cla=prompt("班级");
18+
let age=prompt("年龄");
19+
let operation="查看 修改";
20+
21+
let td_checkBox=document.createElement("td");
22+
let td_num=document.createElement("td");
23+
let td_id=document.createElement("td");
24+
let td_name=document.createElement("td");
25+
let td_academy=document.createElement("td");
26+
let td_major=document.createElement("td");
27+
let td_year=document.createElement("td");
28+
let td_cla=document.createElement("td");
29+
let td_age=document.createElement("td");
30+
let td_operation=document.createElement("td");
31+
32+
let text_num=document.createTextNode(num);
33+
let text_id=document.createTextNode(id);
34+
let text_name=document.createTextNode(name);
35+
let text_academy=document.createTextNode(academy);
36+
let text_major=document.createTextNode(major);
37+
let text_year=document.createTextNode(year);
38+
let text_cla=document.createTextNode(cla);
39+
let text_age=document.createTextNode(age);
40+
let text_operation=document.createTextNode(operation);
41+
42+
td_num.appendChild(text_num);
43+
td_id.appendChild(text_id);
44+
td_name.appendChild(text_name);
45+
td_academy.appendChild(text_academy);
46+
td_major.appendChild(text_major);
47+
td_year.appendChild(text_year);
48+
td_cla.appendChild(text_cla);
49+
td_age.appendChild(text_age);
50+
td_operation.appendChild(text_operation);
51+
52+
td_num.setAttribute("id","num");
53+
54+
let checkBox=document.createElement("input");
55+
checkBox.setAttribute("type","checkbox");
56+
checkBox.setAttribute("name","item");
57+
td_checkBox.appendChild(checkBox);
58+
59+
let tr=document.createElement("tr");
60+
tr.appendChild(td_checkBox);
61+
tr.appendChild(td_num);
62+
tr.appendChild(td_id);
63+
tr.appendChild(td_name);
64+
tr.appendChild(td_academy);
65+
tr.appendChild(td_major);
66+
tr.appendChild(td_year);
67+
tr.appendChild(td_cla);
68+
tr.appendChild(td_age);
69+
tr.appendChild(td_operation);
70+
let tbody=document.getElementsByTagName("tbody")[0];
71+
tbody.appendChild(tr);
72+
}
73+
74+
let checkAll=document.getElementById("checkAll");
75+
let checks=document.querySelectorAll("table>tbody>tr>td>input");
76+
let deletedTable;
77+
let deletedTr;
78+
let m;
79+
80+
checkAll.onclick=function(){
81+
checks=document.querySelectorAll("table>tbody>tr>td>input");
82+
for(m=0;m<checks.length;m++){
83+
checks[m].checked=checkAll.checked;
84+
}
85+
}
86+
87+
document.getElementById("delete").onclick=function(){
88+
checks=document.querySelectorAll("table>tbody>tr>td>input");
89+
for(m=0;m<checks.length;m++){
90+
if(checks[m].checked){
91+
deletedTable=checks[m].parentNode.parentNode.parentNode;
92+
deletedTr=checks[m].parentNode.parentNode;
93+
deletedTable.removeChild(deletedTr);
94+
}
95+
}
96+
}
97+
3.86 MB
Binary file not shown.

Eromona/test-site/styles/style.css

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
body{
2+
background-color:#ffeaaa;
3+
}
4+
h1{
5+
font-family: 'Zhi Mang Xing', cursive;
6+
font-size: 40px;
7+
color:rgb(147, 184, 252);
8+
text-shadow: 1px 1px 1px black;
9+
text-align: center;
10+
}
11+
button{
12+
border-radius: 8px;
13+
color:white;
14+
font-size:20px;
15+
background-color:greenyellow;
16+
17+
}
18+
#delete,#next{
19+
background-color: red;
20+
}
21+
table{
22+
font-family: 'ZCOOL KuaiLe', sans-serif;
23+
table-layout:fixed;
24+
width:100%;
25+
border-collapse: collapse;
26+
border:3px solid ;
27+
}
28+
thead th:nth-child(1){
29+
30+
}
31+
th{
32+
letter-spacing: 2px;
33+
}
34+
td{
35+
letter-spacing: 1px;
36+
}
37+
tbody td{
38+
text-align: center;
39+
}
40+
thead, tfoot {
41+
color: white;
42+
text-shadow: 1px 1px 1px black;
43+
}
44+
p{
45+
font-size: 10px;
46+
}
47+
tbody tr:nth-child(odd){
48+
background-color: white;
49+
}
50+
tbody tr:nth-child(even){
51+
background-color:#bdbdbd ;
52+
}
53+
thead th:nth-child(1),thead th:nth-child(2),thead th:nth-child(8){
54+
width:4%;
55+
}
56+
thead th:nth-child(4){
57+
width:10%;
58+
}
59+
thead th:nth-child(9){
60+
width:10%;
61+
}
62+
thead th:nth-child(5),thead th:nth-child(10){
63+
width:12%;
64+
}
65+
thead th:nth-child(6),thead th:nth-child(3){
66+
width:16%;
67+
}
68+
#two{
69+
text-align: right;
70+
}

0 commit comments

Comments
 (0)