stu
This commit is contained in:
parent
fba8df4041
commit
a2b2a66c31
|
@ -151,7 +151,7 @@ const formData = ref({
|
|||
classes: "",
|
||||
status: "",
|
||||
})
|
||||
const visible = ref(false)
|
||||
const visible = ref(true)
|
||||
const studentList = ref([]);
|
||||
|
||||
const studentColumns = ref([
|
||||
|
@ -213,7 +213,7 @@ const onSubmit = async () => {
|
|||
studentData.status
|
||||
) {
|
||||
const res = await getStudents(studentData);
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
studentList.value = Array.from(res);
|
||||
pagination.total = res.length;
|
||||
} else {
|
||||
|
@ -229,10 +229,11 @@ const onReset = () => {
|
|||
//获取表格数据
|
||||
const TableData = async () => {
|
||||
const res = await getList()
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
studentList.value = res.data.list
|
||||
pagination.total = res.data.list.length
|
||||
}
|
||||
console.log(TableData.name);
|
||||
|
||||
onMounted(() => {
|
||||
TableData()
|
||||
|
@ -240,11 +241,30 @@ onMounted(() => {
|
|||
|
||||
// 修改学生状态
|
||||
const Modify = row => {
|
||||
visible.value = true
|
||||
conlose.log(1)
|
||||
visible.value = true;
|
||||
formData.value = {
|
||||
name: row.label,
|
||||
name: row.name,
|
||||
gender: row.gender,
|
||||
studentId: row.studentId,
|
||||
department: row.department,
|
||||
major: row.major,
|
||||
classes: row.classes,
|
||||
status: row.status,
|
||||
};
|
||||
};
|
||||
|
||||
const onConfirmAnother = async () => {
|
||||
try {
|
||||
// 这里假设存在一个更新学生信息的API方法,例如updateStudent
|
||||
await updateStudent(formData.value);
|
||||
// 更新成功后,关闭弹窗并重新加载表格数据
|
||||
visible.value = false;
|
||||
TableData();
|
||||
} catch (error) {
|
||||
console.error('更新学生信息失败:', error);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
Loading…
Reference in New Issue
Block a user