You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.8 KiB

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>课堂点名系统</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<script src="script.js"></script> <!-- 引入你的函数文件 -->
<style>
.move-button {
margin-top: 300px; /* 向下移动 30 像素 */
margin-left: 200px; /* 向右移动 20 像素 */
}
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
h1 {
color: #333;
margin-bottom: 20px;
}
input[type="file"] {
margin-bottom: 10px;
padding: 10px;
border: 2px solid #007BFF;
border-radius: 5px;
width: 250px;
}
button {
background-color: #020202;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
margin: 5px;
transition: background-color 0.3s;
margin-top: 20px; /* 向下移动 20 像素 */
margin-left: 10px; /* 向右移动 10 像素 */
}
button:hover {
background-color: #0056b3;
}
#result {
margin-top: 100px;
padding: 10px;
background: white;
border: 1px solid #ddd;
border-radius: 5px;
width: 500px;
text-align: center;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body>
<div id="app">
<h1>课堂点名系统</h1>
<button @click="uploadFile">上传学生名单</button>
<button @click="getRandomStudent">随机点名</button>
<div id="result">{{ result }}</div>
<input type="file" id="fileInput" accept=".xlsx" @change="handleFileUpload" />
</div>
<script>
new Vue({
el: '#app',
data: {
result: ''
},
methods: {
uploadFile() {
// 调用外部的 uploadFile 函数
uploadFile();
},
getRandomStudent() {
// 调用外部的 getRandomStudent 函数
getRandomStudent();
},
handleFileUpload(event) {
const file = event.target.files[0];
// 处理文件上传
if (file) {
this.uploadFile();
}
},
creatroom(){
createroom();
}
}
});
</script>
</body>
</html>