fix: 修复班级切换时选中状态保持问题

This commit is contained in:
QDKF 2025-09-25 20:29:08 +08:00
parent 8297d62258
commit 41cccd9f7a

View File

@ -1665,19 +1665,22 @@ const handleTemplateDownload = (type?: string) => {
//
const handleSearch = () => {
// filteredData
//
//
paginationPage.value = 1
selectedRowKeys.value = [] //
}
//
//
watch(searchKeyword, () => {
paginationPage.value = 1
selectedRowKeys.value = [] //
})
//
const clearSearch = () => {
searchKeyword.value = ''
paginationPage.value = 1
selectedRowKeys.value = [] //
}
//
@ -1839,9 +1842,10 @@ watch(
if (newClassId !== oldClassId) {
// watch
selectedDepartment.value = newClassId ? String(newClassId) : ''
//
//
searchKeyword.value = ''
paginationPage.value = 1
selectedRowKeys.value = [] //
loadData(newClassId)
}
},
@ -1857,9 +1861,10 @@ watch(
// props.classIdprops
const currentPropsClassId = props.classId ? String(props.classId) : ''
if (newDepartmentId !== oldDepartmentId && newDepartmentId !== currentPropsClassId) {
//
//
searchKeyword.value = ''
paginationPage.value = 1
selectedRowKeys.value = [] //
const targetClassId = newDepartmentId || null
loadData(targetClassId)
}