diff --git a/TeacherHomeWork-vite/src/views/GradeManager/GradeLMangerList.vue b/TeacherHomeWork-vite/src/views/GradeManager/GradeLMangerList.vue index 78a29ec12b50eb0ebc6047db70ba3d90230e05ab..5c5a9babfab41d24cb7bcca131e67e76ad02cd45 100644 --- a/TeacherHomeWork-vite/src/views/GradeManager/GradeLMangerList.vue +++ b/TeacherHomeWork-vite/src/views/GradeManager/GradeLMangerList.vue @@ -35,10 +35,10 @@ - + - + @@ -132,7 +132,8 @@ const filteredTableData = computed(() => { const handleEdit = (student) => { dialogVisible.value = true; - console.log('编辑学生:', student.username); + Object.assign(form.value, student); // 将选中学生的数据复制到表单中 + //console.log('编辑学生:', student.username); }; const handleDelete = (username) => { @@ -158,6 +159,14 @@ const getTagText = (totalScore) => { if (totalScore >= 60) return '及格'; return '不及格'; }; + +const save = () => { + const index = tableData.value.findIndex(student => student.username === form.value.username); + if (index !== -1) { + tableData.value[index] = { ...form.value }; // 更新学生数据 + } + dialogVisible.value = false; // 关闭弹窗 +};